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
A river has an average rate of water flow of 59.6 M3/s. This river has three tributaries, tributary A, B and C, which account fo
Fiesta28 [93]

Answer:

50421.6 m³

Explanation:

The river has an average rate of water flow of 59.6 m³/s.

Tributary B accounts for 47% of the rate of water flow. Therefore the rate of water flow through tributary B is:

Flow rate of water through tributary B = 47% of 59.6 m³/s = 0.47 * 59.6 m³/s = 28.012 m³/s

The volume of water that has been discharged through tributary B = Flow rate of water through tributary B * time taken

time = 30 minutes = 30 minutes * 60 seconds / minute = 1800 seconds

The volume of water that has been discharged through tributary B in 30 seconds = 28.012 m³/s * 1800 seconds = 50421.6 m³

3 0
3 years ago
Exhaust gas from a furnace is used to preheat the combustion air supplied to the furnace burners. The gas, which has a flow rate
Monica [59]

Answer:

The total tube surface area in m² required to achieve an air outlet temperature of 850 K is 192.3 m²

Explanation:

Here we have the heat Q given as follows;

Q = 15 × 1075 × (1100 - t_{A2}) = 10 × 1075 × (850 - 300) = 5912500 J

∴ 1100 - t_{A2} = 1100/3

t_{A2}  = 733.33 K

\Delta \bar{t}_{a} =\frac{t_{A_{1}}+t_{A_{2}}}{2} - \frac{t_{B_{1}}+t_{B_{2}}}{2}

Where

\Delta \bar{t}_{a} = Arithmetic mean temperature difference

t_{A_{1} = Inlet temperature of the gas = 1100 K

t_{A_{2} = Outlet temperature of the gas = 733.33 K

t_{B_{1} =  Inlet temperature of the air = 300 K

t_{B_{2} = Outlet temperature of the air = 850 K

Hence, plugging in the values, we have;

\Delta \bar{t}_{a} =\frac{1100+733.33}{2} - \frac{300+850}{2} = 341\tfrac{2}{3} \, K = 341.67 \, K

Hence, from;

\dot{Q} = UA\Delta \bar{t}_{a}, we have

5912500  = 90 × A × 341.67

A = \frac{5912500  }{90 \times 341.67} = 192.3 \, m^2

Hence, the total tube surface area in m² required to achieve an air outlet temperature of 850 K = 192.3 m².

4 0
3 years ago
What should you, the worker, be aware of with regard to evacuation procedures at your workplace
Alinara [238K]

Answer:

As a worker, it is important to follow the proper set of instructions or emergency plans during an emergent situation. Not carefully following the rules may result to a bigger problem such as further injury and damage to property.

Explanation:

Evacuation Procedure- This is a step-by-step procedure that people follow in order to safely vacate any building or place. This procedure is applicable to any situation, such as the workplace. This is now called the <em>Workplace Evacuation Procedure. </em>This is very important because there are so many unpredictable situations or events that are happening in the world right now, such as fire or earthquake. This procedure is being done through an evacuation plan.

The awareness of the workers regarding the proper way to evacuate during emergency situation is very important. It will be easier for them to know where to locate the nearest exit route. They will also learn to stop any form of device or equipment that could cause a hazzard during the situation. In case of the hospital, which is also a workplace, the employees will also learn how to assist the patients before themselves. They will also know where to assemble if there's a need to do so.

7 0
3 years ago
Read 2 more answers
Given frequency, what is the formula for the period of a wave?
Veronika [31]

Answer:

f = c / λ = wave speed c (m/s) / wavelength λ (m). The formula for time is: T (period) = 1 / f (frequency). λ = c / f = wave speed c (m/s) / frequency f (Hz). The unit hertz (Hz) was once called cps = cycles per second.

Explanation:

7 0
2 years ago
Joe is a chemical engineer whose plant discharges heavy metals into the local river. By the test authorized by the city governme
chubhunter [2.5K]

Answer:

B probably

Explanation:

Because the prompt doesn't specify what sort of violation it could be anything maybe when they release the metals during the day and so on.

5 0
2 years ago
Other questions:
  • A cylindrical specimen of brass that has a diameter of 20 mm, a tensile modulus of 110 GPa, and a Poisson’s ratio of 0.35 is pul
    13·1 answer
  • Consider flow in between two parallel plates located a distance H from each other. Fluid flow is driven by the bottom plate movi
    15·1 answer
  • Where Does a Solar Engineer Work? <br> (2 sentences or more please)
    14·2 answers
  • Verify the below velocity distribution describes a fluid in a state of pure rotation. What is the angular Velocity? (a)-Vx = -1/
    7·1 answer
  • A simple ideal Rankine cycle with water as the working fluid operates between the pressure limits of 4 MPa in the boiler and 20
    12·1 answer
  • When do you need to apply for program completion and review?
    11·1 answer
  • Please help me:<br> Use the Node analysis to find the power of all resistors
    9·1 answer
  • 1<br>M<br>A BLIND COOK WHO DEFEATED<br>OVER 30,000 HOME COOKS!<br>y of​
    13·1 answer
  • Component of earthing and reasons why each material is being used<br><br>​
    5·1 answer
  • when a unit load is secured to a pallet, it is more difficult for pilferage to take place. true false
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!