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
package dataStructures; /** * Class OrderedLinkedList. * * This class functions as a linked list, but ensures items are stored i
valkas [14]

Answer:

?

Explanation:

8 0
3 years ago
What is the command to create a compressed archive(archive1.tar.gz) of files test1 test2and test3.
yulyashka [42]

Answer:

The command to create a compressed archive (archive1.tar.gz) is

tar\,\,-czvf\,\,archive1.tar.gz\,\,test1\,\,test2\,\,test3

Explanation:

The explanation for the above command is

The general command to create a compressed archive is

tar -czvf name-of-archive.tar.gz /path/to/directory-or-files

Here, the terms are as follows:

-c : Creates an archive

-z : Compress the archive with gzip.

-v : This is known as verbose. This is an optional command and it displays the progress on terminal command. Without this the progress is not displayed on terminal command.

-f : Allows to specify the file name of the archive.

Here, if we want to archive multiple files, we provide the command the names of multiple files or directories of the files also can be used.

So, the command tar\,\,-czvf\,\,archive1.tar.gz\,\,test1\,\,test2\,\,test3

creates a compressed archive  - archive1.tar.gz of files test1, test2 and test3.

 

7 0
3 years ago
Definition of digital
OLga [1]

Answer:

There are two definitions from

Explanation:

1.) (of signals or data) expressed as series of the digits 0 and 1, typically represented by values of a physical quantity such as voltage or magnetic polarization.

2.) (of a clock or watch) showing the time by means of displayed digits rather than hands or a pointer.

I'm not sure if you meant "Digit". But if you did it would mean numbers or the places where numbers would go.

Hope this helps! (If not so sorry)

4 0
3 years ago
Read 2 more answers
????????????helpppp please
Luden [163]

Answer:

I lab u pre haha jok

ano ka gold

3 0
2 years ago
Any part of the computer that you can touch is called ________.
Mars2501 [29]
Hardware is the answer.

Software is not really tangible
Operating system is software
Input is not truly 'physical'
7 0
3 years ago
Other questions:
  • An essential skill today is knowing how to cite sources properly. Creative Commons has a system of licenses and tools for creato
    11·1 answer
  • Consider two sets S1 and S2 of size 3 and 2 each.
    13·1 answer
  • You manage an NLB cluster composed of three servers: Server1, Server2 and Server3. Your maintenance schedule indicates that Serv
    15·1 answer
  • How I to turn this ''loop while'' in ''loop for''? var i = 0; while (i &lt; 20) { var lineY = 20 + (i * 20); line(0, lineY, 400,
    11·1 answer
  • The process of combining rows and columns in a table is called _____.
    8·1 answer
  • Which of the following will increase the level of security for personal and confidential information on a mobile device if the d
    14·1 answer
  • One key feature of malware is that it:
    13·1 answer
  • 24 POINTS!!! <br> Why are Sequences, Selection, and Iteration building blocks of algorithms?
    5·1 answer
  • You want a cable that could be used as a bus segment for your office network. The cable should also be able to support up to 100
    5·1 answer
  • Write a program that gets three input characters which are user's initials and displays them in a welcoming message. Then gets i
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!