Assignment #1

Due: Friday, Sept 22

Objectives

Task

Create a program (Filename: paint.cpp) that will calculate the amount of paint needed to cover one side of a house with a sloped roof.

General Requirements


A sample run: (user input underlined)

Welcome to Paint Calculator 2023!!

How wide is the wall (in feet)? 40
and how high is the wall to the bottom of the roof? 15.7
and how high is the wall to the top of the roof? 21.5
How wide is the window (in feet)? 3
and what is the window's height? 2.75

A side wall that is
   40' wide and
   15.7' tall to the roof bottom and
   21.5' tall to the roof top,
containing a window that is
   3' wide and
   2.75' tall,
has 735.8 square feet of paintable wall
and would require 1.84 cans of paint
(assuming that each can will cover 400 square feet of wall).

Thanks for using Paint Calculator 2023. Goodbye!!

Compiling and Running:

This code only uses a standard library (iostream), so it will compile with any C++ compiler. Make sure you practice with g++ on linprog.cs.fsu.edu (and make sure it reports no compile errors!) before you submit the program.

To compile with g++ (reminder)

Save a program file in your CS account space (on linprog.cs.fsu.edu) and compile it with the g++ command:
   g++ paint.cpp

The default name for the executable will be "a.out". To run it, type:

  a.out

If you wish to compile the executable program to have a different name (other than a.out), use the -o option on the g++ command. This allows you to name your executable -- the executable name goes after the "-o". Example:

  g++ paint.cpp -o paint    (executable name will be "paint")

Submitting:

Make sure you are logged into either shell.cs.fsu.edu or linprog.cs.fsu.edu, and the file you want to submit is stored in your current working directory. To submit, type the following command:
  ~myers/csub/submit1 paint.cpp
(noting that the filename for your code should be paint.cpp ).

This will run a script and a C++ program that copies your file into a submission directory. The program will also give you feedback at the end -- it will display the contents of the file you just submitted to standard output. This will allow you to check to make sure that what you submitted was correct.


General Advice - always keep an untouched copy of your finished homework files on your computer science account. These files will have a time-stamp which will show when they were last worked on (a timestamp from the CS servers) and will serve as a backup in case you ever have legitimate problems with submitting files through the web site. Do this for ALL programs.

It is a good idea as well to back up your file(s) by transferring a copy (via SFTP) to your personal computer periodically while you are working on an assignment. This way, if you accidentally delete an important file on your CS account, you'll have a backup on your computer.