C Programming and Makefiles

Due: 11:00pm, Monday, September 9, 2024

Get the Assignment Code

Login to your university Unix account and copy the assignment code to a location under your home directory:

  cp -r /export/home/public/schwesin/csc328/assignments/project1 LOCATION

where LOCATION is a directory of your choosing.

CPSC 135 Project Description

In shopping for a new house, you must consider several factors. In this problem the initial cost of the house, estimated annual fuel costs, and annual tax rate are available. Write a program that will determine the total cost after a five-year period for each set of house data below. You should be able to inspect your program output to determine the “best buy”. Your program must run through three houses for comparison, each time it is run (do not run it three times for three houses).

To calculate the house cost, add the fuel cost for five years to the initial cost, then add the taxes for five years. Taxes for one year are computed by multiplying the tax rate by the initial cost.

Write and call a function for each of the following tasks:

The input, entered by the user, consists of the initial cost of the house, the annual fuel cost, and the annual tax rate (as a percentage). The output should be the initial house cost, annual fuel cost, annual tax amount (not the rate), and the total cost for that house. The output should be displayed in a nice, comparative form.

Use the following data when you hand in the program:

Initial House Cost Annual Fuel Cost Tax Rate

$167,000 $2300 0.025

$162,000 $2500 0.033

$175,000 $1850 0.020

Specifications

Implementation Notes

Turning in the Assignment

TBD

Grading Criteria