Trial Lab
Trial Lab (CS1101 AY2008/9 Semester 1)
This lab assignment is not graded.
Date of release: 19 August 2008, Tuesday, 23:59.
Submission deadline: 27 August 2008, Wednesday, 23:59.
School of Computing, National University of Singapore

0 Introduction

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.


1 Exercise 1: Cube

1.1 Learning objectives

1.2 Task

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?)

1.3 Sample run

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

1.4 Submission

Submit your program through CourseMarker.

1.5 Important notes

1.6 Exploration

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.


2 Deadline

The deadline for handing in all programs is 27 August 2008, Wednesday, 23:59. Late submissions will NOT be accepted.





tantc@comp.nus.edu.sg
Tue Aug 19 20:24:22 SGT 2008