Trial Lab
Trial Lab (CS1101 AY2009/10 Semester 1)
This lab assignment is not graded.
Date of release: 15 August 2009, Saturday, 7:00hr.
Soft submission deadline: 24 August 2009, Monday, 23:59hr.
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 take-home lab assignment in week 3. This trial lab is not graded, but you must attempt this, otherwise you will not be allowed to submit your subsequent lab assignments.

For more information on CourseMarker (and how to install it on your own computer if you wish), please refer to the CourseMarker website and the PowerPoint file on the CS1101 Labs page. If you have problem with the installation, you may post your queries in the IVLE discussion forum, email cmarker@comp.nus.edu.sg, or approach the Technical Services counter at the ground floor of COM1.

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.


1 Exercise 1: Volume of a 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; required output shown in bold purple). Note that the first two lines (in green) below are commands issued to compile and run your Java program if you are using in-line commands, for example, on UNIX. If you are not, you may ignore them.

$ javac Volume.java
$ java Volume
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

There is no deadline for this trial lab, but you are urged to submit before 24 August 2009, Monday, 23:59hr.




Aaron Tan
Fri Jun 19 09:37:52 SGT 2009