Question

Logic Exercise 40 Points This exercise tests your ability to understand logic in the form of IF Statements. You will be given
Name Type Pay Rate / Hours Worked John Abdullah Hamid Calesta Harvey IUUIU 60 45 40 50 Function Main Declare String PayType D
Input PayRate March 4, 2020 Output Enter in the number of Hours Worked Input Hours Worked If PayType = C OR PayType = S
circle the Correct Answer the following questions: 1. Johns wage for week are: March 4. a. 800 b. 600 c. 700 d. 900 2. Abdul
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.(c) 700

Since John's PayType is 'H',so it will enter the else part and since HoursWorked>=40 therefore Total Pay = ((HoursWorked-40)*(PayRate*1.5)) + (PayRate*40) which calculates to be ((60-40)*(10*1.5)) + (10*40) = 700

2.(a) 1125

Since Abdullah's PayType is 'S',so it will enter the if part and therefore Total Pay = PayRate * HoursWorked which calculates to be (25 * 45) = 1125

3.(b) 800

Since Hamid's PayType is 'S',so it will enter the if part and therefore Total Pay = PayRate * HoursWorked which calculates to be (20 * 40) = 800

4.(d) 1375

Since Calesta's PayType is 'H',so it will enter the else part and since HoursWorked>=40 therefore Total Pay = ((HoursWorked-40)*(PayRate*1.5)) + (PayRate*40) which calculates to be ((50-40)*(25*1.5)) + (25*40) = 1375

5.(a) 1200

Since Harvey's PayType is 'C',so it will enter the if part and therefore Total Pay = PayRate * HoursWorked which calculates to be (20 * 60) = 1200

If you have any doubts feel free to ask in the comments.

Add a comment
Know the answer?
Add Answer to:
Logic Exercise 40 Points This exercise tests your ability to understand logic in the form of...
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
  • i am having trouble displaying results and displaying them evenly it is suppose to look like...

    i am having trouble displaying results and displaying them evenly it is suppose to look like this Enter the following data for employee 1: Employee ID: 1298 Hours worked: 35.8 Pay rate (per hour): 23.45 Enter the following data for employee 2: Employee ID: 1899 Hours worked: 34.5 Pay rate (per hour): 19.5 Enter the following data for employee 3: Employee ID: 4435 Hours worked: 30.5 Pay rate (per hour): 20.75 Enter the following data for employee 4: Employee ID:...

  • This is my code but my overtime calculation is wrong and I cant figure out how...

    This is my code but my overtime calculation is wrong and I cant figure out how to round to two decimal places import java.util.Scanner; public class HourlyWage { public static void main(String[] args) { //Variables double totalWage; double totalOvertimePay; double totalPay; String name; double overtimeHours = 0.0; double hoursWorked = 0.0; double hourlyWage = 0.0; Scanner keyboard = new Scanner(System.in); System.out.println("Please enter your name "); name = keyboard.next(); System.out.println("Please enter your hourly wage "); hourlyWage = keyboard.nextDouble(); System.out.println("How many hours...

  • By editing the code below to include composition, enums, toString; must do the following: Prompt the...

    By editing the code below to include composition, enums, toString; must do the following: Prompt the user to enter their birth date and hire date (see Fig. 8.7, 8.8 and 8.9 examples) in addition to the previous user input Create a new class that validates the dates that are input (can copy date class from the book) Incorporate composition into your class with these dates Use enums to identify the employee status as fulltime (40 or more hours worked for...

  • 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...

  • C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their...

    C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their manual payroll system to a computer-based system. Write a program to produce a 1-week payroll report for only one employee to serve as a prototype (model) for the administration to review. Input for the system will be the employee’s 4-digit ID number, the employee’s name, hours worked that week, and the employee’s hourly pay rate. Output should consist of the employee’s ID number, the...

  • Chapter 4 Loop logic and using loop logic for File Input/0utput. 1. Read Chapter 4 sections...

    Chapter 4 Loop logic and using loop logic for File Input/0utput. 1. Read Chapter 4 sections 4.10 until end of chapter. 2. Review Questions and Exercises, short answers. 3. [20 points] submit SalaryCalcLoopFile.java Let's update our program, SalaryCalcLoop.java, from last week, to now take input about each employee from a file and write their information and salary/pay information to a file. use input file, where each employee has name,shift,hours worked,hourly rate: EmployeePayroll.txt output file should be named: EmployeePayStubs.txt EmployeePayroll.txt Rashid...

  • This C++ program will not let me put numbers in on address, just characters #include using namespace std; float paycalc(){ cout<<"Enter 1 if salary and 2 if hourly: "; int choice, hoursW...

    This C++ program will not let me put numbers in on address, just characters #include using namespace std; float paycalc(){ cout<<"Enter 1 if salary and 2 if hourly: "; int choice, hoursWorked, payrate; float salary; cin>>choice; if(choice == 1){ cout<<"Enter your salary per month: "; cin>>salary; }else{ cout<<"Enter hours worked: "; cin>>hoursWorked; cout<<"Enter pay rate: "; cin>>payrate; salary = hoursWorked * payrate; } return salary; } void printCheck(float sal, int id, char address[30]){ cout<<"Employee id: "<>id; cout<<"Enter address: "; char...

  • 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...

  • Must be written in java. Modularize the following code. //CIS 183 Lab 4 //Joseph Yousef import...

    Must be written in java. Modularize the following code. //CIS 183 Lab 4 //Joseph Yousef import java.util.*; public class SalaryCalc { public static void main(String [] args) { Scanner input = new Scanner(System.in); int sentinelValue = 1; //initializes sentinelValue value to 1 to be used in while loop while (sentinelValue == 1) { System.out.println("Enter 1 to enter employee, or enter 2 to end process: ");    sentinelValue = input.nextInt(); input.nextLine(); System.out.println("enter employee name: "); String employeeName = input.nextLine(); System.out.println("enter day...

  • This is a Java beginner class. Write the following exercise to check the user inputs to...

    This is a Java beginner class. Write the following exercise to check the user inputs to be: Valid input and positive with using try-catch (and/or throw Exception ) ************************************************************************** Write a program to prompt the user for hours and rate per hour to compute gross pay. Calculate your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours. Your code should have at least the following methods to calculate the pay. (VOID and...

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
ADVERTISEMENT