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
Which would you use to get the number of elements in a dictionary?
Vikentia [17]

The function use to get the number of element in a dictionary is len.

<h3>What is a dictionary?</h3>

Dictionaries are used to store data values in key-value pairs. Dictionary are ordered.

Dictionary in python are express as follows:

my_dict = {"name": "Michael", "age": 28, "school": "Oxford"}

Therefore, the length of the element of the dictionary can be gotten using the len() function.

Hence,

print(len(my_dict)) will give you the length of the element.

learn more on dictionary here: brainly.com/question/14120893

#SPJ11

8 0
2 years ago
Which of these statements is true?
olchik [2.2K]

Answer:

thanks for points ☺

Explanation:

TRB Special Report 263 - Future Flight: A Review of the Small Aircraft Transportation System Concept reviews the plausibility and desirability of the SATS concept, giving special consideration to whether its potential net benefits--from user benefits to overall environmental and safety effects--are sufficiently promising to warrant public-sector investment in SATS development and deployment.

The Small Aircraft Transportation System (SATS) program has been established by the Office of Aerospace Technology in the National Aeronautics and Space Administration (NASA). In the initial 5-year phase of the program, NASA is working with the private sector and university researchers, as well as other federal and state governmental agencies, to further various aircraft-based technologies that will increase the safety and utility of operations at small airports, allow more dependable use of small airports, and improve the ability of single-piloted aircraft to operate safely in complex airspace. Guiding this program is a longer-range SATS vision of the routine use of advanced, small fixed-wing aircraft for personal transportation between communities.

The Small Aircraft Transportation System (SATS) is envisioned as relying on increasingly sophisticated and affordable small aircraft flying between small airports in lightly used airspace. The system was proposed to provide a growing share of the nation’s intercity personal and business travel. The development of such a system was considered to be justified by the potential to ease congestion in the existing aviation system and on highways serving densely traveled intercity markets. Without attempting to prejudge how advances in general aviation technology might evolve and affect travel markets, the committee that examined the SATS concept concluded that the concept is problematic in several ways as a vision to guide NASA’s technology development. Although the cost of small jet engines developed in partnership with NASA could drop dramatically, small jets would still be well beyond the means of all but the wealthiest members of society. The aircraft might be adopted by firms offering air taxi service, but the cost of such service would likely remain steep; therefore, sufficient market penetration to relieve congestion at hub airports would be unlikely. Moreover, the origins and destinations of most business travelers are major population centers, making travel to and from remote general aviation airports unappealing. The cost to upgrade such airports would be substantial as well, even assuming that SATS aircraft would have onboard technologies that would reduce the need for airport radars, precision landing guides, and air traffic control. The environmental consequences could also be substantial—particularly an increase in aircraft noise in rural areas unaccustomed to such intrusions. Perhaps the most difficult issues to address would be public concerns about safety. Finally, the use of SATS aircraft in and around major metropolitan areas would complicate an already overstressed air traffic control system, and the human factors issues of increased automation for relatively inexperienced pilots are far from being resolved.

For all of the above reasons, the committee did not endorse the SATS concept as a guide for NASA R&D. The committee noted, however, that NASA’s support for ongoing technology development in general aviation is welcome and needed. General aviation has a much worse safety record than commercial aviation. The committee recommended that NASA work with other federal agencies, such as USDOT, the Federal Aviation Administration, and the National Transportation Safety Board in defining and pursuing opportunities to advance and improve general aviation.

4 0
3 years ago
Suppose that a client performs an intermixed sequence of (queue) enqueue and dequeue operations. The enqueue operations put the
Ivanshal [37]

Answer:

b,c and d can't occur.

Explanation:

Queues always preserve sequence.

8 0
4 years ago
Refer to the image of the Cornell method, then use the drop-down menus to complete each statement. Number 1 should be . Number 2
kifflom [539]

Answer:

e

Explanation:

6 0
3 years ago
Read 2 more answers
Your laptop doesn���t have a serial port. what type of connector will your laptop require?
hodyreva [135]
Order a disk to program the lap top to use Wi-Fi
6 0
4 years ago
Read 2 more answers
Other questions:
  • While configuring a new 802.11g wireless network, you discover another wireless network within range that uses the same channel
    13·1 answer
  • Find Multiplication of Binary Numbers: 1100112 x 10012
    9·1 answer
  • Patrick Stafford's article argues that the growth of mobile phone usage "has given developers the ability to great robust and en
    7·1 answer
  • Given the following characteristics for a magnetic disk pack with 10 platters yielding 18 recordable surfaces (not using the top
    14·1 answer
  • On a camera,what does focus tracking do?
    6·1 answer
  • Is it important for a writer to include voice and point of view in writing because... Plz help
    15·1 answer
  • Janice usually works on a particular workbook. She decides to keep a backup of all the data in a separate workbook. She opens a
    6·2 answers
  • What is the 5 basic steps of computer programing?
    6·1 answer
  • All computer systems have
    14·2 answers
  • Write a program that reads a book (a file in text format), breaks each line into words, strips whitespace and punctuation from t
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!