answer.
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]
1 year 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]1 year 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]1 year 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
Generating a signature with RSA alone on a long message would be too slow (presumably using cipher block chaining). Suppose we c
boyakko [2]

Answer:

Following are the algorithm to this question:

Explanation:

In the RSA algorithm can be defined as follows:  

In this algorithm, we select two separate prime numbers that are the "P and Q", To protection purposes, both p and q combines are supposed to become dynamically chosen but must be similar in scale but 'unique in length' so render it easier to influence. Its value can be found by the main analysis effectively.  

Computing N = PQ.  

In this, N can be used for key pair, that is public and private together as the unit and the Length was its key length, normally is spoken bits. Measure,

\lambda (N) = \ lcm( \lambda  (P), \lambda (Q)) = \ lcm(P- 1, Q - 1)  where \lambda is the total function of Carmichaels. It is a privately held value. Selecting the integer E to be relatively prime from 1and gcd(E,  \lambda (N) ) = 1; that is E \ \ and  \ \ \lambda (N).  D was its complex number equivalent to E (modulo \lambda (N) ); that is d was its design multiplicative equivalent of E-1.  

It's more evident as a fix for d provided of DE ≡ 1 (modulo \lambda (N) ).E with an automatic warning latitude or little mass of bigging contribute most frequently to 216 + 1 = 65,537 more qualified encrypted data.

In some situations it's was shown that far lower E values (such as 3) are less stable.  

E is eligible as a supporter of the public key.  

D is retained as the personal supporter of its key.  

Its digital signature was its module N and the assistance for the community (or authentication). Its secret key includes that modulus N and coded (or decoding) sponsor D, that must be kept private. P, Q, and \lambda (N) will also be confined as they can be used in measuring D. The Euler totient operates \varphi (N) = (P-1)(Q - 1) however, could even, as mentioned throughout the initial RSA paper, have been used to compute the private exponent D rather than λ(N).

It applies because \varphi (N), which can always be split into  \lambda (N), and thus any D satisfying DE ≡ 1, it can also satisfy (mod  \lambda (N)). It works because \varphi (N), will always be divided by \varphi (N),. That d issue, in this case, measurement provides a result which is larger than necessary (i.e. D >   \lambda (N) ) for time - to - time). Many RSA frameworks assume notation are generated either by methodology, however, some concepts like fips, 186-4, may demand that D<   \lambda (N). if they use a private follower D, rather than by streamlined decoding method mostly based on a china rest theorem. Every sensitive "over-sized" exponential which does not cooperate may always be reduced to a shorter corresponding exponential by modulo  \lambda (N).

As there are common threads (P− 1) and (Q – 1) which are present throughout the N-1 = PQ-1 = (P -1)(Q - 1)+ (P-1) + (Q- 1)), it's also possible, if there are any, for all the common factors (P -1) \ \ \ and \ \ (Q - 1)to become very small, if necessary.  

Indication: Its original writers of RSA articles conduct their main age range by choosing E as a modular D-reverse (module \varphi (N)) multiplying. Because a low value (e.g. 65,537) is beneficial for E to improve the testing purpose, existing RSA implementation, such as PKCS#1, rather use E and compute D.

8 0
2 years ago
1. What might you say to someone whose reason for investing in 90% bonds and 10% stocks is that they want a 6% return on investm
Gemiola [76]

Investing in 90% bonds and 10% stocks will provide an average return of 6% on investment.It is advisable to invest more portion in bonds  is safe and will give higher return for investment than stocks

Explanation:

1. According to the graph investing in 90% bonds and 10% stocks will provide an average return of 6% on investment.

2.Investing in bonds is safe than stocks ., because bonds bear fixed rate of interest ., and investing in the bonds having very less risk than the stocks. By comparing stocks and bonds with the help of graph ., it's very clear bonds has a positive growth starting minimum at 32.6% to maximum at 64.2% as returns .But stocks has a negative growth (value) from -8.2% to maximum -43.1% .,It is advisable to invest more portions in bonds is safe and better than invest in stocks.

5 0
2 years ago
Write the execution steps if the input is a lion.
balandron [24]

Explanation:

Execution step:

1. Starting the program

2. It will get the animal name

3. Check whether the animal eats only plants. Then it prints "Herbivore". If the condition is false, it prints "carnivore".

4. Stop the program

To identify input, output and decision:

Start and Stop (oval): These are neither input nor output

Does it eat only plants?: Decision making statement ("d")

Read the names of the animals(Parallelogram): Input ("i")

Print Herbivore, Print Carnivore: Output "o"

Scenario 1: Input is lion

1. Start

2. Reads the input as "lion"

3. Check if lion eats only plants. So here it is false

4. Print "Carnivore"

5. Stop

Scenario 1: Input is Elephant

1. Start

2. Reads the input as "Elephant"

3. Check if lion eats only plants. So here it is true

4. Print "Herbivore"

5. Stop

7 0
2 years ago
You are a technical consultant for many businesses in your community. One of your clients, a small law firm, has a single Active
stellarik [79]

COMPLETE QUESTION:

You are a technical consultant for many businesses in your community. One of your clients, a small law firm, has a single Active Directory domain. They have two servers running Windows Server 2012 R2. Both servers are configured as domain controllers while also serving as file and printer servers.This client is calling you on a regular basis because users are deleting or damaging their files. You must visit the client's site and restore the files from backup. Your client has asked you to create an alternate solution. What should you do?

Answer:

Use the Windows VSS to create shadow copies on important data

Explanation:

Volume Snapshot Service (VSS) is a service available to Windows Operating Systems which allows safe backup of open files as well as locked ones. It does this by taking a snapshot the state of the drive, this snapshot information will be provided to the backup application whenever needed. It is important to mention that this service is only available on files which are in the NTFS format

8 0
2 years ago
What is the distance rn between the point of application of n⃗ and the axis of rotation? what is the distance rw between the poi
Mandarinka [93]

Complete Question.

A. Suppose that you are holding a pencil balanced on its point. If you release the pencil and it begins to fall, what will be the angular acceleration when it has an angle of 10.0 degrees from the vertical?

B. What is the distance rn between the point of application of n⃗ and the axis of rotation?

C. What is the distance rw between the point of application of w⃗ and the axis? enter your answers in meters separated by a comma?

Answer:

A. â = - 17rad/s²

B. rn = 0, meters

C. rw = 0.074, meters

Explanation:

Where;

l = length of the pencil

θ = angle between the vertical line and the pencil

â = angular acceleration.

The torque due to weight about the pivotal point is negative since it's clockwise;

t = - mg(l/2)sinØ ..... equation 1

torque with respect to angular acceleration;

t = Iâ ..... equation 2

The moment of Inertia of the pencil about one end;

I = (ml²)/3

Substituting I into equation 2;

t = [(ml²)/3]×â

Equating the equation, we have;

[(ml²)/3]×â = - mg(l/2)sinØ

â = (-3gsinØ)/2l

â = (-3*9.8*sin10°)/(2*0.15)

Angular acceleration, â = -17rad/s²

B. The normal force is acting at the normal force only, so the distance r n between the point of application of n ⃗ and the axis of rotation is zero because the axis of pencil is passing the same point of application w.

C. rn = (lcosØ)/2

rn = (0.15 * cos10°)/2

rn = (0.15 * 0.9848)/2

rn = (0.1477)/2

rn = 0.074m.

Since the gravity acts at exactly half of the length of pencil, distance r w between the point of application of w⃗ and the axis equals 0.074m.

8 0
2 years ago
Other questions:
  • Brake lights on freeways invite A: law enforcement B: panic C: sudden lane changing D: both B and C E: positive driving habits
    13·1 answer
  • When performing actions between your computer and one that is infected with a virus which of the following offers no risk becomi
    5·1 answer
  • Which command suppresses the visibility of a particular Row or column in a worksheet?
    9·1 answer
  • QUESTION 2 of 10: New shoes are on SALE. You find a pair you like for $85 dollars. But you only have $45 with you. So, you pay $
    13·1 answer
  • Why is the following statement true - ideally, your information is abbreviated
    10·2 answers
  • 15) The codes for class Hotel has been defined in two separate files Hotel.h, and Hotel.cpp. Which of the following statements i
    12·1 answer
  • Initialize the list short_names with strings 'Gus', 'Bob', and 'Zoe'. Sample output for the given program:
    9·1 answer
  • Suppose that a class named ClassA contains a private nonstatic integer named b, a public nonstatic integer named c, and a public
    14·1 answer
  • A school principal trying to find out if parents will help buy new playground equipment shows digital leadership by.
    8·2 answers
  • A data scientist is writing a Machine Learning (ML) algorithm using a large data set.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!