This code is supposed to determine a salesperson's gross pay for last week, calculate and display thier earnings. The salesperson each receive $200 per week plus 9 percent of thier gross sales. The output should display like this:

Enter sales in dollars (-1 to end):
Salary is: $650.00

Enter sales in dollars (-1 to end): -1

Is my code right? I am simply confused.

// this code help you to solve your problem
# include <iostream.h>

main ()
{
// array of salary
int salary[10] ;

do {
// prompt to the user
for (int i = 0 ; i < 10 ;i++)
cout << "Enter the salary ";
cin >> salary
// this loop go till that salary is greater than 0 means salar > 0
}while(salary > 0 );

}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.