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

  Report on a seminar or webinar

A report must be written regarding a seminar or webinar. Describe the key points of the seminar or webinar.

  Develop the application to show coffee customer orders

Develop the application which shows the total pounds of coffee customer orders, sales tax, and total price of order. Write down the name the solution, project, and form file Jason Coffee Solution, Jason Coffee Project.

  Write pseudocode

Write pseudocode that represents the abstract functions of the enqueue and dequeue operations. Define and explain any supplementary information needed by your pseudocode.

  Has public variables of the type float called numerator

Has public variables of the type float called numerator, denominator and total. Has a method called 'Add' that returns the sum of numerator and denominator and sets the total variable.

  Use the watchdog in its default position

Use the watchdog in its default position (must be petted in less than 32 ms). Generate a 275 Hz, 50% duty cycle on P9.7. Use a timer with the SMCLK.

  Briefly explain these main programming paradigm

COMP348 PRINCIPLES OF PROGRAMMING LANGUAGES ASSIGNMENT. Briefly explain these main programming paradigm (Logic, Functional, Object Oriented, Procedural, Imperative and Aspect-oriented), and for each of these paradigms name at least one language tha..

  Declared as well as several prototypes for functions

PIC 10A: In this assignment the main has been written for you in the file phone_book_main.cpp. You will also notice that a class called Person has been declared as well as several prototypes for functions.

  Implement a rule crypto that solves cryptarithmetic problems

Implement a rule "crypto" that solves the following cryptarithmetic multiplication problem: Each of the 4 letters (T,O,C,K) stands for a different digit. The 4 letters (G, R, I, P) can each be matched by any digit. The aim is to find a substitution..

  Create a utility procedure

Sum of Digits in a String. It is necessary to create a utility procedure that allows you to convert from a character to an integer value to allow you to sum the values of the digits in a string

  What default link state and visited link state

what default link state and visited link state are,on a CSS style sheet. And how to put them on the stlye sheet.

  Javascript function to verify fields if cookie is added

JavaScript function has verified that all the required fields have been filled, cookie is added to user's computer. If same user tries to fill out form second time.

  Prepare a assignment in sql

Prepare a assignment in SQL. To create two table names (not in use employee ,product ,order )- Separate queries of all function,screen shots and queries.

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