Ask Question
13 September, 11: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!

+4
Answers (1)
  1. 13 September, 14:00
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers