Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Python following: - if the value typed in is a 1 or a 2 then increment yesCount and print out YES WAS RECORDED -
Use Python
following: - if the value typed in is a 1 or a 2 then increment yesCount and print out "YES WAS RECORDED" - if the value typed in is a 3 or an 4 then increment noCount and print out "NO WAS RECORDED" If the input is invalid just print the message "INVALID" and do nothing else. 14of14:2023-02-0515:07:36-W 1 response == stdin. nextInt (); 2 switch (response) \{ 3 case 1 : 4 yesCount++; 5 System. out. print ("YES WAS RECORDED"); 6 break; 7 case 2: 8 yesCount++; 9 System. out. print ("YES WAS RECORDED"); 10 break; 11 case 3 : 12 noCount++; 13 System. out. print ("NO WAS RECORDED"); 14 break; 15 case 4: 16 noCount++; 17 System. out. print ("NO WAS RECORDED"); 18 break; 19 20 if default: System. out. print("INVALID")Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started