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
Jnjn freeeeeeeeeeeeeeeeeeeeeeeeeeeeeee pointtttttttttt
kvasek [131]

Answer:

thx

Explanation:

5 0
3 years ago
Read 2 more answers
1. Calculate the battery life in years when a pacemaker has the following characteristics: Battery Ampere-hours = 1.5 Pulse volt
Wittaler [7]

Answer:

battery life in year = 9 years and 48 days

Explanation:

given data

Battery Ampere-hours = 1.5

Pulse voltage = 2 V

Pulse width = 1.5 m sec

Pulse time period = 1 sec

Electrode heart resistance = 150 Ω

Current drain on the battery = 1.25 µA

to find out

battery life in years

solution

we get first here duty cycle that is express as

duty cycle = \frac{width}{period}      ...............1

duty cycle = 1.5 × 10^{-3}

and applied voltage will be

applied voltage = duty energy × voltage    ...........2

applied voltage = 1.5 × 10^{-3} × 2

applied voltage = 3 mV

so current will be

current = \frac{applied\ voltage}{resistance}   ................3

current = \frac{3}{150}

current = 20 µA

so net current will be

net current = 20 - 1.25

net current = 18.75 µA

so battery life will be

battery life = \frac{1.5}{18.75*10^{-6}}

battery life = 80000 hours

battery life in year = \frac{80000}{8760}

battery life in year = 9.13 years

battery life in year = 9 years and 48 days

4 0
3 years ago
What is the Energy of moving things?<br><br> mechanical<br> sound<br> nuclear<br> Light
Elenna [48]

Answer: Kinetic energy

Explanation: If you live in a country other than UK you will probably call it something different

4 0
3 years ago
Read 2 more answers
For a turbulent flow of a fluid in 0.6 m diameter pipe, the velocity 0.15 m from the wall is 2.7 m/s. Estimate the wall shear st
MAVERICK [17]

Answer:

If the turbulent velocity profile in a pipe of diameter 0.6 m may be approximated by u/U=(y/R)^(1/7), where u is in m/s and y is in m and 0.15 m from the pipe.

Explanation:

hope it helps

3 0
3 years ago
The role of civil and structural engineer is to produce buildings for
Alinara [238K]
So I’m thinking C because they both have a lot to do with design here is my evidence. Structural engineering is a component of civil engineering which focuses on the design and development of infrastructures such as bridges, skyscrapers, dams. Civil engineering is a professional engineering discipline that deals with the design, construction, and maintenance of the physical and naturally built environment. I may be wrong but hope this helped!
3 0
3 years ago
Other questions:
  • A converging-diverging nozzle is designed to operate with an exit Mach number of 1.75 . The nozzle is supplied from an air reser
    15·1 answer
  • A furnace wall is to be built of 20-cm firebrick and building (structural) brick of same thickness. The thermal conductivities o
    14·1 answer
  • what is the method of the slope stabilization, and how many type of method of the stabilization, please help explain the types o
    13·1 answer
  • A vehicle is moving at a velocity, v, given by v =12t - 3t2 ms-1. Use
    7·1 answer
  • Select the correct answer
    8·1 answer
  • Assess the capabilities of a hydroelectric power plant from the following field data: Estimated water flow rate, 40 m3/s River i
    9·1 answer
  • You apply a force of 19 lbs on to the end of a lever to lift a crate. The resistance of the load is 106 lbs. Calculate the
    13·1 answer
  • What is aviation? What is the difference between aviation and flight?
    9·1 answer
  • Label each of the line types in the drawing below. ( will not mark you brainlest or whatever if you don't at least try to help)
    11·1 answer
  • A cantilever beam AB of length L has fixed support at A and spring support at B.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!