Question
2. Cars (Arrays c ++ task)) Joey wants to buy a Toyota brand car. In order to select the right offers from the online store,
2. Cars (Arrays c ++ task))
Joey wants to buy a Toyota brand car. In order to select the right offers from the online store, he submitted a request and specified the car's year of manufacture pm, engine displacement v cm3 and sales price ak. , which would indicate: serial number, year of manufacture of the car, engine displacement, selling price, price of a new car (it is calculated by estimating the depreciation of the car).
Source data file Data.txt:
the first line contains the number n of Toyota car models;
the following n lines contain two integers - the year of manufacture of the model and the engine capacity, and one real number - the selling price of the car;
The last line records the year of sale of the car m and how many years p the car depreciates.
Provide the following information about the cars in separate lines in the Results.txt file:
serial number;
year of manufacture;
engine displacement;
price in year ak;
price of a new car, which is calculated by depreciating: ak / ((m - pm) / p)
--------------------------------------
The Source data:
4
2003 2000 19000.00
2003 200 19200.00
2005 1400 15020.00
2003 2000 13462.00
2012 15
Results:
1 2003 2000 19000.00 32666.67
2 2003 2000 19200.00 32000.00
3 2005 1400 15020.00 32185.71
4 2003 2000 13462.00 22436.67
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started