Answer to Question #219861 in C++ for huda

Question #219861

Write a program segment to calculate and display the total yearly income of an employee which is calculated from his total salary and annual bonus. The user will be asked to enter the employee's monthly salary and year of service. The employee's year of service will determine the bonus he receives.


1
Expert's answer
2021-07-22T18:30:41-0400



#include <iostream>

using namespace std;

int main()
{ 
    int bonus = 5000; // any value can be put here
    double month; 
    int n;
    cout<< "Enter year of service\n";
    cin>>n;
    cout<<"Enter monthly salary\n";
    cin>> month;
    double total;
    total = 12 * month + (bonus * n);
    cout<<"The total yearly income:  " <<total;

    return 0;
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS