Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve in netbeans Task #1 Writing an Algorithm 1. Copy the file Pay.java (see Code Listing 1.1) from the Student CD or as directed by

solve in netbeans
image text in transcribed
image text in transcribed
Task #1 Writing an Algorithm 1. Copy the file Pay.java (see Code Listing 1.1) from the Student CD or as directed by your instructor. 2. Open the file in your Java Integrated Development Environment (IDE) or a text editor as directed by your instructor. Examine the file, and compare it with the detailed version of the pseudocode in step number 3, section 1.6 of the textbook. Notice that the pseudocode does not include every line of code. The program code includes identifier declarations and a statement that is needed to enable Java to read from the keyboard. These are not part of actually completing the task of calculating pay, so they are not included in the pseudocode. The only important difference between the example pseudocode and the Java code is in the calculation. Below is the detailed pseudocode from the example, but without the calculation part. You need to fill in lines that tell in English what the calculation part of Pay.java is doing. Display "How many hours did you work?". Input hours Display "How much are you paid per hour?". Input rate. Display the value in the pay variable. ou us Teve import java.util.Scanner; // Needed for the Scanner class This program calculates the user's gross pay. public class Pay public static void main(String[] args) // Create a Scanner object to read from the keyboard. Scanner keyboard = new Scanner (System.in); // Identifier declarations double hours; // Number of hours worked double rate; // Hourly pay rate double pay; // Gross pay // Display prompts and get input. System.out.print("How many hours did you work? "); hours - keyboard.next Double(); System.out.print("How much are you paid per hour? "); rate - keyboard.nextDouble(); // Perform the calculations. if (hours

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

CALCULATOR STANDARD VIEW PRINTER VERSION

Answered: 1 week ago

Question

Explain the causes of indiscipline.

Answered: 1 week ago