Sei sulla pagina 1di 1

ICT02A Programming Fundamentals

Programming Exercise
Programming Exercise 1
Attempt the following question in class and demonstrate to your teacher.

Create a NetBeans project called Chapter 2.


Add a java main class to your project called Room.java.

a.
Write code in the Java main class that declares variables to represent the
length and width of a room in feet. Assign appropriate values to the variablesfor
example, length = 15 and width = 25. Compute and display the floor space of the
room in square feet (area = length * width). Display explanatory text with the value
for example, The floor space is 375 square feet.

b.
Convert the Room class to an interactive application. Instead of assigning
values to the length and width variables, accept them from the user as input. As
output, echo the users entries as well as displaying the floor space. Save the revised
class as Room2.java.

Holmesglen: JT CAIT 4-Feb-2015 X:\EEIT\CIT\AQTF Documents\Subjects\ICA11\Cert_IV\ICT02A_Programming_Fundamentals\Sem_1_2015\Assessment\Programming Exercises\Programming Exercise


1.docx

Potrebbero piacerti anche