subject

What is wrong with the following switch statement? int ans; system. out. print("type y for yes or n for no"); ans = scan. nextint(); switch (ans) { case 'y': case 'y': system. out. println("you said yes"); break; case 'n': case 'n': system. out. println("you said no"); break; default: system. out. println("invalid answer"); }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
These tools give presenters more freedom to move about the room and interact with their audience. laptop computer laser pointer lcd projector remote control
Answers: 2
question
Computers and Technology, 22.06.2019 15:20
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a,b] se pot scrie ca produs de două numere prime? “.
Answers: 3
question
Computers and Technology, 24.06.2019 04:30
How do you share someone else’s tweet with your own twitter followers?
Answers: 1
You know the right answer?
What is wrong with the following switch statement? int ans; system. out. print("type y for yes or...
Questions
question
History, 06.10.2019 20:40
question
Physics, 06.10.2019 20:40
Questions on the website: 13722359