Calculate the annual cost of owning the car.

Assignment Help Programming Languages
Reference no: EM131465798

Programming Assignment - Car Cost Calculator

Data will be read in from a file - Make sure you include code to ensure the file exists before reading the data.  If the input file does not exist print an error message and end the program.

The data on the file contains:

  • Year -int
  • VIN -string
  • Make - string
  • Model-string
  • Annual Mileage-int
  • Annual Insurance Premium-double
  • Annual Maintance-double
  • Average Miles/gallon

Sample Data File

2000

22332222222

Ford

Mustang

10000

1000.00

670.00

33

2016

2233443422

Toyota

Prius

1000

500.00

355.00

40

2015

1122334455

Toyota

Rav4

12000

1200.00

560.00

21

Calculate the annual cost of owning the car. 

The following costs will be calculated

Cost of Gas (Ask user to enter in the average price /gallon) - Use this to calculate the gas cost for all cars.

How much money was spent of gas:

Divide the Annual Miles / MPG  - Gives you the gallons of gas used in a year

Multiply gallons of gas * gas cost per gallon

Total Annual Cost will be calculated as follows

Gas cost for the year + Insurance Premium +maintenance

Create a report that should be printed on the console with the following header followed by the details of each car.  Your file should contain at least 5 cars.

Car Make Car Model  Car Year  Annual Insurance cost  Annual Gas Cost  Total Cost

In addition you should also create a disk file. 

-Ask the user to enter the name of the output file to be created.

-Use that name to open the file.

-The file should contain the VIN number for each car as well as the total cost of annual ownership for that car.

Reference no: EM131465798

Questions Cloud

Gastro esophageal reflux disease : Gastro esophageal Reflux Disease (GERD) is a condition in which the liquid content of the stomach backs up into the esophagus.
Retailer opened a baseball card store in vacant premises : Retailer opened a baseball card store in vacant premises next to an existing store.
What is the standard deviation explain : The average height of a male ROTC cadet is 70 inches. Twelve percent of the male cadets are taller than 72 inches. Assuming that the heights of the cadets.
Find the number of sample resistors with values : The MH Company manufactures resistors with an ideal resistance value of 400 ohms. A sample of 2 000 resistors were tested and found to have a mean resistance.
Calculate the annual cost of owning the car. : Programming Assignment - Car Cost Calculator. Calculate the annual cost of owning the car. How much money was spent of gas
What is the probability that you would earn more per year : Suppose that you have your choice between two jobs. Your annual earnings from a manufacturing job will have a normal distribution with a mean of $40 000.
Can a business survive in todays world without a website : Can a business survive in today's world without a website or a with poorly maintained website?
What is your optimal order-up-to level assuming : You are the inventory manager for a large medical supplies distributor near medical center. What is your optimal order-up-to level assuming.
Brief description of the business you are choosing : Read the MBA Capstone Project Guidelines document, paying careful attention to the template and example of a proposal located in Appendix A.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd