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
As a general rule of thumb, in-line engines are easier to work on than the other cylinder arrangements.
siniylev [52]

Answer:

The general rule of thumb is that the SMALLER a substance's atoms and the STRONGER the bonds, the harder the substance. Two of the strongest forms of chemical bonds are the ionic and covalent bonds.

Explanation:

5 0
3 years ago
A list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor. HERE
Free_Kalibri [48]

Using the knowledge of computational language in python it is possible to write a code that writes a list and defines the arrange.

<h3>Writing code in python:</h3>

<em>def isSorted(lyst):</em>

<em>if len(lyst) >= 0 and len(lyst) < 2:</em>

<em>return True</em>

<em>else:</em>

<em>for i in range(len(lyst)-1):</em>

<em>if lyst[i] > lyst[i+1]:</em>

<em>return False</em>

<em>return True</em>

<em>def main():</em>

<em>lyst = []</em>

<em>print(isSorted(lyst))</em>

<em>lyst = [1]</em>

<em>print(isSorted(lyst))</em>

<em>lyst = list(range(10))</em>

<em>print(isSorted(lyst))</em>

<em>lyst[9] = 3</em>

<em>print(isSorted(lyst))</em>

<em>main()</em>

See more about python at brainly.com/question/18502436

#SPJ1

7 0
2 years ago
Which of the following is a variable expense for many adults?
sertanlavr [38]
But where are the options?
7 0
3 years ago
Read 2 more answers
(a)Compute the electrical conductivity of a cylindrical silicon specimen 7.0 mm (0.28 in.) diameter and 57 mm (2.25 in.) in leng
igor_vitrenko [27]

Answer:

a) \sigma = 12.2 (Ω-m)^{-1}

b) Resistance = 121.4 Ω

Explanation:

given data:

diameter is 7.0 mm

length 57 mm

current I = 0.25 A

voltage v = 24 v

distance between the probes is 45 mm

electrical conductivity is given as

\sigma = \frac{I l}{V \pi r^2}

\sigma  = \frac{0.25 \times 45\times 10^{-3}}{24 \pi [\frac{7 \times 10^{-3}}{2}]^2}

\sigma = 12.2(Ω-m)^{-1}[/tex]

b)

Resistance = \frac{l}{\sigma A}

                  = \frac{l}{ \sigma \pi r^2}

= \frac{57  \times 10^{-3}}{12.2 \times \pi [\frac{7 \times 10^{-3}}{2}]^2}

Resistance = 121.4 Ω

8 0
3 years ago
Which one of the following types of gas is flammable? a. Neon b. Peroxide. c. Acetylene d. Carbon Dioxide ​
Delvig [45]

Answer:

D Carbon Dioxide

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Soap is a very interesting chemical. We even discussed it on the discussion board. How does it work, exactly?
    7·1 answer
  • What is the difference between a refrigeration cycle and a heat pump cycle?
    9·1 answer
  • What is 100 kPa in psia?
    11·1 answer
  • If x &lt; 5 and x &gt;c, give a value of c such that there
    9·1 answer
  • Assuming the torsional yield strength of a compression spring is 0.43Sut and the maximum shear stress is equal to 434MPa. What i
    9·1 answer
  • In which forms do MOST of the Sun's energy reach Earth's surface?
    15·1 answer
  • What learning is required to become a mechanical engineer?
    14·1 answer
  • The purpose of pasteurizing milk is to
    13·2 answers
  • Ughhh my cramps hurt sm
    8·2 answers
  • Why is electricity considered a secondary source of energy
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!