Answer to Question #7875 in C++ for ledua

Question #7875
Write a C++ program to compute and display a person’s weekly salary as determined by the following conditions: -

If the hours worked are less than or equal to 40, the
person receives $8.00 per hour; otherwise, if the person works for more than forty hours, but less than or equal to sixty hours, the person receives $320.00 plus $12.15 for each hour worked over 40 hours. Anyone who works for more than sixty hours simply gets a Jackpot salary of $1000.00 The program should request the hours worked as input and display the salary as output.
try it using the nested if structures.
Expert's answer
#include <iostream>
using namespace std;

int main() {
int hours;
cin >> hours;
if (hours<=40) cout << hours*8 << '$' << endl;
else {
& if (hours<=60) cout << 12.15*(hours-40)+320 << '$' << endl;
& else cout << "1000$" << endl;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be the first!

Leave a comment

New on Blog