I m trying to do an end of chapter exercise.
I’m quite new to programming.Quote:
Write a program to read in 5 people's salaries and work out the tax to be paid (at 25%) for each.
First time coding with a class; in fact, not even sure if should be using a class here at all.
Brace yourself it’s a mess.
You may want to ignore that.Code:#include <iostream.h>
void main()
{
cout << "Enter 5 Salaries "<< endl;
class pc {
public:
int Salary = 5;
int i ;
};
pc num;
for(i=0; i<5; i++){
cout << "Enter Salary No "<<i <<":" << endl;
cin >> i;
}
/*int i = 0;
pc num[Salary];
for (i = 0; i<5; i++) {
num[Salary].i;
}
cout << num[Salary] << endl;*
/*int pc = 25/100;
for (i = 0; i<5; i++) {
pc * Salary[i];
cout << Salary[i] << endl;
}*/
Anyway, if you care to post few hints
(or even better the code ;) )
so I can look at it. thanks