This topic contains a solution. Click here to go to the answer

Author Question: Suppose you write the code to display "Cannot get a driver's license" if age is less than 16 and ... (Read 69 times)

tichca

  • Hero Member
  • *****
  • Posts: 554
Suppose you write the code to display "Cannot get a driver's license" if age is less than 16 and "Can get a driver's license" if age is greater than or equal to 16. Which of the following code is the best?

I:
if (age < 16)
System.out.println("Cannot get a driver's license");
if (age >= 16)
System.out.println("Can get a driver's license");

II:
if (age < 16)
System.out.println("Cannot get a driver's license");
else
System.out.println("Can get a driver's license");

III:
if (age < 16)
System.out.println("Cannot get a driver's license");
else if (age >= 16)
System.out.println("Can get a driver's license");

IV:
if (age < 16)
System.out.println("Cannot get a driver's license");
else if (age > 16)
System.out.println("Can get a driver's license");
else if (age == 16)
System.out.println("Can get a driver's license");

◦ I
◦ II
◦ III
◦ IV


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by tichca on May 6, 2020

underwood14

  • Sr. Member
  • ****
  • Posts: 346
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 50% of students answer this correctly




tichca

  • Member
  • Posts: 554
Reply 2 on: May 6, 2020
Thanks for the timely response, appreciate it


TheDev123

  • Member
  • Posts: 332
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

Oliver Wendell Holmes is credited with introducing the words "anesthesia" and "anesthetic" into the English language in 1846.

Did you know?

Asthma is the most common chronic childhood disease in the world. Most children who develop asthma have symptoms before they are 5 years old.

Did you know?

Urine turns bright yellow if larger than normal amounts of certain substances are consumed; one of these substances is asparagus.

Did you know?

The first oncogene was discovered in 1970 and was termed SRC (pronounced "SARK").

Did you know?

In the United States, congenital cytomegalovirus causes one child to become disabled almost every hour. CMV is the leading preventable viral cause of development disability in newborns. These disabilities include hearing or vision loss, and cerebral palsy.

For a complete list of videos, visit our video library