Question: Write a script that prompts the user to enter the radius of a circle with units. For example, the user might enter 3.45 cm or

 Write a script that prompts the user to enter the radius

Write a script that prompts the user to enter the radius of a circle with units. For example, the user might enter "3.45 cm" or "5 inches". 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 (their answer should be at least three characters), 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 . There must be one, and only one. blank space in givena. . No characters before the blank space may be a letter . All characters after the blank space must be letters. . Otherwise, use fprintf to print a descriptive message stating the radius of the circle with units, as specified by the user Write the script using a single if statement else and elseif clauses are permitted). 30 Points Question Bonus: If the user ntered a valid radius format, then also print e area of the circle, to two decimal places ith units, to the Command Windovw Write a script that prompts the user to enter the radius of a circle with units. For example, the user might enter "3.45 cm" or "5 inches". 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 (their answer should be at least three characters), 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 . There must be one, and only one. blank space in givena. . No characters before the blank space may be a letter . All characters after the blank space must be letters. . Otherwise, use fprintf to print a descriptive message stating the radius of the circle with units, as specified by the user Write the script using a single if statement else and elseif clauses are permitted). 30 Points Question Bonus: If the user ntered a valid radius format, then also print e area of the circle, to two decimal places ith units, to the Command Windovw

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!