|
Go to Page... |
Post Reply |
Tweet | Thread Tools |
#1
|
|||
|
|||
![]()
Hello semua, G harus minta bantuan nih. Nih prompt buat questionnya:. a. Write a Java class that declares variable to represent the length and width of a room in feet. Assign appropriate values to the variables - for example, length = 15 and width = 25. Compute and display the floor space of the room in square feet. Display explanatory text with the value - for example, the floor space is 375 space feet. Save this class as Room.java nah, kalo buat yg ini kan lebih mudah ini jawaban gue Code: class Room { public static void main(String[] args) { int length, width, total; length = 15; width = 25; total = length * width; System.out.println("The floor space is " + total + " square feet."); } } (betul ga yah?) yg bagian kedua ini yg gue bingung: 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 user's entries as well as displaying the floor space. Save the revised class as Room2.java Please help. GRP Award menanti ![]() Terkait:
|
Sponsored Links | |
Space available |
Post Reply |
|