question programmers!
so i have a homework assignment for this chapter regarding posttest loops and nested loops, the question is
At the beginning of every year, Khalid receives a raise on his previous year's salary. He wants a program that calculates and displays the amount of his annyal raises for the nest three years, using rates of 3%, 4%, 5%, and 6%. the program should end when Khalid enters a sentinel value as the salary.
so this is what i have, it runs right, but is there any way i can clean it up?
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
double sal = 0.0;
do{ //begin loop
//total raise bonuses
double tot1 = 0.0;
double tot2 = 0.0;
double tot3 = 0.0;
double tot4 = 0.0;
//salary input
cout << "Please enter your salary to calculate raise bonuses (Enter 0 to exit): $";
cin >> sal;
//raise bonus calculations
tot1 = sal * .03;
tot2 = sal * .04;
tot3 = sal * .05;
tot4 = sal * .06;
//raise bonus displays
cout << "Your raise amount for this year will be: $" << tot1 << endl;
cout << "Your raise amount in one years will be: $" << tot2 << endl;
cout << "Your raise amount in two years will be: $" << tot3 << endl;
cout << "Your raise amount in three years will be: $" << tot4 << endl;
}while(sal != 0); //end loop
cout << "End of Program." << endl;
return 0;
}//end main function