Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************************************************************
- * AUTHOR : Samantha Lopez
- * ASSIGNMENT #1 : Basic Input / Output
- * CLASS : CSC5
- * SECTION : MW 2:20p - 5:30p
- * DUE DATE : 9/18/2019
- ****************************************************************/
- #include <iostream>
- #include <iomanip>
- using namespace std;
- /****************************************************************
- *
- * COMPUTE RETROACTIVE PAY
- * ______________________________________________________________
- * This program accepts as user input an employee
- * name, current annual salary and percent increase
- * and computes a new annual salary, new monthly
- * salary and retroactive pay due. The program will
- * execute three times prompting the user for the
- * appropriate input and then displaying the computed
- * values for the given input.
- *
- * Computations are based on the assumption that input
- * values are effective on January 1 and calculations
- * are effective for July 1.
- * ______________________________________________________________
- * INPUT
- * nameFull : Employee's full name
- * salaryCurrent : Current annual salary
- * percent : Percent increase due
- *
- * OUTPUT
- * salaryNew : New salary after applying rate increase
- * salaryMonthly : New monthly salary
- * retroactivePay : Retroactive pay due employee
- *
- ****************************************************************/
- int main()
- {
- /******************************************************
- * CONSTANTS
- * ----------------------------------------------------
- * MONTHS : Total number of months
- * RETRO_MONTHS : Number of months retroactive
- *****************************************************/
- const int MONTHS = 12;
- const int RETRO_MONTHS = 6;
- char nameFull[30]; // INPUT - Employee's full name
- float salaryCurrent; // INPUT - Current annual salary
- float percentIncrease; // INPUT - Percent increase due
- float salaryNew; // OUTPUT - New salary after increase
- float salaryMonthly; // OUTPUT - New monthly salary
- float retroactivePay; // OUTPUT - Retroactive pay due employee
- int count; // CALC - Counter for loop
- // Prompts for the user to respond to
- cout << "What is your name?" << endl;
- cin.getline(nameFull, 30);
- cout << "What is your current salary?" << endl;
- cin >> salaryCurrent;
- cout << "What is your pay increase?" << endl;
- cin >> percentIncrease >> endl;
- cout << "\n";
- // Calculate salaryNew, salaryMonthly, & retroactivePay
- salaryNew = (salaryCurrent * percentIncrease) + salaryCurrent;
- salaryMonthly = salaryNew / 12;
- retroactivePay = salaryMonthly * 6;
- // Output the new annual salary, monthly salary,
- // and retroactive pay.
- cout << "Your new annual salary is " << salaryNew << endl;
- cout << "Your new monthly salary is " << salaryMonthly << endl;
- cout << "The retroactive pay you are due amounts to " << retroactivePay <<
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement