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
Yakvenalex [24]
3 years ago
5

Java languageThe 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); }}

Computers and Technology
2 answers:
Sophie [7]3 years ago
8 0

Answer:

// Here is code in Java.

// import package

import java.util.*;

// class definition

class Main

{

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

    try{

   // variables

    final int CENTS_PER_POUND = 25;

    final int FLAT_FEE_CENTS = 75;

    // Scanner object to read input

   Scanner sr=new Scanner(System.in);

   System.out.print("Enter the shipping weight:");

   // read the input weight

   int shipWeightPounds=sr.nextInt();

   // calculate total cost

  int shipCostCents = (shipWeightPounds * CENTS_PER_POUND) + FLAT_FEE_CENTS;

  // print Weight

  System.out.println("shipping  Weight: " + shipWeightPounds);

  // print flat fee

     System.out.println("flat fee of shipping in cents : " + FLAT_FEE_CENTS);

     // print cents per round

     System.out.println("Cents/pound for shipping: " + CENTS_PER_POUND);

     // print cost of Shipping

    System.out.println("total cost of shipping in cents: " + shipCostCents);

   

   

   }catch(Exception ex){

       return;}

}

}

Explanation:

Declare and initialize two constant variables "CENTS_PER_POUND=25" & "FLAT_FEE_CENTS = 75". Read the input weight from user with the help of Scanner class object. Then  calculate the cost of shipping by multiply weight with cent per pound and add flat fee. Then print each of them.

Output:

Enter the shipping weight:12                                                                                                                                  

shipping  Weight : 12                                                                                                                                        

flat fee of shipping in cents: 75                                                                                                                              

Cents/pound for shipping: 25                                                                                                                                  

total cost of shipping in cents: 375  

zhuklara [117]3 years ago
3 0

Answer:

final int CENTS_PER_POUND = 25;

     shipWeightPounds=scnr.nextInt();

     shipCostCents = ((shipWeightPounds * CENTS_PER_POUND) + FLAT_FEE_CENTS);

Explanation:

You might be interested in
What are the third generation of computer?​
balu736 [363]

The period of third generation was from 1965-1971. The computers of third generation used Integrated Circuits (ICs) in place of transistors. A single IC has many transistors, resistors, and capacitors along with the associated circuitry. The IC was invented by Jack Kilby.

3 0
3 years ago
Read 2 more answers
A software team is setting an automation strategy and begins by identifying business processes that could benefit from automatio
mixas84 [53]

B is what I would guess.

5 0
2 years ago
Develetech has a security policy that mandates a basic security feature for mobile device access. What is this basic security fe
kirill [66]

Answer:A password or a PIN

Explanation: Develetech is a industry that has the a internet page and can also be used in the mobile devices. There is particular authorization that the organization provides to an individual user for accessing of the services to maintain the security .The security is maintained by providing the devices with an encrypted text that is known as the password. The user has to enter the pin or password to execute the service on device.

5 0
3 years ago
Business application software programs make it possible to
Daniel [21]
Business application software programs make it possible to: increase productivity in the office setting.
Please give me Brainless if this help!!
6 0
3 years ago
Media _____ refers to a worldwide educational movement that aims to teach to people to understand how the media affect both indi
mario62 [17]

Answer:

literacy

Explanation:

Media literacy. This is a worldwide educational movement that aims to teach to people to understand how the media affect both individuals and society as a whole.

3 0
2 years ago
Other questions:
  • Which one of the following is true about employer responsibility in providing fall protection to workers? not selected A. Employ
    15·2 answers
  • Let's play Silly Sentences!
    10·1 answer
  • Your task is to write a C program that measures the latencies of various system calls. In particular, you want to know 1) the co
    5·1 answer
  • Ideally, how long or how many sentences should your video game pitch be?
    9·1 answer
  • Explain the<br>4 ways<br><br>ways of arranging icons.<br><br>​
    6·1 answer
  • Choose all of the items that accurately describe an operating system.
    7·1 answer
  • Picking up sound over a great distance while making it seem to come from close up.
    11·1 answer
  • NEED HELP ON TEST!!!
    5·1 answer
  • 13) When developing film, how do you dispose of fixer as opposed to developer?
    10·1 answer
  • How do we explain the difference between fake news and facts​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!