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
If you created a variable called name, what data type would that value be? Group of answer choices a float a string a Boolean an
Semenov [28]

I think its an integer

8 0
2 years ago
Read 2 more answers
Absolute time would be most similar to :
Luda [366]
The absolute time would be most similar to a fact. It was theorised and in fact, approved by scientists as a scientific law which governs, according to Wikipedia, as a "<span>true and mathematical </span>time<span>, of itself, and from its own nature flows equably without regard to anything external, and by another name is called duration: relative, apparent and common </span><span>time."</span>
3 0
3 years ago
What is an embedded system. Give examples
IRINA_888 [86]

Answer:

An embedded system is a part of a larger system which has either one or a limited number of dedicated functions.

It doesn't require much power to run and is cheap to make and design.

Explanation:

Examples include: cars, microwaves, traffic lights, washing machines, phones etc

6 0
3 years ago
Which Application program saves data automatically as it is entered?
Andrei [34K]
The application program that saves data automatically as it is entered is the MS Access.
4 0
2 years ago
Something which has a special meaning in a python programming language is termed as what?
Elis [28]

Answer:

Explanation:

A Dutch programmer named Guido van Rossum made Python in 1991.This also means Python is slower than a compiled language like C, because it to avoid changing the language to make it better until they have a lot of things to change.

Python is an interpreted, high-level and general-purpose programming language. Created by  This compact modularity has made it particularly popular as a means of  a rough transcription from another programming language is called unpythonic. It has fewer syntactic exceptions and special cases than C or Pascal.

plz mark as brainliest

6 0
3 years ago
Other questions:
  • Questions 6 - 9 Refer to the following code: public class WhatsIt { private int[] values; private double average; public WhatsIt
    7·1 answer
  • A(n) _____ is the highest educational degree available at a community college. master bachelor associate specialist
    13·2 answers
  • Formatting. Given input that represents a floating point number, that is, made up of digits and at least one decimal point, conv
    15·1 answer
  • The while loop is a pre-test loop? TRUE OR FALSE
    9·2 answers
  • A chef writing up her famed recipe for beef stew realizes she has switched parsley and oregano everywhere in the recipe. The che
    13·1 answer
  • Hurry please
    12·1 answer
  • How do i find the greatest common factor of two numbers?
    14·1 answer
  • I need a pro help so no newbies just pro's thank you. I need help I has bean trying to help out with the scams links by putting
    10·1 answer
  • Why is it important to put the most specific case first? What types of errors does it help avoid?
    11·1 answer
  • Because of increasing advances in technology, there are careers available that weren’t even invented 10 years ago. One such care
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!