Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to change my code result same above and here is my code ( using c++ , cod

ID: 3573365 • Letter: I

Question

I need to change my code result same above and here is my code ( using c++ , codeblocks)

#include <iostream>
#include <iomanip>

using namespace std;

//Function declarations
void getData(string names[],double sales[3][4]);
void calTotalSales(string names[],double sales[3][4]);

int main()
{
//Creating an string array of size 3
string names[3];

//Creating a double array
double sales[3][4];

//Calling the functions
getData(names,sales);
calTotalSales(names,sales);
return 0;
}
//Function implementation which will get the inputs entered by the user
void getData(string names[],double sales[3][4])
{
/* This for loop will get the names and sales
* in each quarters entered by the user and
* populate them into arrays
*/
for(int i=0;i<3;i++)
{
//Getting the name entered by the user
cout<<"Enter in the name of the salesman "<<i+1<<": ";
cin>>names[i];

//Getting the sales in each quarter entered by the user
cout<<"Now Enter in the sales for each quarter for "<<names[i]<<endl;
for(int j=0;j<4;j++)
{
cout<<"Enter in the data for the quarter "<<j+1<<": ";
cin>>sales[i][j];
}
cout<<endl;
}
}

/* Function implementation which will calculate
* and display the total sales made by each
* person in 4 quarters
*/
void calTotalSales(string names[],double sales[3][4])
{
//Declaring variable
double total;

/* This for loop will calculate each person
* total sales and display it one the console
*/
cout << setprecision(2) << fixed;
for(int i=0;i<3;i++)
{
total=0;
for(int j=0;j<4;j++)
{
//Calculating the total sales in 4 quarters
total+=sales[i][j];
}
cout<< "Total Sales for "<< names[i] <<" is $ "<< total << endl;
}
}

I need to change my code result same above and here is my code ( using c++ , codeblocks)

thank you!

Part 2: Exercise 2: Problem description Extend Lab11 Exercisel.cpp such that the name, and the corresponding sales amount, ofthe salesman who sold the highest sales are displayed for each quarter. Your program should have at least three functions: Your main, a second function that reads in the salesman name and sales amounts for the quarters, and a third function that displays the results. Do not use any global variables. You will need to pass data to the functions as parameters. You must not use global variables. Name your program Lab11 Exercise2.cpp. Here is a sample output Enter in the name for salesman 1 Leo [Enter] Now enter in the sales for each quarter for Leo Enter in data for quarter 1 23001 [Enter] Enter in data for quarter 2 82002 [Enter Enter in data for quarter 3 56003 [Enter] Enter in data for quarter 4 95004 [Enter] Enter in the name for salesman 2 Jane [Enter] Now enter in the sales for each quarter for Jane Enter in data for quarter 1 93011 [Enter]

Explanation / Answer

Hii there Check this required code.It may help you

code:

#include <iostream>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote