EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 5, Problem 6PE
Program Plan Intro

Calculate the pay for employees

Program plan:

  • Import necessary package.
  • Create a class “AcmePay”,
    • Define the method “main ()”,
      • Declare and initialize the necessary variables.
      • Prompt the user to enter the shift into the first dialog box.
      • Assign the integer value returned form the method “parseInt()”.
      • Prompt the user to enter the hours worked into the second dialog box.
      • Assign the integer value returned form the method “parseInt()”.
      • Check whether the shift is “1”,
        • If it is true, assign the pay rate for shift_1.
      • Otherwise, check whether the shift is “2”,
        • If it is true, assign the pay rate for shift_2.
      • Otherwise,
        • Assign the pay rate for shift_3.
      • Check whether the hours worked is greater than the full week hours,
        • Compute the regular pay in terms of full week hours.
        • Compute the overtime pay.
      • Otherwise,
        • Compute the regular pay in terms of hours worked.
        • Set the overtime pay as “0.0”.
      • Compute the total pay.
      • Check whether the shift is “2” or shift is “3”,
        • Get the input entered into the dialog box.
        • Assign the integer value returned from the method “parseInt()”.
        • Check whether the entered value is “1”,
          • If it is true, compute the deduced amount.
      • Concatenate the string with pay calculated.
      • Display the output message in dialog box.

Blurred answer
Students have asked these similar questions
C++ PROGRAMProblem Statement:                 A 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend offered help to create a program they can use. The program contains 3 options, 1st option is for Permutation, 2nd option is Combination and 3rd is for terminating the system. For option 1, Permutation, they uses the following formula: nPr =  ; where r must not be greater than n. It should not proceed if this condition is not met. For 2nd option, Combination, they uses the formula : nCr =  ; where r must not be greater than n as well. For the 3rd option, the program owner’s information shall be displayed, like name, subject code and account number, before the program terminates.   Requirements: Develop the required system and use cpp for the file name Remember that both n and r are variables, their values shall only be entered at run time. The program requires the use of any looping The program requires the use of any conditional Introduce at…
C LANGUAGEA private railway company has just purchased a computer for its new automated reservationssystem. You have been asked to write a program to assign seats on each train of the railway havingonly (capacity: 100 seats). Your program should check whether it is a valid seat number or not.Also print its berth type i.e lower berth, middle berth, upper berth, side lower berth, side upperberth. Furthermore, then print a ticket indicating the person's seat number and whether it’s in the firstclass or economy section of the train. Use a single-subscripted array to represent the seating chartof the train. Initialize all the elements of the array to 0 to indicate that all seats are empty. As eachseat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longeravailable.
## MP (Machine Problem) Details The bulls and cows game is a code-breaking game designed for two or more players. Each player chooses a secret code of 4 digits from 0 – 9. The digits must be all different. The goal of the game is for each player to guess the other player's secret code. The players in turn present their guesses to the opponents. The opponents respond by telling the players: 1. The number of bulls, i.e. the number of matching digits in their right positions, and 2. The number of cows, i.e. the number of matching digits but in different positions. ### Requirements The main goal of this assignment is to develop the bulls and cows game that allows a single player to play interactively against the computer. The game stores two secret codes, one from the player and one from the computer. The player and the computer will try to guess each other’s secret code. Both the player and the computer only have seven attempts for guessing the secret code. If the player enters invalid…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY