Electrical and Computer Engineering
17
of 21
UAH
CPE 112
if
Statement Examples
(If-Then-Else Form)
•
if
(hours <= 40.0)
–
pay = rate * hours;
•
else
–
pay = rate * (40.0 + (hours – 40.0) * 1.5);
•
cout << pay;
–
–
•