Need help with a program in C++. I need to read from a file, the sales of 5 diff
ID: 3584768 • Letter: N
Question
Need help with a program in C++. I need to read from a file, the sales of 5 different sales people. I need to calculate their total sales and their salary. I will have to put the information in a table on another text file. Here is the description of the problem: A company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus a 9 percent commission of their gross sales for the sales period. For example, a salesperson who grosses $5000 in sales i the period receives $200 plus 9% of $5000 or a total of $650. Write a program that determines for each sales person their total sales and their salary. There are 5 salesperson for the company. You are to write from a txt file which contains the information for all 5 sales people. The file contains the salesperson's number 1-5 with numerous sales. List each person's number, their total sales and their salary for the period in a nice table format ,(The columns must line up) Restrictions: NO ARRAYS, use a switch statement and use functionsExplanation / Answer
i assumed their salaries in these ranges and the programme is
public class Question7539 {
static int[] Salary = {750, 1200, 5000, 7575, 10000, 9250, 12500, 3560, 4800};
public static void main(String[] args) {
for(int i=0; iSystem.out.println((i+1)+": "+(200+0.09*Salary[i])+"$");
}
}