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
A 150-lbm astronaut took his bathroom scale (aspring scale) and a beam scale (compares masses) to themoon where the local gravit
Nonamiya [84]

Answer:

a) W = 25.5 lbf

b) W = 150 lbf

Explanation:

Given data:

Mass of astronaut = 150 lbm

local gravity = 5.48 ft/s^2

a) weight on spring scale

it can be calculated by measuring force against local gravitational force which is equal to weight of body

W = mg

W = (150 \times 5.48)\times \frac{1 lbm}{32.32 lbm. ft/s^2} = 25.5 lbf

b) As we know that beam scale calculated mass only therefore no change in mass due to variation in gravity

thus W= 150 lbf

7 0
4 years ago
What is required when setting up a smart phone as a WIFI hotspot?
emmainna [20.7K]
How to create a personal hot spot on an iPhone?

Go to Settings | Cellular | Personal Hotspot.

Tap the slider next to Allow Others to Join. ...

Your Wi-Fi Password will be shown right underneath the Allow Others to Join option. ...

Now, on another device, such as a laptop, go to the Wi-Fi section and search for nearby networks.
5 0
3 years ago
Five kg of water is contained in a piston-cylinder assembly, initially at 5 bar and 240°C. The water is slowly heated at constan
Digiron [165]

Answer:

The final temperature of water is 381.39  °C.

Explanation:

Given that

Mass of water = 5 kg

Heat transfer at constant pressure Q = 2960 KJ

Initial temperature = 240 °C

We know that heat transfer at constant pressure given as follows

Q=mC_p\Delta T

We know that for water

C_p=4.187\ \frac{KJ}{kg.K}

Lets take final temperature of water is T

So

Q=mC_p\Delta T

2960=5\times 4.187(T-240)

T=381.39  °C

So the final temperature of water is 381.39  °C.

7 0
3 years ago
If you are interested only in the temperature range of 20° to 40°C and the ADC has a 0 to 3V input range, design a signal condit
mario62 [17]

Explanation:

Temperature range → 0 to 80'c

respective voltage output → 0.2v to 0.5v

required temperature range 20'c to 40'c

Where T = 20'c respective voltage

\begin{aligned}v_{20} &=0.2+\frac{0.5-0.8}{80} \times 20 \\&=0.2+\frac{0.3}{80} \times 20 \\V_{20} &=0.275 v\end{aligned}

\begin{aligned}\text { when } T=40^{\circ} C & \text { . } \\v_{40} &=0.2+\frac{0.5-0.2}{80} \times 40 \\&=0.35 V\end{aligned}

Therefore, Sensor output changes from 0.275v to 0.35volts for the ADC the required i/p should cover the dynamic range of ADC (ie - 0v to 3v)

so we have to design a circuit which transfers input voltage 0.275volts - 0.35v to 0 - 3v

Therefore, the formula for the circuit will be

\begin{array}{l}v_{0}=\left(v_{i n}-0.275\right) G \\\sigma=\ldots \frac{3-0}{0.35-0.275}=3 / 0.075=40 \\v_{0}=\left(v_{i n}-0.275\right) 40\end{array}

The simplest circuit will be a op-amp

NOTE: Refer the figure attached

Vs is sensor output

Vr is the reference volt, Vr = 0.275v

\begin{aligned}v_{0}=& v_{s}-v_{v}\left(1+\frac{R_{2}}{R_{1}}\right) \\\Rightarrow & \frac{1+\frac{R_{2}}{R_{1}}}{2}=40 \\& \frac{R_{2}}{R_{1}}=39 \quad \Rightarrow\end{aligned}

choose R2, R1 such that it will maintain required  ratio

The output Vo can be connected to voltage buffer if you required better isolation.

3 0
3 years ago
A group of n Ghostbusters is battling n ghosts. Each Ghostbuster carries a proton pack, which shoots a stream at a ghost, eradic
babunello [35]

Answer:

Using the above algorithm matches one pair of Ghostbuster and Ghost. On  each side of the line formed by the pairing, the number of Ghostbusters and Ghosts are  the same, so use the algorithm recursively on each side of the line to find pairings. The  worst case is when, after each iteration, one side of the line contains no Ghostbusters  or Ghosts. Then, we need n/2 total iterations to find pairings, giving us an P(n^{2} lg n)-  time algorithm.

4 0
3 years ago
Other questions:
  • How I do I get nut out of sheets​
    8·2 answers
  • WILL BRAINLIEST IF CORRECT!!!!!<br><br> Some one help ASAP.
    8·1 answer
  • Consider a 1000-W iron whose base plate is made of 0.5-cm-thick aluminum alloy 2024-T6 (rho = 2770 kg/m3 and cp = 875 J/kg·°C).
    12·1 answer
  • You have designed a bone plate that is manufactured via rolling under cold working conditions, and tests show good biocompatibil
    14·1 answer
  • The best way to become a better reader is to study longer and harder in every subject. engage in a variety of extracurricular ac
    5·2 answers
  • Convection ovens operate on the principle of inducing forced convection inside the oven chamber with a fan. A small cake is to b
    6·1 answer
  • Pointttttttttttttssssssssssss
    12·1 answer
  • Which type of smoke indicates excessive fuel being burned in the combustion chamber
    15·2 answers
  • Drivers must be careful when driving close to cyclists and should keep at least ___ feet apart when passing cyclists on the road
    15·1 answer
  • Your class is using engineering principles to improve the design of football helmets to prevent brain injury. your teacher divid
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!