Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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