This trial lab is for you to test out the CourseMarker system and to iron out any problem before we start the first lab assignment in week 4. This trial lab is not graded.
For more information on CourseMarker, please refer to CS1101X lab page and CS1101X IVLE forum. (CS1101X IVLE forum is open to all students. If you are not taking CS1101X, you can bookmark it in IVLE to access the forum.)
You may assume that all input data are correct.
In general, you should use Scanner class on System.in for input and System.out for output in your programs, unless otherwise stated.
Test your programs thoroughly with your own input data before you submit to CourseMarker. Do not use CourseMarker as a debugging tool. For this trial lab, the number of submissions is set to 99.
If you have any questions, you may post your queries in the IVLE forum of your respective lecture group.
Important!
Please use this trial lab to test out the CourseMarker
system to ensure that it works before actual lab starts
in week 4. For installation details, please refer to the
CourseMarker website.
If you have problem with the installation, you may
post your queries in the IVLE forum of your
respective lecture group,
email cmarker@comp.nus.edu.sg,
or approach the Technical Services counter
at the ground floor of COM1.
Write a program that reads three positive integers representing the length, width and height of a cube, and computes the volume of the cube.
You may assume that the volume of the cube does not exceed the maximum value representable in the int data type. (What is that maximum value?)
Sample run using interactive input (user's input shown in blue; output shown in bold purple):
$ javac Cube.java $ java Cube Enter length: 12 Enter width : 3 Enter height: 10 Volume = 360
Submit your program through CourseMarker.
You may want to explore more since you are new in programming. You can try the following suggestions just for your own practice (do not submit to CourseMarker!). The suggestions are independent of one another. You may try other changes on your own. You may discuss your observation with your discussion leader.
The deadline for handing in all programs is 27 August 2008, Wednesday, 23:59. Late submissions will NOT be accepted.