CSE1020 Labtest 1F

Please read this part carefully

No collaboration is allowed during a labtest. Refrain from speaking with other students during the test. If you have a question, please ask the teaching assistants or the instructor.

In your home directory you will find a copy of a solution to the ColourConvert problem from Lab 02. You may use pens/pencils and blank sheets of paper. No other aids are allowed.

Your work will be evaluated based on its correctness and conformance to the style rules. Your code must compile to receive a passing grade.

Remember to save your work and submit your work at regular intervals during the test.

Test Problem

Write a program called SmallestMultiple that produces output as shown below:

java SmallestMultiple 2.5 4.1 3
The area is 10.25
The smallest multiple of 3 bigger than the area is 12

The first two numbers on the command line are positive real numbers representing the width and length of a rectangle.

The third number on the command line is a positive integer.

Your program should compute and output the area of the rectangle. It then needs to compute the smallest integer that is strictly larger than the area and also a multiple of the input integer.

Here are some more example outputs:

java SmallestMultiple 10.0 20.0 25
The area is 200.0
The smallest multiple of 25 bigger than the area is 225

java SmallestMultiple 3.3 10 2
The area is 33.0
The smallest multiple of 2 bigger than the area is 34

java SmallestMultiple 78.9 1.2345 5
The area is 97.40205
The smallest multiple of 5 bigger than the area is 100

 

Submit

Submit your program using the command:

submit 1020 test01F SmallestMultiple.java

You may leave when you are finished.