Question

Create an application for a car dealership that loops through historical car sales data from one data structure, calculates an 8% sales tax rate/value for that sale, and then adds the total new sale value of the vehicle to a new data structure.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>
#include<string>
#include<fstream>

using namespace std;

struct old_car{
     string model;
     string make;
     string year;
     double price;
};

struct new_car{
     string model;
     string make;
     string year;
     double price;
     double new_price;
};

int main(){

    old_car old[100];
    new_car newdata[100];  
    ifstream fin;
    fin.open("olddata.txt"); //Assuming data is in olddata.txt
   
    int count = 0;
    while (fin >> old[count].model >> old[count].make >> old[count].year >> old[count].price){
         count++;
    }
    for (int i = 0; i<count; i++){
        newdata[i].model = old[i].model;
        newdata[i].make = old[i].make;
        newdata[i].year = old[i].year;
        newdata[i].price = old[i].price;
        newdata[i].new_price = old[i].price + 0.08 * old[i].price;
    }
    for (int i = 0; i<count; i++){
        cout << newdata[i].model << endl;
        cout << newdata[i].make << endl;
        cout << newdata[i].year << endl;
        cout << newdata[i].price << endl;
        cout << newdata[i].new_price << endl;
    }
   
    return 0;
}

Add a comment
Know the answer?
Add Answer to:
Create an application for a car dealership that loops through historical car sales data from one...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a C++ console application to calculate the salary of employees for a used car dealership....

    Create a C++ console application to calculate the salary of employees for a used car dealership. Salary structure is based on draw against commission. The salespeople receive a commission based on their sales. However, they are guaranteed a minimum salary (draw). If the commission is more than this amount, they receive the commission, otherwise, they receive the draw. Calculate sales commission as follows: Below $10,000 sales: No commission From $10,000 up to $50,000: 1% commission From $50,000 up to $100,000:...

  • Suppose that you own a local auto dealership, Carmen and Rodrigo’s Sales (CARS). Your dealership will...

    Suppose that you own a local auto dealership, Carmen and Rodrigo’s Sales (CARS). Your dealership will finance a new car purchase at an APR of 13%, compounded monthly. The terms of the financing are monthly payments of $251 for five years. The first payment is due one month after the buyer purchases the vehicle. How much of the purchase price would the buyer be financing with the loan from your dealership?

  • If you purchase a new vehicle from an auto dealership in Elmhurst, you would pay 8%...

    If you purchase a new vehicle from an auto dealership in Elmhurst, you would pay 8% sales tax. How is this rate allocated between the State of Illinois, City of Elmhurst, DuPage County, and the Regional Transportation Authority?

  • This was all the information given! An auto dealership is advertising that a new car with...

    This was all the information given! An auto dealership is advertising that a new car with a sticker price of $34,848 is on sale for $25,995 if payment is made in full, or it can be financed at 0% interest for 72 months with a monthly payment of $484. Note that 72 payments x $484 per payment = $34,848, which is the sticker price of the car. By allowing you to pay for the car in a series of payments...

  • An auto dealership is advertising that a new car with a sticker price of $34,848 is...

    An auto dealership is advertising that a new car with a sticker price of $34,848 is on sale for $25,995 if payment is made in full, or it can be financed at 0% interest for 72 months with a monthly payment of $484. Note that 72 payments × $484 per payment = $34,848, which is the sticker price of the car. By allowing you to pay for the car in a series of payments (starting one month from now) rather...

  • An auto dealership is advertising that a new car with a sticker price of $35,208 is...

    An auto dealership is advertising that a new car with a sticker price of $35,208 is on sale for $25,995 if payment is made in full, or it can be financed at 0% interest for 72 months with a monthly payment of $489. Note that 72 payments × $489 per payment = $35,208, which is the sticker price of the car. By allowing you to pay for the car in a series of payments (starting one month from now) rather...

  • This Question: 1 pt 4 of 15 (15 Sales representatives at a car dealership were split...

    This Question: 1 pt 4 of 15 (15 Sales representatives at a car dealership were split into two groups. One group used an aggressive approach to sell a customer a ne Approach Aggressive Passive Total Sale 105 220 325 No Sale 240 90 330 Total 345 310 655 If one of these customers is selected at random, determine the probability of no sale, given that the passive approach was used The probability of no sale, given that the passive approach...

  • A car dealership offers you no money down on a new car. You may pay for...

    A car dealership offers you no money down on a new car. You may pay for the car for 4 years by equal monthly end-of-the-month payments of $477 each, with the first payment to be made one month from today. If the discount annual rate is 18.48 percent compounded monthly, what is the present value of the car payments?

  • John purchased a new Lincoln Continental automobile from Al Greene Inc., an authorized new car dealership....

    John purchased a new Lincoln Continental automobile from Al Greene Inc., an authorized new car dealership. On the day of the sale, John made a cash down payment and signed a purchase contract and an application for the title certificate. The understanding was that John would take immediate possession of the car and return in a few days for new-car preparation and the installation of a CB radio. On the way home from the dealer, John wrecked the car. The...

  • A car dealership offers you no money down on a new car. You may pay for...

    A car dealership offers you no money down on a new car. You may pay for the car for 3 years by equal monthly end-of-the-month payments of $735 each, with the first payment to be made one month from today. If the discount annual rate is 17.45 percent compounded monthly, what is the present value of the car payments? Round the answer to two decimal places.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT