subject

Java language The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.
1. Declare a constant named CENTS_PER_POUND and initialize with 25.
2. Get the shipping weight from user input storing the weight into shipWeightPounds.
3. Using FLAT_FEE_CENTS and CENTS_PER_POUND constants, assign shipCostCents with the cost of shipping a package weighing shipWeightPounds.
import java. util. Scanner;
public class ShippingCalculator {
public static void main (String [] args) {
Scanner scnr = new Scanner(System. in);
int shipWeightPounds;
int shipCostCents = 0;
final int FLAT_FEE_CENTS = 75;
int CENTS_PER_POUND = 25;
shipWeightPounds=10;
shipCostCents = (shipWeightPounds * CENTS_PER_POUND) + FLAT_FEE_CENTS;
System. out. println("Weight(lb): " + shipWeightPounds);
System. out. println("Flat fee(cents): " + FLAT_FEE_CENTS);
System. out. println("Cents per pound: " + CENTS_PER_POUND);
System. out. println("Shipping cost(cents): " + shipCostCents);
}
}
Screenshot
Testing shipWeightPounds 10
Weight (1b): 10
Flat fee (cents): 75
Cents per pound 25
shipping cost (cents): 325 Your output
× Testing shipWeightPounds-2
Output differs.
Weight (1b) 10
Flat fee (cents): 75
Cents per pound: 25
shipping cost (cents): 325 Your output
Weight (1b) 2
Flat fee (cents): 75
Expected output cents per pound: 25
Shipping cost (cents) 125

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:31
Cloud computing service providers manage different computing resources based on the services they offer. which resources do iaas and paas providers not manage? iaas providers do not manage the for the client, whereas paas providers usually do not manage the for their clients. iaas- storage server operating system network paas- applications interafce storage vertualiation
Answers: 2
question
Computers and Technology, 24.06.2019 01:30
How would you cite different books by the same author on the works cited page? moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. –––. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. moore, jack h. folk songs and ballads. salem: poetry press, 1999. print. moore, jack h. ballads in poetry – a critical review. dallas: garden books, 1962. print. –––. folk songs and ballads. salem: poetry press, 1999. print.
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
To fill (copy) a cell across or down, point to the of the cell and drag. top left corner top right corner bottom left corner bottom right corner
Answers: 3
You know the right answer?
Java language The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.
1...
Questions
question
Mathematics, 22.05.2020 13:59
question
Mathematics, 22.05.2020 13:59
question
Biology, 22.05.2020 13:59
question
Mathematics, 22.05.2020 13:59
question
Spanish, 22.05.2020 13:59
question
Mathematics, 22.05.2020 13:59