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]
4 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]4 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
Two vertical parallel plates are spaced 0.01 ft apart. If the pressure decreases at a rate of 60 psf/ft in the vertical z-direct
Whitepunk [10]

Answer:

umax = 0.1259ft/s

Explanation:

Given:

•Distance between plates, B = 0.01ft

•Pressure difference decrease, \frac{dp}{dz}=60ps/ft

•Fluid viscosity, u = 10^-³lbf-s/ft²

Specific gravity, S = 0.80

Max velocity in the z-direction will be:

u_max= [\frac{B^2y}{8u}]\frac{dh}{ds}

But h = \frac{P}{y}+z

Substituting for h in the first equation, we have:

\frac{d}{dz}[\frac{p}{y}+z]

\frac{dh}{dz}=\frac{1}{y}\frac{dp}{ds}+\frac{dz}{dz}

= \frac{1}{0.8*62.4}(-60)+1

= -0.20192

Substituting dh/dz value in the first equation (umax), we have:

umax = \frac{0.01^2(0.8*62.4)}{8*10^-^3}(-0.20192)

umax = 0.1259ft/s

4 0
4 years ago
All PPE used for lung protection must be tight-fitting. Is this statement TRUE or FALSE?
lubasha [3.4K]
I think true I’m not sure
3 0
2 years ago
Line.
Veronika [31]

Air supplied to a pneumatic system is supplied through the C. Actuator

Explanation

Pneumatic systems are like hydraulic systems, it is just that these systems uses compressed air rather than hydraulic fluid.  Pneumatic systems are used widely across the industries. these pneumatic systems needs a constant supply of compressed air to operate. This is provided by an air compressor. The compressor sucks in air at a very high rate from the environment and stores it in a pressurized tank. the Air is supplied thereafter with the help of a actuator valve that is a more sophisticated form of a valve.

From the above statement it is clear that Air supplied to a pneumatic system is supplied through the  Actuator

7 0
4 years ago
In a hydroelectric power plant, water enters the turbine nozzles at 800 kPa absolute with a low velocity. If the nozzle outlets
Whitepunk [10]

Answer:

The answer is VN =37.416 m/s

Explanation:

Recall that:

Pressure (atmospheric) = 100 kPa

So. we solve for the maximum velocity (m/s) to which water can be accelerated by the nozzles

Now,

Pabs =Patm + Pgauge = 800 KN/m²

Thus

PT/9.81 + VT²/2g =PN/9.81  + VN²/2g

Here

Acceleration due to gravity = 9.81 m/s

800/9.81 + 0

= 100/9.81 + VN²/19.62

Here,

9.81 * 2= 19.62

Thus,

VN²/19.62 = 700/9.81

So,

VN² =1400

VN =37.416 m/s

Note: (800 - 100) = 700

7 0
3 years ago
Read 2 more answers
Vai trò của chủ đầu tư
White raven [17]

Answer:

can't understand the writting

4 0
3 years ago
Read 2 more answers
Other questions:
  • Select the correct answer.
    13·1 answer
  • Air (ideal gas) is contained in a cylinder/piston assembly at a pressure of 150 kPa and a temperature of 127°C. Assume that the
    12·1 answer
  • A _________ is interesting only if the statistics computed from transactions covered by the rule are different than those comput
    14·1 answer
  • Explain the dilemma faced by engineers when the state of technological change does not exactly match the state of social change
    15·1 answer
  • Roundabouts have significantly lower crash and fatality rates than intersections.
    5·1 answer
  • A genetically engineered hormone,___________, can treat Mary’s child for growth hormone deficiencies by stimulating body growth
    7·1 answer
  • Refrigerant 134a vapor in a piston-cylinder assembly undergoes a process at constant pressure from an initial state at 8 bar and
    7·1 answer
  • What is the approximate Brinell hardness of a 1040 steel having a yield strength of 620 MPa (90,000 psi)
    13·1 answer
  • (a)Identify the relevant population for the below foci, and suggest the appropriate sampling
    10·1 answer
  • The operating sequence to light the main burners on an intermittent pilot system is:______.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!