The George Washington University
School of Engineering and Applied Science
Department of Computer Science

CSci 51 -- Introduction to Computing -- Spring 2000

Project #2
Due Date: Start of Class, Thursday, Feb 17, 2000

The purpose of this project is to give you practice developing a Case Study and an associated program.

Everything you need is in Chapters 1-4; you need not, and should not, use any "extra" statements or anything from later chapters.

In shopping for a new car, you must consider several factors. In this problem the initial price of the car (in dollars), the estimated gas mileage (in miles per gallon or MPG), and the estimated annual maintenance and repair costs (in dollars per year) are available. Assume that gasoline costs $1.50 per gallon and that you expect to drive about 15,000 miles per year.

Part I. Develop a Case Study for a program that will determine the total cost, after a five-year period, for one car model. Prompt the user for the 3 input values (initial price, MPG, repair cost). Then compute and display the total cost. Among the test cases for your test plan, include these three valid sets of values for initial price, MPG, and repair, respectively:
 
 
Initial Price MPG Repair costs
Reliable family sedan $20,000.00 20.0 $1000.00
Sport-utility vehicle $30,000.00 15.0 $2000.00
Cheap but unreliable used car $5,000.00 25.0 $3500.00

Part II.  Now develop a modified Case Study that handles multiple cars in one run. Prompt the user for the number of models and display the results in the form of a table.

What to submit: complete Case Studies for Part I and Part II.