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
CASE STUDY AITAM LIBRARY MANAGEMENT SYSTEM AITAM Public Library is the biggest library in Koforidua. Currently, it has about 300 members. A person who is 18 or above can become a member. There is a membership fee of GHC400 for a year. There is a form to be filled in which person fills personal details. These forms are kept in store for maintaining members’ records and knowing the membership period. A member can issue a maximum of three books. He/she has three cards to issue books. Against each card a member can issue one book from library. Whenever a member wishes to issue a book and there are spare cards, then the book is issued. Otherwise that request is not entertained. Each book is to be returned on the specified due date. If a member fails to return a book on the specified date, a fine of GHC 2 per day after the due return date is charged. In case a card gets lost, then a duplicate card is issued. Accounts are maintained for the membership fees and money collected from the fines.…
College Driver Insurance offers discounted auto insurance to college students. The company uses several factors to set discounts, as follows:• A student who has taken a safe driver course earns a 5% discount.• A student with a clean record (no tickets or accidents in the last three years) earns a 5% discount.• A student who is 23 or older earns a 5% discount.• A student who meets all three conditions (has taken a safe driver course and has a clean record and is 23) earns an additional bonus discount of 5%.1. Create a decision table that describes the discount rules.2. Simplify the table you just created. Describe the results.3. Draw a simplified decision tree that shows the discount rules.4. What are the pros and cons of using a decision table versus a decision tree?
Pearson Institute of Higher Education EnrolmentAt the Pearson Institute of Higher Education, the degrees offered have a number of years in which a student is expected to complete the degree. On average, the number of years for a degree is 4. If thestudent takes more than 6 years to complete the degree, they are at risk to be expelled from the institution or asked to repeat the degree altogether. Pearson management has contacted you to write a program to be used to check which students are behind their expected time of degree completion. You have been provided with a text file containing a list of all the students enrolled at the institution with the number of years they have been enrolled. It is structured as follows: Sample Data – PIHEstudents.txtSheunesu Makura, 6Thando Mandela, 4Palesa Ramodike, 3Mariaane Van Der Walt, 5Xolisa Gqeberha, 4 Create a Java application based on the scenario you have been provided above. The application must read the names and the years from the…
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
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY