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 car is about to start but it blows up. what is the problem with the car<br> ?
ratelena [41]

Answer:

because there is a bomb

6 0
3 years ago
Read 2 more answers
The period of a pendulum T is assumed to depend only on the mass m, the length of the pendulum `, the acceleration due to gravit
zzz [600]

Answer:

The expression is shown in the explanation below:

Explanation:

Thinking process:

Let the time period of a simple pendulum be given by the expression:

T = \pi \sqrt{\frac{l}{g} }

Let the fundamental units be mass= M, time = t, length = L

Then the equation will be in the form

T = M^{a}l^{b}g^{c}

T = KM^{a}l^{b}g^{c}

where k is the constant of proportionality.

Now putting the dimensional formula:

T = KM^{a}L^{b}  [LT^{-} ^{2}]^{c}

M^{0}L^{0}T^{1} = KM^{a}L^{b+c}

Equating the powers gives:

a = 0

b + c = 0

2c = 1, c = -1/2

b = 1/2

so;

a = 0 , b = 1/2 , c = -1/2

Therefore:

T = KM^{0}l^{\frac{1}{2} } g^{\frac{1}{2} }

T = 2\pi \sqrt{\frac{l}{g} }

where k = 2\pi

8 0
3 years ago
What is the composition of the two phases that form when a stream of 40% A, 39% B, and 21% C separates into two phases? Label th
irga5000 [103]

Answer:

vapor fraction = 0.4 and 0.08

Explanation:

At reasonably high temperatures, a mixture will exist in the form of a sub cooled liquid. Between these extremes, the mixture exists in a two phrase region where it is a vapor liquid equilibrium. From a vapor-liquid phase diagram, a mixture of 40% A, 39% B, and 21% C separates to give the vapor compositions of 0.4 and 0.08.

8 0
3 years ago
Multiply. Write the answer in simplest form. 1 3/10×1/8
kicyunya [14]

9514 1404 393

Answer:

  13/80

Explanation:

The product is ...

  (1 3/10)×(1/8) = (13/10)×(1/8) = (13×1)/(10×8) = 13/80

4 0
2 years ago
A DC generator turns at 2000 rpm and has an output of 200 V. The armature constant is 0.5 V-min/Wb, and the field constant of th
WITCHER [35]

Answer:

b. 10A

Explanation:

Using the formula, E= k × r×I

200= 0.5 ×2000×0.02×I

200=20×I

Dividing with 20

I = 200/20= 10A

4 0
3 years ago
Read 2 more answers
Other questions:
  • A fluid flows steadily through a pipe with a uniform cross sectional area. The density of the fluid decreases to half its initia
    6·1 answer
  • Which of the following are all desirable properties of a hydraulic fluid? a. good heat transfer capability, low viscosity, high
    5·1 answer
  • Two AAA-size lithium batteries are connected in series in a flashlight. Each battery has 3.5 volt and 4- Amp-hour capacity. If t
    8·1 answer
  • There are a number of requirements that employers must do to protect their workers from caught-in or
    12·1 answer
  • Define Plastic vs elastic deformation.
    13·1 answer
  • Burn in hell i watched your stupid video and i still could not get the answer
    14·1 answer
  • What is the name of the part that supports the headlight assembly?
    15·1 answer
  • Consider a building whose annual air-conditioning load is estimated to be 40,000 kWh in an area where the unit cost of electrici
    8·1 answer
  • What subject is he......... now? Vietnamese.A. to learnB. learnC. learningD. learned
    10·1 answer
  • Which of following is not malicious ?<br> Worm<br> Trogan Horse<br> Driver<br> Virus
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!