Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started