Question

3. A program is required by a company to read an employee‘s number, pay rate and...

3. A program is required by a company to read an employee‘s number, pay rate and the number of hours worked in a week. The program is then to validate the pay rate and the hours worked fields and, if valid, compute the employee‘s weekly pay and print it along with the input data

c++ sorry
0 0
Add a comment Improve this question Transcribed image text
Answer #1


#include <iostream>


using namespace std;


int main()

{
  
int emp_no=0;

int pay_rate=0;
  
int no_hrs=0;

string chk;
  
int emp_pay=0;
  
cout <<"Please Enter the Employee Number : ";

cin >>emp_no ;

cout <<"Please Enter the Pay Rate : ";

cin >>pay_rate ;
  
cout <<"Please Enter the Number of Hours Employee worked : ";

cin >>no_hrs ;

cout <<"Please check the validity of Employee Pay Rate : ";

cin >>chk ;

if(chk == "valid")
  
{
  
emp_pay = pay_rate*no_hrs;
  

}
  
else
  
{
  
cout << "Invaid Input" << endl;
  
}
  
cout <<" 'EMPLOYEE PAY CARD' " << endl;

cout <<" The Employee Number is : "<<emp_no<< endl;

  
cout <<" Pay Rate is : "<<pay_rate<< endl;
  

cout <<"The Number of Hours Employee worked : "<<no_hrs<< endl;

  
cout <<"Please check the validity of Employee Pay Rate : "<<chk<< endl;
  
cout <<" Employee's Weekly Pay is : "<<emp_pay<< endl;


return 0;

}

Please Enter the Employee Number : 12 Please Enter the Pay Rate : 200 Please Enter the Number of Hours Employee worked : 10 PCOMMENT DOWN FOR ANY QUERIES AND,

LEAVE A THUMBS UP IF THIS ANSWER HELPS YOU.

Add a comment
Know the answer?
Add Answer to:
3. A program is required by a company to read an employee‘s number, pay rate and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program Java that gets an employee’s number, pay rate, and the number of hours...

    Write a program Java that gets an employee’s number, pay rate, and the number of hours worked in a week from a clerk. The program is then to validate the pay rate and the hours worked data and, if valid, compute the employee’s weekly pay and print it along with the input data. Company rules prohibit working more than 60 hours per week or having an hourly rate of more than $25.00/hour. Any data with these values should generate an...

  • Design a program(Creating a RAPTOR flowchart) that will read a file of employee records containing employee...

    Design a program(Creating a RAPTOR flowchart) that will read a file of employee records containing employee number, employee name, hourly pay rate, regular hours worked and overtime hours worked. The company pays its employees weekly, according to the following rules: regular pay = regular hours worked × hourly rate of pay overtime pay = overtime hours worked × hourly rate of pay × 1.5 total pay = regular pay + overtime pay Your program is to read the input data...

  • Write a program using JAVAFX that collects: a) hourly rate of pay in a textbox; b)...

    Write a program using JAVAFX that collects: a) hourly rate of pay in a textbox; b) hours worked in a textbox; c) a radio button indicating weekly or bi-weekly (never both); and d) a button labelled Net Pay. Using the information in these fields, calculate and display in appropriate non-editable text boxes: i) Gross pay (hours x rate); ii) Canada Pension Plan (4% of gross pay over $65 per week); iii) Employment Insurance (2% of gross pay); iv) income tax...

  • Program description: Write the necessary C++ statements (Program) to calculate the employee's weekly pay. Where :...

    Program description: Write the necessary C++ statements (Program) to calculate the employee's weekly pay. Where : Hour = employee's work hours Rate = employee's hourly pay Wages = employee's weekly pay Given that ( Hour= 31.5 and , Rate = $11.45) Write the variable declarations and initialization sections necessary to compute and print the required calculations. The program should ask the user to input the hours and Rate of pay, then calculate the weekly Wages. Hint: Modify program in project...

  • It's my python assignment. Thank you You wrote a program to prompt the user for hours...

    It's my python assignment. Thank you You wrote a program to prompt the user for hours and rate per hour to compute gross pay. Also your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours. Enter Hours: 45 Enter Rate: 10 Pay: 475.0 (475 = 40 * 10 + 5 * 15) Rewrite your pay program using try and except so that your program handles non-numeric input gracefully. Enter Hours: 20 Enter...

  • Requirements 1. Compute Stanton's gross pay and net pay for the week. Assume earnings to date...

    Requirements 1. Compute Stanton's gross pay and net pay for the week. Assume earnings to date are $14,000 2. Journalize Frosty World's wages expense accrual for Stanton's work. An explanation is not required 3. Journalize the subsequent payment of wages to Stanton. Print Done More Info For all payroll calculations, use the following tax rates and round amounts to the nearest cent: OASDI: 6.2% on first $118,500 earned; Medicare: 1.45% up to $200,000, 2.35% on earnings above $200,000. Employee: OASDI:...

  • This program is in C++ Write a program that validates charge account numbers read in from...

    This program is in C++ Write a program that validates charge account numbers read in from the file Charges.txt following this assignment (A23 Data). Use a selection sort function on the array to sort the numbers then use a binary search to validate the account numbers. Print out the sorted list of account numbers so you can see the valid ones. Prompt the user to enter an account number and the validate that number. If the account number entered is...

  • Create a dual-alternative selection structure using Python: A company ABC asked you to design a simple...

    Create a dual-alternative selection structure using Python: A company ABC asked you to design a simple payroll program that calculates and employee's weekly gross pay, including any overtime wages. If employees work over 40 hours in a week, they will get 1.5 times of their regular hourly rate for all hours over 40. Your program asks the user to input hours worked for a week, regular hourly rate, and then display the weekly gross pay Output sample Enter weekly hours...

  • If the employee is a supervisor calculate her paycheck as her yearly salary / 52 (weekly...

    If the employee is a supervisor calculate her paycheck as her yearly salary / 52 (weekly pay) If the employee is not a supervisor and she worked 40 hours or less calculate her paycheck as her hourly wage * hours worked (regular pay) If the employee is not a supervisor and worked more than 40 hours calculate her paycheck as her (hourly wage * 40 ) + (1 ½ times here hourly wage * her hours worked over 40) (overtime...

  • Exercise 1 A program was created that outputs the following unto the console: Hello! What is...

    Exercise 1 A program was created that outputs the following unto the console: Hello! What is your name: Hello, Jane Doe! Using this program, we can help you determine you pay for the week! Please enter the hours you worked this week: 20 Next, please enter your rate of pay: 10 Calculating… you will make $ 200 by the end of the week! Here is the code for that program (you should have written a close variant of this last...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT