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
1 gallon of benzene having a density of 0.88 g/mL is spilled in 200 feet by 150 foot lake having an average depth of 6 feet. Wha
Irina18 [472]

Answer:

The concentration of benzene in this contaminated lake would be 653549ng/L.

Explanation:

The concentration C of a contaminant over a body of water of volume V can be obtained as:

C=Mass contaminant / V

In this case, the volume of the body of water:

V=200ft\cdot150ft\cdot6ft=5097.033m^3

The mass of the contaminant (Benzene):

m=\delta V_{ben}=0.88\frac{g}{ml} 1gal(us)=3.3311kg

Therefore:

C=\frac{m_{ben}}{V_{lake}}=6.53549\cdot10^{-4}kg/m^3=653549ng/l

4 0
4 years ago
A seamless pipe 800mm diameter contains a fluid under a pressure of 2N/mm2. If the permissible tensile stress is 100N/mm2, find
Bad White [126]

Answer:

8 mm

Explanation:

Given:

Diameter, D = 800 mm

Pressure, P = 2 N/mm²

Permissible tensile stress, σ = 100 N/mm²

Now,

for the pipes, we have the relation as:

\sigma=\frac{\textup{PD}}{\textup{2t}}

where, t is the thickness

on substituting the respective values, we get

100=\frac{\textup{2\times800}}{\textup{2t}}

or

t = 8 mm

Hence, the minimum thickness of pipe is 8 mm

3 0
3 years ago
What is the smallest variable type I can use to represent the number 27?
oksano4ka [1.4K]

Answer:3

Explanation:

Cuz

3 0
3 years ago
Liberty Autos recognizes that it has some customers who like roomy SUVs, while others like more compact versions. Liberty design
Elina [12.6K]

Answer:

segmenting the market

Explanation:

Liberty Auto is dividing its customers into smaller groups based on different characteristics & based on their needs they will optimize their products and then advertise to different customers.

3 0
4 years ago
A 35-ft³ rigid tank has propane at 25 psia, 540 R and is connected by a valve to another tank of 20 ft³ with propane at 40 psia,
gulaghasi [49]

Answer:

final pressure = 200KPa or 29.138psia

Explanation:

The detailed step by step calculations with appropriate conversion factors applied are as shown in the attachment.

8 0
3 years ago
Other questions:
  • I was grumpy with her when she came over because she forgot something we planned to do.I offered to pick her up down town while
    12·1 answer
  • I need solution for this question ​
    10·1 answer
  • A light train made up of two cars is traveling at 90 km/h when the brakes are applied to both cars. Know that car A has a mass o
    8·1 answer
  • ASAP PLEASEEEE HELP : Eccentricity, Inclination, True anomaly, Argument of perigee, Right ascension or the ascending node, Semi-
    11·1 answer
  • _______________ is an effective way to manage waste in a shop.
    13·1 answer
  • Estimate the luminosity of a 3 -solar-mass main-sequence star; of a 9 -solar-mass main-sequence star. Can you easily estimate th
    5·1 answer
  • What is the answer???
    10·1 answer
  • there are 17 toinspect in a commercial building. Each inspection takes 40 min. How many will the full inspection take
    9·1 answer
  • The thrust angle is checked by referencing
    12·1 answer
  • What car is this? I thinks its a nissan 240sx but i dont know
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!