Write a program that processes the data of three car dealerships.
ID Name Number Price Sales
-------------------------------------------------------
1001 CarMax 192 17000 0.0
1002 AutoNation 151 16000 0.0
1003 Group-1-Auto 166 15000 0.0
sales = number * price
ID Name Number Price Sales
-----------------------------------------------------
1001 CarMax 192 17000 3264000.00
1002 AutoNation 151 16000 2416000.00
1003 Group-1-Auto 166 15000 2490000.00
#include <iostream>
#include <string.h>
#include <iomanip>
using namespace std;
struct Dealer
{
int id;
string name;
int numberofcarssold, price;
float total_sales;
};
void compSales(struct Dealer test[], int n)
{
struct Dealer *ptr = NULL;
ptr = test;
for(int i=0; i<n; i++){
float value1 = (ptr->numberofcarssold);
float value2 = (ptr->price);
ptr->total_sales = value1 * value2;
ptr++;
}
}
int main()
{
int i;
struct Dealer test_array[3];
// 1st car
test_array[0].id=1001;
test_array[0].name = "CarMax";
test_array[0].numberofcarssold = 192;
test_array[0].price = 17000;
test_array[0].total_sales = 0.0;
// 2nd car
test_array[1].id=1002;
test_array[1].name= "AutoNation";
test_array[1].numberofcarssold = 151;
test_array[1].price = 16000;
test_array[1].total_sales = 0.0;
// 3rd car
test_array[2].id=1003;
test_array[2].name="Group-1-Auto";
test_array[2].numberofcarssold = 166;
test_array[2].price = 15000;
test_array[2].total_sales = 0.0;
cout<<" \n ID \t Name \t \t Number \t Price \t Sales \n
";
//calculate sales value
compSales(test_array,3);
//display the array
for(i=0; i<3; i++)
{
cout<<"\n "<< test_array[i].id;
//cout.width(2);
cout<<"\t"<<right<< test_array[i].name;
//cout.width(2);
cout<<"\t\t"<<test_array[i].numberofcarssold;
cout<<"\t \t"<<test_array[i].price;
cout<<"\t"<<setprecision(2)<<test_array[i].total_sales;
}
return 0;
}
sample output

Write a program that processes the data of three car dealerships. ID &nb...
Java Create a program for a car dealer to use where you have a class for Salesman, Cars, and the Records of sale. 4 salesman and 4 cars to start with but have array size for 50 cars, have space for 100 records in array. The program should have 6 options in the menu. buy car, sell car, show inventory, show salesman, show sales records, and exit. Salesman class - Name, ID number, Commision rate, Total commisions earned, Totals number...
The name of the C++ file must be search.cpp Write a program that will read data from a file. The program will allow the user to specify the filename. Use a loop that will check if the file is opened correctly, otherwise display an error message and allow the user to re-enter a filename until successful. Read the values from the file and store into an integer array. The program should then prompt the user for an integer which will...
write a C++program to analyze a small subset of the data that has been collected. See file universities.txt .Use precisely seven parallel arrays: one for name of university, one for state, one for city, one for yearly tuition, one for enrollment, one for average freshman retention, and one for the percent of students who graduate with in six years. Note that the percentage of student accepted is not stored.An output file is opened in main() and remains open until the...
Please!!! need help asap!!!! write a C++program to analyze a small subset of the data that has been collected. See file universities.txt .Use precisely seven parallel arrays: one for name of university, one for state, one for city, one for yearly tuition, one for enrollment, one for average freshman retention, and one for the percent of students who graduate with in six years. Note that the percentage of student accepted is not stored.An output file is opened in main() and...
Write a program that can read XML files for customer accounts receivable, such as <ar> <customerAccounts> <customerAccount> <name>Apple County Grocery</name> <accountNumber>1001</accountNumber> <balance>1565.99</balance> </customerAccount> <customerAccount> <name>Uptown Grill</name> <accountNumber>1002</accountNumber> <balance>875.20</balance> </customerAccount> </customerAccounts> <transactions> <payment> <accountNumber>1002</accountNumber> <amount>875.20</amount> </payment> <purchase> <accountNumber>1002</accountNumber> <amount>400.00</amount> </purchase> <purchase> <accountNumber>1001</accountNumber> <amount>99.99</amount> </purchase> <payment> <accountNumber>1001</accountNumber> <amount>1465.98</amount> </payment> </transactions> </ar> Your program should construct an CustomerAccountsParser object, parse the XML data & create new CustomerAccount objects in the CustomerAccountsParser for each of the products the XML data, execute all of...
Write a program that will first receive as input the name of an
input file and an output file. It will then read in a list of
names, id #s, and balances from the input file specified (call it
InFile.txt) which you will create from the data provided below. The
program will then prompt the user for a name to search for, when it
finds the name it will output to a file (call it OFile.txt) the
person’s id#, name,...
Complete Task 4, 5, 6
Instructions Page 3 of 3 query.sql 1 -- Write your query below and then click "Run Query" to execute it. To save multiple queries, click the "+" icon above. VE Task 4: </> The InstantRide User Satisfaction team is a core team for Instant Ride, and they focus on increasing the customer satisfaction. They want to learn the travel time for each ride in the system. You need to return the USER_ID, and the TRAVEL_TIME...
Program 7 File Processing and Arrays (100 points) Overview: For this assignment, write a program that will process monthly sales data for a small company. The data will be used to calculate total sales for each month in a year. The monthly sales totals will be needed for later processing, so it will be stored in an array. Basic Logic for main() Note: all of the functions mentioned in this logic are described below. Declare an array of 12 float/doubles...
Write a program in C++ that simulates a soft drink machine. The program will need several classes: DrinkItem, DrinkMachine and Receipt. For each of the classes you must create the constructors and member functions required below. You can, optionally, add additional private member functions that can be used for doing implementation work within the class. DrinkItem class The DrinkItem class will contains the following private data members: name: Drink name (type of drink – read in from a file). Type...
Java - Car Dealership Hey, so i am having a little trouble with my code, so in my dealer class each of the setName for the salesman have errors and im not sure why. Any and all help is greatly appreciated. package app5; import java.util.Scanner; class Salesman { private int ID; private String name; private double commRate; private double totalComm; private int numberOfSales; } class Car { static int count = 0; public String year; public String model; public String...