prob3 - Each side has 2 windows that are 2 ft by 3 ft that...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%========================================================================== % PROBLEM 3 - Painting a house %-------------------------------------------------------------------------- % % Script Name: prob3 % Script Variables: % 1. paint_area (double) - surface area to be covered by paint (sq. ft) % 2. paint_gallons (double) - number of gallons of paint needed % % Problem Statement: % Write a script named "prob3" that will calculate the surface area that % is to be painted on a house and how many gallons of paint will be % needed. The house is a rectangular prism that measures 30 ft wide, 50 % ft long, and 10 ft tall. The roof and the floor will not be painted.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % Each side has 2 windows that are 2 ft by 3 ft that will not be painted. % Store the amount of surface area to be covered in "paint_area". Use % this value to calculate how much paint will be needed to give the house % one coat of paint. Each gallon of paint will cover 350 sq. ft. % width_ft=30; length_ft=50; height_ft=10; area_windows=2.*(2.*3); %ft^2, this is per side of the house paint_area=2*(height_ft.*length_ft-area_windows)+2.*(height_ft.*width_ft-area_windows) %ft^2 area_per_gallon=350; %sq. ft/gallon paint_gallons=paint_area./area_per_gallon %gallons...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.

Ask a homework question - tutors are online