If the keyboard input is 15, what is the value of score after this code executes? Scanner sc = new Scanner(System.in); int score = 80; System.out.print("Enter a score value: "); int input = sc.nextInt(); if (input < 10) { score = 50; } else if (input >= 10 && input <= 20) { score = 60; } else { score = 70; } score = score + 5; System.out.println("Final Score: \t" + score);Single choice
A
65
B
60
C
50
D
70
Log in for full answers
We've collected over 50,000 authentic original questions and detailed explanations from around the globe. Log in now and get instant access to the answers!
Similar Questions
If the input is 5, what is the output? int x; cin >> x; if (x < 10) { cout << "Live "; } else if (x < 20) { cout << "long "; } else if (x < 30) { cout << "and "; } cout << "prosper!";
What gets printed to the console if the user enters 'Metal':
For the given program, how many cout statements will execute? void PrintShippingCharge(double itemWeight) { if ((itemWeight > 0.0) && (itemWeight <= 10.0)) { cout << (itemWeight * 0.75) << endl; } else if ((itemWeight > 10.0) && (itemWeight <= 15.0)) { cout << (itemWeight * 0.85) << endl; } else if ((itemWeight > 15.0) && (itemWeight <= 20.0)) { cout << (itemWeight * 0.95)<< endl; } } int main() { PrintShippingCharge(18); PrintShippingCharge(6); PrintShippingCharge(25); return 0; }
If the value 50 was input as Score what would be the output of the above program?
More Practical Tools for Students Powered by AI Study Helper
Making Your Study Simpler
Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!