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
arlik [135]
3 years ago
12

For the given program, how many print statements will execute? public static void printShippingCharge(double weight) { if((weigh

t > 0.0) && (weight <= 10.0)){ System.out.println(weight * 0.75); } else if((weight > 10.0) && (weight <= 15.0)) { System.out.println(itemWeight * 0.85); } else if((weight > 15.0) && (weight <= 20.0)) { System.out.println(itemWeight * 0.95); } } public static void main(String args[]) { printShippingCharge(18); printShippingCharge(6); printShippingCharge(25); }
Computers and Technology
1 answer:
Step2247 [10]3 years ago
4 0

CORRECT QUESTION:

For the given program, how many print statements will execute?

public static void printShippingCharge(double weight) { if((weight > 0.0) && (weight <= 10.0)){ System.out.println(weight * 0.75); }

else if((weight > 10.0) && (weight <= 15.0)) { System.out.println(weight * 0.85); }

else if((weight > 15.0) && (weight <= 20.0)) { System.out.println(weight * 0.95); } }

public static void main(String args[]) {

printShippingCharge(18);

printShippingCharge(6);

printShippingCharge(25); }

Answer:

Two of the print statements will output values

Explanation:

These two calls to the printShippingCharge are the ones that will output values: printShippingCharge(18); and printShippingCharge(6);

The first if statement is true when the value of weight is 6 (weight > 0.0) && (weight <= 10.0)

The Third if statement  is true when weight is 18 (weight > 15.0) && (weight <= 20.0)

NOTE: That I made correction to the variable weight. The question isn't consistent with the variable name. It used weight and itemWeight at different points this will lead to a compiller error

You might be interested in
Canadian Tire is one of Canada’s largest companies. They operate four large distribution centers service over 470 tire retail ou
olganol [36]

Answer: Provided in the explanation section

Explanation:

A YMS acts an interface between a WMS and TMS.The evaluation system with the key performance indicators are mentioned in the table below.

NOTE: The analysis follows in this order given below

  • Metric
  • Description
  • Comments

Metric 1

<u>Trailer utilization</u>

Description :This captures the status of the trailer whether it is in the yard or is in transit

Comments : Helps in measuring the trailer productivity on a daily ,weekly or monthly basis

Metric 2

<u>Driver utilization</u>

Description : This captures the status of the driver whether the driver is in the yard or is in transit

Comments : Helps in measuring the driver productivity on a periodic basis

Metric 3

<u>Trailer sequence</u>

Description : This captures the order of movement of trailers in the yard on a given day, week or month

Comments : Helps in measuring the order fulfilment efficiency i.e. whether the priority orders have been serviced first or not

Metric 4

<u>Total time in yard</u>

Description : This captures the time spent by the trailer in the yard from the time it enters and leaves the yard

Comments : This helps in measuring the time taken to fulfill a particular request

⇒ Capturing these metrics need inputs from both WMS and TMS, and also the trailers need to have RFID tags attached to them.Then compare these performance metrics with the ones prior to the deployment of YMS to identify the percent gains in the overall operational productivity.

cheers i hope this helped !!

8 0
2 years ago
Which type of keyboard improves accuracy and reduces the strain on the wrists?
klasskru [66]
That would be an Ergonomic keyboard, due to the fact that it is laid out in such a way that doesn't harm your wrists
4 0
2 years ago
Read 2 more answers
What will be the output of the following program? Assume the user responds with a 5.
FrozenT [24]

The output will be: You owe $ 15.0

4 0
3 years ago
Company Wizzy is having trouble with network security. Issues with authentication, viruses, malware/spyware, and other network i
Darya [45]

Answer:

B) security as a service I'm just doing the work

4 0
3 years ago
You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
n200080 [17]
The answer is b. java Hi.class :)
8 0
2 years ago
Other questions:
  • A plan that outlines the steps and timeline for reaching a certain goal is called a(n):
    13·1 answer
  • Which key must you press after you write into a cell?
    12·1 answer
  • Which of the following jobs is considered part of the information technology industry?
    15·2 answers
  • "What is the database in which Windows stores all information about hardware, applications, users and system settings?"
    8·1 answer
  • I need help<br> plsssssssss
    10·1 answer
  • Question 5 of 25
    10·2 answers
  • Which common online presentation medium do people use to present their own articles?
    8·2 answers
  • Define CPU and its functions​
    7·2 answers
  • Print("Weight on Earth?")
    13·1 answer
  • Select the correct answer.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!