Question: 1. Given a int variable named yesCount and another int variable named noCount and a char variable named response, write the necessary code to read
1. Given a int variable named yesCount and another int variable named noCount and a char variable named response, write the necessary code to read a value into into response and then carry out the following:
if the character typed in is a y or a Y then increment yesCount and print out "YES WAS RECORDED"
if the character typed in is an n or an N then increment noCount and print out "NO WAS RECORDED"
If the input is invalid just print the message "INVALID" and do nothing else.
2. HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. Some of the codes and their meanings are listed below:
200, OK (fulfilled)
403, forbidden
404, not found
500, server error
Given an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
(IN C LANGUAGE)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
