Calculate the height and width of your window!

WindowMaster

Public static void main (String[] args){

Float height = ;
Float width = ;

String stringHeight = “”;
String stringWidth = “”;

Float areaOfWindow ;
Float perimeterOfWindow;
Float cost;

Scanner sc = new Scanner(System.in);

System.out.println(“please input the Height of your window !”);

Sc.nextLine();

System.out.println(“please input the Width of your window !”);

Sc.nextLine();

/* convert the StringHeight and StringWidth to floats */

areaOfWindow = height * width;

perimeterOfWindow = height + width *2;

Cost = ((3.50f * areaOfWindow) + (2.50f * perimeterOfWindow ) );

Sout “the area is:” + areaOfWindow

Sout “the perimeter is:” + perimeterOfWindow

Sout “your total cost is :” + cost;

}

I wrote out my first java code !

Leave a comment