Create a report that should be printed on the console

Assignment Help Programming Languages
Reference no: EM131455563

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

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

3. 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: EM131455563

Questions Cloud

What role do you believe government regulation should play : What role do you believe government regulation should play to ensure ethical conduct by businesses?How do different political viewpoints potentially shape ?
Find probability of receiving three calls in internal time : Phone calls arrive at the rate of 48 per hour at the reservation desk for Regional Airways.
Guilty of bad faith bargaining : Locate and briefly summarize a case decision where an employer or union was found guilty of bad faith bargaining ( or not!).
Stay focused on the precise assignment questions : Stay focused on the precise assignment questions, don't go off on tangents or devote a lot of space to summarizing general background materials.
Create a report that should be printed on the console : 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
How could government regulations have prevented : How could government regulations have prevented or mitigated the credit crisis of 2008?
During an economic recession : During an economic recession, discuss how management's or a union's bargaining power might be affected.
What is the expected number of calls in one hour : During the period of time that a local university takes phone-in registrations, calls come in at the rate of one every two minutes.
Aspects of performance management in a firm : Discuss all the aspects of performance management in a firm. Select any firm and draw illustrations.

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