Ask Question
4 September, 14:32

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!

+2
Answers (1)
  1. 4 September, 14:50
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers