Question

In: Computer Science

In c++ create a program that asks for tire shop sales numbers made by 0 to...

In c++

create a program that asks for tire shop sales numbers made by 0 to 20 employees

Premium tires sell for $300 and standard tires sell for $250

The wholesale cost of premium tires is $120 and the standard is $100

The program must ask for each employee's name and then the amount of premium and standard tires sold.

Output the name and the total profit each employee made for the shop

Output the total profits earned between all employees

Complete the program using basic methods, no arrays or vectors

Solutions

Expert Solution

`Hey,

Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.

/******************************************************************************

Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;
int profitEmployee(int n1,int n2)
{
return (n1)*(300-120)+(n2)*(250-100);
}
int main()
{
int profit=0;
string name;
for(int i=0;i<=20;i++)
{
cout<<"Enter name of "<<(i)<<"th employee: ";
cin>>name;
int prem;
cout<<"Enter premium tires sold: ";
cin>>prem;
int stan;
cout<<"Enter standard tires sold: ";
cin>>stan;
int pro=profitEmployee(prem,stan);
profit+=pro;
cout<<"name: "<<name<<", profit="<<pro<<endl;
}
cout<<"Net profit: "<<profit<<endl;

return 0;
}

Kindly revert for any queries

Thanks.


Related Solutions

Create this on Python Write a program that asks for three numbers. Check first to see...
Create this on Python Write a program that asks for three numbers. Check first to see that all numbers are different. If they’re not different, then exit the program. Otherwise, display the largest number of the three. Outputs: - Enter the first number: 4 - Enter the second number: 78 - Enter the third number: 8 (The largest number is 78.) Tasks - Complete the algorithm manually without using any built-in functions to find the largest number on list. -...
in C++, Write a program that asks the user to enter 6 numbers. Use an array...
in C++, Write a program that asks the user to enter 6 numbers. Use an array to store these numbers. Your program should then count the number of odd numbers, the number of even numbers, the negative, and positive numbers. At the end, your program should display all of these counts. Remember that 0 is neither negative or positive, so if a zero is entered it should not be counted as positive or negative. However, 0 is an even number....
Write a C++ program that asks the user to enter a series of single-digit numbers with...
Write a C++ program that asks the user to enter a series of single-digit numbers with nothing separating them. Read the input as a C-string or a string object. The program should display the sum of all the single-digit numbers in the string. For example, if the user enters 2514, the program should display 12, which is the sum of 2, 5, 1, and 4. The program should also display the highest and lowest digits in the string. It is...
Using C++ Create a program that asks the user to input a string value and then...
Using C++ Create a program that asks the user to input a string value and then outputs the string in the Pig Latin form. - If the string begins with a vowel, add the string "-way" at the end of the string. For “eye”, it will be “eye-way”. - If the string does not begin with a vowel, first add "-" at the end of the string. Then rotate the string one character at a time; that is, move the...
Write a C program that asks the user to enter 15 integer numbers and then store them in the array.
Write a C program that asks the user to enter 15 integer numbers and then store them in the array. Then, the program will find the second largest element in array and its index without sorting the array. For example, In this array {-55,-2,1, 2, -3, 0, 5, 9, 13, 1, 4, 3, 2, 1, 0}, the second largest element is 9 [found at index 7].
A store has 4 categories A, B, C and D, create a program that asks you...
A store has 4 categories A, B, C and D, create a program that asks you 10 times the sale and the category so that at the end it shows you the total by category, and the sum of all. Code in C # and Python
C++ Program -------------------- Project 5-1: Monthly Sales Create a program that reads the sales for 12...
C++ Program -------------------- Project 5-1: Monthly Sales Create a program that reads the sales for 12 months from a file and calculates the total yearly sales as well as the average monthly sales. Console Monthly Sales COMMAND MENU m - View monthly sales y - View yearly summary x - Exit program Command: m MONTHLY SALES Jan        14317.41 Feb         3903.32 Mar         1073.01 Apr         3463.28 May         2429.52 Jun         4324.70 Jul         9762.31 Aug        25578.39 Sep         2437.95 Oct         6735.63 Nov          288.11 Dec         2497.49...
Please create a c++ program that will ask a high school group that is made of...
Please create a c++ program that will ask a high school group that is made of 5 to 17 students to sell candies for a fund raiser. There are small boxes that sell for $7 and large ones that sell for $13. The cost for each box is $4 (small box) and $6 (large box). Please ask the instructor how many students ended up participating in the sales drive (must be between 5 and 17). The instructor must input each...
Please create a C++ program that will ask a high school group that is made of...
Please create a C++ program that will ask a high school group that is made of 5 to 17 students to sell candies for a fund raiser. There are small boxes that sell for $7 and large ones that sell for $13. The cost for each box is $4 (small box) and $6 (large box). Please ask the instructor how many students ended up participating in the sales drive (must be between 5 and 17). The instructor must input each...
Design a modular program which asks the user to enter a list of numbers. The numbers...
Design a modular program which asks the user to enter a list of numbers. The numbers must be stored in an array. The program then finds the index of the first occurrence of the smallest element in the array and the last occurrence of the largest element in the array. The program displays the position and value of each of these items.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT