Ask Question
15 October, 10:31

What is the output of the following code snippet?

int golfScore = 64;

if (golfScore < 60)

{

System. out. println ("Astounding!");

}

if (golfScore > = 60 && golfScore < 70)

{

System. out. println ("Professional!");

}

if (golfScore > = 70 && golfScore < 80)

{

System. out. println ("Pretty good!");

}

if (golfScore > = 80 && golfScore < 90)

{

System. out. println ("Not so hot!");

}

if (golfScore > = 90)

{

System. out. println ("Keep your day job!");

}

Astounding!

Professional!

Pretty good!

Keep your day job!

+5
Answers (1)
  1. 15 October, 13:37
    0
    The output of the following code snippet is Professional

    Explanation:

    Depending on the golfScore, the program outputs something.

    If it is lesser than 60, the output is Astouding

    If it is between 60 and 69, the output is Professional

    If it is between 70 and 79, the output is Pretty good

    If it is between 80 and 89, the output is Not so Hot

    If it is 90 or higher, the output is Keep your day job.

    In this program, the variable golfScore is initialized as 64. This is between 60 and 69, so the output is Professional.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is the output of the following code snippet? int golfScore = 64; if (golfScore < 60) { System. out. println ("Astounding!"); } if ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers