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
How many different powerball combinations are there
svlad2 [7]
Answer:





There 11,238,513 different Powerball
4 0
2 years ago
A steam power plant with a power output of 230 MW consumes coal at a rate of 60 tons/h. If the heating value of the coal is 30,0
NARA [144]

Answer:

\eta =46\%

Explanation:

Hello!

In this case, we compute the heat output from coal, given its heating value and the mass flow:

Q_H=60\frac{tons}{h}*\frac{1000kg}{1ton}*\frac{1h}{3600s}*\frac{30,000kJ}{kg}\\\\Q_H=500,000\frac{kJ}{s}*\frac{1MJ}{1000J} =500MW

Next, since the work done by the power plant is 230 MW, we compute the efficiency as shown below:

\eta =\frac{230MW}{500MW}*100\% \\\\\eta =46\%

Best regards!

7 0
3 years ago
The efficiency of a steam power plant can beincreased by bleeding off some of the steam thatwould normally enter the turbine and
3241004551 [841]

Answer:

Explanation:

This is Answer....

5 0
2 years ago
The underground storage of a gas station has leaked gasoline into the ground. Among the constituents of gasoline are benzene, wi
vovangra [49]

Answer:

a) benzene = 910 days

b) toluene = 1612.67 days

Explanation:

Given:

Kd = 1.8 L/kg (benzene)

Kd = 3.3 L/kg (toluene)

psolid = solids density = 2.6 kg/L

K = 2.9x10⁻⁵m/s

pores = n = 0.37

water table = 0.4 m

ground water = 15 m

u = K/n = (2.9x10⁻⁵ * (0.4/15)) / 0.37 = 2.09x10⁻⁶m/s

a) For benzene:

R=1+\frac{\rho * K_{d}  }{n}, \rho = 2.6\\ R=1+\frac{2.6*1.8}{0.37} =13.65

The time will take will be:

t=\frac{xR}{a} , x=12,a=0.18\\t=\frac{12*13.65}{0.18} =910days

b) For toluene:

R=1+\frac{2.6*3.3  }{0.37} = 24.19

t=\frac{12*24.19}{0.18} =1612.67days

6 0
3 years ago
Read 2 more answers
Consider an area-source box model for air pollution above a peninsula of land. The length of the box is 15 km, its width is 80 k
In-s [12.5K]

Consider an area-source box model for air pollution above a peninsula of land. The length of the box is 15 km, its width is 80 km, and a radiation inversion restricts mixing to 15 m. Wind is blowing clean air into the long dimension of the box at 0.5 m/s. On average, there are 250,000 vehicles on the road, each being driven 40 km in 2 hours and each emitting 4 g/km of CO.

Required:

a. Estimate the steady-state concentration of CO in the air. Should the city be designated as "nonattainment" (i.e., steady-state concentration is over the NAAQS standard)?

b. Find the average rate of CO emissions during this two-hour period.

c. If the windspeed is zero, use the formula to derive relationship between CO and time and use it to find the CO over the peninsula at 6pmConsider an area-source box model for air pollution above a peninsula of land. The length of the box is 15 km, its width is 80 km, and a radiation inversion restricts mixing to 15 m. Wind is blowing clean air into the long dimension of the box at 0.5 m/s. On average, there are 250,000 vehicles on the road, each being driven 40 km in 2 hours and each emitting 4 g/km of CO.

Required:

a. Estimate the steady-state concentration of CO in the air. Should the city be designated as "nonattainment" (i.e., steady-state concentration is over the NAAQS standard)?

b. Find the average rate of CO emissions during this two-hour period.

c. If the windspeed is zero, use the formula to derive relationship between CO and time and use it to find the CO over the peninsula at 6pmConsider an area-source box model for air pollution above a peninsula of land. The length of the box is 15 km, its width is 80 km, and a radiation inversion restricts mixing to 15 m. Wind is blowing clean air into the long dimension of the box at 0.5 m/s. On average, there are 250,000 vehicles on the road, each being driven 40 km in 2 hours and each emitting 4 g/km of CO.

Required:

a. Estimate the steady-state concentration of CO in the air. Should the city be designated as "nonattainment" (i.e., steady-state concentration is over the NAAQS standard)?

b. Find the average rate of CO emissions during this two-hour period.

c. If the windspeed is zero, use the formula to derive relationship between CO and time and use it to find the CO over the peninsula at 6pm

<em><u>p</u></em><em><u>lease</u></em><em><u> mark</u></em><em><u> me</u></em><em><u> as</u></em><em><u> brainliest</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em>

<em><u>f</u></em><em><u>ollow</u></em><em><u> me</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>,</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em>

3 0
3 years ago
Other questions:
  • Signal generator‘s internal impedance is purely resistive and has an open-circuit voltage of 3.5 V. When the generator is loaded
    11·1 answer
  • If you are sampling a 50Hz signal, what is the minimum sampling rate necessary to prevent aliasing?Why?
    7·1 answer
  • Pressurized steam at 450 K flows through a long, thin-walled pipe of 0.5-m diameter. The pipe is enclosed in a concrete casing t
    15·1 answer
  • Calculate the impedance of a 20 mH inductor at a frequency of 100 radians/s. Calculate the impedance of a 500 µF inductor at a f
    9·2 answers
  • 1. A fixed-geometry supersonic inlet starts at a Mach number of 3. After starting, the cruise Mach number is 2, and the operatin
    13·1 answer
  • Give an example of how the fields of science, technology, and mathematics are commonly used when building a highway.
    7·1 answer
  • Who is using welding symbols to to communicate the detailed information necessary for welders to complete the weld?
    6·1 answer
  • Suppose there is a mobile application that can run in two modes: Lazy or Eager. In Lazy Mode, the execution time is 3.333 second
    11·1 answer
  • Question Completion Status:
    6·1 answer
  • What is a beta testing ?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!