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]
2 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]2 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]2 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
Write a qbasic program to display integer numbers 1 to 100 using the for next loop<br>​
Natasha2012 [34]

Answer:

CLS

FOR i = 1 TO 100

PRINT i

NEXT i

END

3 0
3 years ago
Who can search the internet and select element base on important words
disa [49]
I believe it is ctrl f or ctrl shift f
6 0
3 years ago
Different between internet and email​
pentagon [3]

Answer:

The internet allows you to connect with people and information around the world. The internet is more broad and could include searching things up or message-based websites. Emails is more specific, with it being when you send someone a message (called an email) on a mail website (that allows you to get messages from other people, websites, etc.)

Explanation:

In my answer.

5 0
3 years ago
Which statement reflects an opinion about technology? Select all that apply. Select one or more: a. It is easy to imagine that a
True [87]

Answer:

All options apply to the question because each one reflects one side of technology in relation to the artist's case (that could be a software engineer or a even a hardware designer).

Explanation:

Letter a applies to the question in terms of computer program's behavior with no people's assistance, which is something not real for the present time, although it is easy to imagine that it is going to be a reality in a near future for all the improvements engineers and developers have made. Letter b also applies because computers and softwares have become one of the most important tools for artists around the world, whether for researching and/or for sharing and/or selling their productions, however it is a radical idea to think an artist is not necessary anymore, that is similiar to say human beings are not necessary only because machines have improved. Letter c also applies to the question for all improvements made in art and art forms after all improvements made in technology and tools for technologies development. And, letter d also applies because computers may be used for studying and/or working, which is the perfect tool for a workplace, and this is why it has become essential in many organizations, companies, subsidiaries, agencies, schools, and more.

3 0
3 years ago
What stylistic device does Reverend Jesse Jackson use in the following statement: "We must relate instead of debate; we must ins
vivado [14]

Answer:

Parallelism

Explanation:

Parallelism:- It is a linguistic device.It is basically the use of components that are similar in their meaning ,sound or construction.So in the statement by Reverend Jesse Jackson .The statement uses words that sound similar and the statements have similar construction.

So we conclude that the answer is parallelism.

8 0
3 years ago
Other questions:
  • Stefan is finalizing his presentation by adding media files and preparing it for distribution. Stefan knows that saving a presen
    13·1 answer
  • What is the role of the constructor for an object?
    5·1 answer
  • Which is a credit card balance A. The amount of interest you must pay the credit card company B. The required minimum payment to
    5·1 answer
  • There are a multitude of items that Cyber Security professionals view as attack vectors but none are more prevalent and exploita
    13·1 answer
  • While creating a sketch, what helps you identify positive and negative space?
    13·1 answer
  • Short Essay on the history of Computer​
    6·2 answers
  • What is an information technology? ​
    12·2 answers
  • Submit your business presentation that clearly compares and contrasts three different cell phone service plans..
    14·2 answers
  • [If you were the queen of the world .... What would you change ?]
    14·1 answer
  • If you select one slice of pie in a pie chart, you have selected a ____
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!