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
Technician A says a solenoid is not used on modern automobiles. Technician B says fuel injectors and starter motor solenoids are
julia-pushkina [17]

Answer:

ON THE BOTTOM

Explanation:

red cord plus black cord

5 0
3 years ago
After reading through the code, what will happen when you click run?* 1 point when run move forward while there is a pile do rem
KATRIN_1 [288]

Explanation:

I'm not exactly a master at coding, but I'm pretty sure that:

The farmer will remove dirt as long as there is a pile, then stop when the pile is done.

5 0
2 years ago
Why did my dad leave me yesterday like whatd i do?
Vsevolod [243]

Answer:

hmm i would try calling him. ask your mom or other adults where he is!

Explanation:

hope you get help soon!

4 0
3 years ago
Inspections may be_____ or limited to a specific area such as electrical or plumbing
Nuetrik [128]
A is the answer for the sentence
4 0
3 years ago
You buy a 75-W lightbulb in Europe, where electricity is delivered to homes at 240V. If you use the lightbulb in the United Stat
givi [52]

Answer:

The bulb will be \frac{1}{4} times as bright as it is in Europe.

Explanation:

Data provided in the question:

Power of bulb in Europe = 75 W

Voltage provided in Europe = 240 V

Voltage provided in United Stated = 120 V

Now,

We know,

Power = Voltage² ÷ Resistance

Therefore,

75 = 240² ÷ Resistance

or

Resistance = 240² ÷ 75

or

Resistance = 768 Ω

Therefore,

Power in United States = Voltage² ÷ Resistance

= 120² ÷ 768

= 18.75 W

Therefore,

Ratio of powers

\frac{\text{Power in united states}}{\text{Power in Europe}}=\frac{18.75}{75}

= \frac{1}{4}

Hence,

The bulb will be \frac{1}{4} times as bright as it is in Europe.

7 0
2 years ago
Other questions:
  • a) A total charge Q = 23.6 μC is deposited uniformly on the surface of a hollow sphere with radius R = 26.1 cm. Use ε0 = 8.85419
    8·1 answer
  • We need to design a logic circuit for interchanging two logic signals. The system has three inputs I1I1, I2I2, and SS as well as
    11·1 answer
  • The two shafts of a Hooke’s coupling have their axes inclined at 20°.The shaft A revolves at a uniform speed of 1000 rpm. The sh
    5·1 answer
  • A heat engine operates between a source at 477°C and a sink at 27°C. If heat is supplied to the heat engine at a steady rate of
    14·1 answer
  • If you are convicted of D.U.I. a second time in five years, your license may be revoked for up to __________ year/s.
    10·1 answer
  • 1. Given: R= 25 , E = 100 V<br> Solve for I
    5·1 answer
  • Document the XSS stored exploit script: Use the View Source feature of the web page and create a screenshot of the few lines cod
    15·1 answer
  • How do i do this? if y’all don’t mind helping lol
    13·1 answer
  • The efficiency of a steam power plant can beincreased by bleeding off some of the steam thatwould normally enter the turbine and
    15·1 answer
  • Why is “land-use planning” an appropriate name for urban planning?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!