64.6k views
0 votes
Write a Java Program to compute the area of a given classroom. Try the following different method headers. a) public static void calAreal() b) public static void calArea2(float length 1, float width 1 c) public static float calArea3 (float length2, float width2) ASU COT​

1 Answer

3 votes

Answer:

a) Method header: public static void calArea1()

Pseudo code:

1. Define variables for length and width of the classroom

2. Read the values of length and width from the user

3. Compute the area of the classroom by multiplying length and width

4. Display the computed area of the classroom to the user

b) Method header: public static void calArea2(float length1, float width1)

Pseudo code:

1. Compute the area of the classroom by multiplying length1 and width1

2. Display the computed area of the classroom to the user

c) Method header: public static float calArea3(float length2, float width2)

Pseudo code:

1. Define a variable for area of the classroom

2. Compute the area of the classroom by multiplying length2 and width2

3. Return the computed area to the calling method

Step-by-step explanation:

User Zereges
by
7.4k points