Respuesta :
Answer:
public static double paintingCost(double roomLength, double roomWitdth){
double roomDimension = roomLength*roomWitdth;
double ceilingCost = 6*9; //Since the ceiling is 9-feets ($6/feet)
double totalCost = (roomDimension*6)+ceilingCost;
return totalCost;
}
Using Java programming language, A complete program is with a call to the method is given in the explanation section
Explanation:
import java.util.Scanner;
public class PaintingEstimate {
public static void main(String[] args) {
System.out.println("Please Enter the Length and Width of the Room in Feets");
Scanner in = new Scanner(System.in);
double roomLen = in.nextDouble();
double roomWit = in.nextDouble();
//Calling the method in the output statement
System.out.println("The total cost of painting the walls and ceiling is: "+paintingCost(roomLen,roomWit)+" dollars");
}
public static double paintingCost(double roomLength, double roomWitdth){
double roomDimension = roomLength*roomWitdth;
double ceilingCost = 6*9; //Since the ceiling is 9-feets ($6/feet)
double totalCost = (roomDimension*6)+ceilingCost;
return totalCost;
}
}