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 5-mm-thick stainless steel strip (k = 21 W/m•K, rho = 8000 kg/m3, and cp = 570 J/kg•K) is being heat treated as it moves throu
Drupady [299]

Answer:

The temperature of the strip as it exits the furnace is 819.15 °C

Explanation:

The characteristic length of the strip is given by;

L_c = \frac{V}{A} = \frac{LA}{2A} = \frac{5*10^{-3}}{2} = 0.0025 \ m

The Biot number is given as;

B_i = \frac{h L_c}{k}\\\\B_i = \frac{80*0.0025}{21} \\\\B_i = 0.00952

B_i < 0.1,  thus apply lumped system approximation to determine the constant time for the process;

\tau = \frac{\rho C_p V}{hA_s} = \frac{\rho C_p L_c}{h}\\\\\tau = \frac{8000* 570* 0.0025}{80}\\\\\tau = 142.5 s

The time for the heating process is given as;

t = \frac{d}{V} \\\\t = \frac{3 \ m}{0.01 \ m/s} = 300 s

Apply the lumped system approximation relation to determine the temperature of the strip as it exits the furnace;

T(t) = T_{ \infty} + (T_i -T_{\infty})e^{-t/ \tau}\\\\T(t) = 930 + (20 -930)e^{-300/ 142.5}\\\\T(t) = 930 + (-110.85)\\\\T_{(t)} = 819.15 \ ^0 C

Therefore, the temperature of the strip as it exits the furnace is 819.15 °C

5 0
3 years ago
WHAT IS THIS PLSSSSSS HELP
alekssr [168]

Answer:

It looks like... A machine that reads electric pulse and surge... Not sure though.

Explanation:

8 0
3 years ago
Which is equal to a temperature of 50°F?<br><br> 18°C<br> 46°C<br> 10°C<br> 32°C
Ludmilka [50]

Answer:

10°C degrees po ang sagot

8 0
3 years ago
Read 2 more answers
You are investigating surface hardening in iron using nitrogen gas. Two 5 mm thick slabs of iron are separately exposed to nitro
Luden [163]

Answer and Explanation:

The explanation is attached below

4 0
3 years ago
¿Que piensas respecto al hecho de que María y Efraín rara vez se comunican directamente?
AleksandrR [38]

Answer:

Crean un código usando la naturaleza.

8 0
3 years ago
Other questions:
  • If you are a government authority what extend will you modify the existing policy
    11·1 answer
  • A mass of 0.3 kg is suspended from a spring of stiffness 0.4 N/mm. The damping is 3.286335345 kg/s. What is the undamped natural
    5·1 answer
  • What is compression ratio of an Otto cycle? How does it affect the thermal efficiency of the cycle?
    14·1 answer
  • A 5 m deep deposit of sand and silt containing organic layers is to be compacted using explosives placed in the boreholes locate
    13·1 answer
  • Block D of the mechanism is confined to move within the slot of member CB. Link AD is rotating at a constant rate of ωAD = 6 rad
    11·1 answer
  • Why is it important to always be wearing a personal flotation device (PFD) when in or around the water?
    9·2 answers
  • . (20 pts) A horizontal cylindrical pipe (k = 10 W/m·K) has an outer diameter of 15 cm and a wall thickness of 5 cm. The pipe is
    14·1 answer
  • Sawzall® is another term commonly applied to?
    12·1 answer
  • A 75-hp motor that has an efficiency of 91.0% is worn-out and is replaced by a motor that has a high efficiency 75-hp motor that
    6·1 answer
  • Contrast moral and immoral creativity and innovation<br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!