Archive

Posts Tagged ‘Introduction to Java’

C1022 Introduction to Java Term 1 2008 assignment

February 1st, 2009

Hi! :)
This time I will post the assignment that I get for C1022 Introduction to Java module in Term 1 2008.

SECTION A

A1.      Write Java statements to accomplish each of the following:

a)      Declare a variable ‘reply’ to be of type char.

char reply;

b)      To compare the contents of both variables ‘pass’ and ‘word’ of type String.

pass.compareTo (word) > 0;

pass.compareTo (word) == 0;

pass.compareTo (word) < 0;

pass.compareTo (word) > 0;

pass.equals (word);

pass.equalsIgnoreCase (word);

c)      To assign a float value 2.5 to a variable ‘number.

float number = 2.5f;

d)     Display a message ‘happy new year’ using a method from the Systems class.

Click here to read the full post…

admin Education, IDIC, Informatics , , , ,

Bad Behavior has blocked 304 access attempts in the last 7 days.

Bad Behavior has blocked 304 access attempts in the last 7 days.