1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
solmaris [256]
3 years ago
10

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.
Engineering
1 answer:
Mrac [35]3 years ago
5 0

Answer:

Code Listing 1.1 (Pay.java)

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.nextDouble();

System.out.print("How much are you paid per hour? ");

rate = keyboard.nextDouble();

// Perform the calculations. if(hours <= 40)

pay = hours * rate;

else

pay = (hours - 40) * (1.5 * rate) + 40 * rate;

// Display results. System.out.println("You earned $" + pay);

}

}

Code Listing 1.2 (SalesTax.java)

import java.util.Scanner; // Needed for the Scanner class

/**

This program calculates the total price which includes

sales tax.

*/

public class SalesTax

{

public static void main(String[] args)

{

// Identifier declarations final double TAX_RATE = 0.055; double price;

double tax

double total; String item;

// Create a Scanner object to read from the keyboard. Scanner keyboard = new Scanner(System.in);

// Display prompts and get input. System.out.print("Item description: "); item = keyboard.nextLine(); System.out.print("Item price: $");

price = keyboard.nextDouble();

// Perform the calculations. tax = price + TAX_RATE;

totl = price * tax;

// Display the results. System.out.print(item + "  $"); System.out.println(price); System.out.print("Tax $"); System.out.println(tax); System.out.print("Total $"); System.out.println(total);

}

}

You might be interested in
The following displacement (cm), output (V) data have been recorded during a calibration of an LVDT. Displacement (cm), output (
nadya68 [22]

Answer:

2.08V/cm

Explanation:

Plot the points on a graph. Draw the line of best fit. Calculate the gradietn of line of best fit.

Attached is the graph plotted on excel.

The equation of the line is

Votlage= 2.08× distance + 0.276

4 0
3 years ago
A meter stick can be read to the nearest millimeter and a travelling microscope can be read to the nearest 0.1 mm. Suppose you w
german

Answer: No

Explanation:

Length= 2cm= 20mm

Now meter stick can read to nearest millimeter.

It is given that length is to be measured with a precision of 1% of 20mm= 1/100 * 20= 0.2mm

Since the least count is 1mm of meter stick and precision required is less than that. So, meter stick cannot be used for this, travelling microscope can be used for this as it can read to 0.1mm.

3 0
3 years ago
Affordability is most concerned with:
leva [86]

Answer:

feasibility study

Explanation:

7 0
3 years ago
Explain how smart materials can be used by manufacturers to improve health and safety for children's products and goods.​
Ierofanga [76]

...simplify devices, reducing weight and the chance of failure.

6 0
2 years ago
Urgent please help!<br> What are non-ferrous metal and ferrous metal?
m_a_m_a [10]
In metallurgy, non-ferrous metals are metals or alloys that do not contain iron in appreciable amounts. Generally more costly than ferrous metals, non-ferrous metals are used because of desirable properties such as low weight, higher conductivity, non-magnetic property or resistance to corrosion
8 0
2 years ago
Other questions:
  • an adiabatic compressor receives 1.5 meter cube per second of air at 30 degrees celsius and 101 kpa. The discharge pressure is 5
    11·1 answer
  • A hydraulic cylinder has a 125-mm diameter piston with hydraulic fluid inside the cylinder and an ambient pressure of 1 bar. Ass
    8·1 answer
  • IN JAVA,
    6·1 answer
  • Consider the cascade of the three LTI systems having impulse responses: h-1(t) = e^-tu(t + 3) h_2(t) = rect((1 -1)/2) h_3(t) = d
    8·1 answer
  • A package is thrown down an incline at A with a velocity of 1 m/s. The package slides along the surface ABC to a conveyor belt w
    13·1 answer
  • I will put other link in comments
    12·1 answer
  • A manager who focuses on the employees who enable a company to do business is human resource management. True True False False
    7·1 answer
  • What can you add to a seatbelt ??<br> HELP ASAP
    15·1 answer
  • Draw the six principal views of
    13·1 answer
  • Write a program that takes three numbers as input from the user, and prints the largest.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!