Daftar

[Ask - GRP Reward] Java Programming - Interactive Application using User Input


Programming & Web Coding, web, aplikasi, dan karier developer.

Balas
 
Alat Thread
Linuxmania Linuxmania sedang offline
#1
Ceriwiser Tanggal Bergabung: Nov 2011 Post: 392 Rep Power: 16 Linuxmania mempunyai hidup yang Normal
Default [Ask - GRP Reward] Java Programming - Interactive Application using User Input
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

</div>
Balas


Aturan Posting
Kamu tidak boleh membuat thread baru
Kamu tidak boleh membalas
Kamu tidak boleh mengirim lampiran
Kamu tidak boleh mengedit post kamu

BB code Hidup
Smilie saat ini Hidup
Kode [IMG] adalah Hidup
Kode HTML adalah Mati


Terkait
Thread Pembuat Thread Forum Balasan Postingan Terakhir
[ask] Application Programming Interface(API) apakah itu? Braincode Programming & Web 0 11 Nov 2011 03:04 PM