Question: Question 1 (75 Points) Write a script that prompts the user to answer the question, On what day of the week were you born and

Question 1 (75 Points) Write a script that prompts the user to answer the question, On what day of the week were you born and in what year? Format example: "Wednesday 1992". The user's input is read into a character variable called givena. Check that the user entered a valid answer If the user didn't enter anything or their answer was not long enough, print an error message telling them they did not answer the question. If the user's answer was not formatted correctly, send an error message telling them their input was invalid. The following conditions must be met to ensure the correct format o The last four characters cannot be letters or blank spaces. o A blank space must immediately precede the last four characters. o All other characters must be letters. Otherwise, use fprintf to tell the user what age they will turn this year Write the script using a single if statement (else and elseif clauses are permitted) Note: For publishing purposes, comment out the "input" line and manually assign the value for givena
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
