visual basic 2013 programming need help Write a program to calculate the amount
ID: 3563564 • Letter: V
Question
visual basic 2013 programming need help
Write a program to calculate the amount of paint needed to paint a room.
-the user will enter the dimensions of the room ( the room is a rectangle and has 10 ft high walls)
-the user will enter number of windows and windows dimensions (they are all the same size)
-the user will put in the demensions of the door.
-determin the sequare footage of walls by calculating the square ft of walls and subtract the area of windows and door
- 1 gallon of paint will cover 350 square ft.
Explanation / Answer
public class Paint extends CIS111App
{
public static void main(String[] args)
{
final int COVERAGE = 350.0;
int lengthOfRoom = 0;
int heightOfRoom = 0;
int widthOfRoom = 0;
int totalSqFt = 0;
int paintNeeded = 0;
int doors = 0;
int windows = 0;
lengthOfRoom = getInt("Room length: ");
widthOfRoom = getInt("Room width: ");
heightOfRoom = getInt("Room height: ");
doors = getInt("Doors in room: ");
windows = getInt("Windows in room: ");
totalSqFt = ( ( lengthOfRoom * 2) * heightOfRoom) + ( ( widthOfRoom * 2) * heightOfRoom);
totalSqFt -= (windows * 15);
totalSqFt -= (doors * 20);
paintNeeded = Math.round(totalSqFt / COVERAGE);
printf("Room size: %d x %d x %d ", lengthOfRoom, widthOfRoom, heightOfRoom);
printf("Doors: %d Windows: %d Gallons needed: %d ", windows, doors, paintNeeded);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.