Question: 14. The following program attempts to print a message containing the English word corresponding to a given integer input, For example, if the user enters
14. The following program attempts to print a message containing the English word corresponding to a given integer input, For example, if the user enters the value 3, the program should print "You entered a three". In its current state, the program contains logic errors. Locate the problems and repair them so the program will work as expected. i) Hinclude 15:"; int value; std:tcin value; I/ Translate number into its English word if (month =1 ) std: : cout "You entered a; std: : cout "one"; std: : cout " ln '; else if (month =2 ) std: : cout "You entered a"; std: :cout "two"; std: icout ' In'; else if (month =3 ) std:icout "You entered a"; std: : cout "three"; std: icout 1n; else if (month =4 ) std: fcout "You entered a"; stditcout "four"; std: :cout " ln "; else if (month =5 ) std:tcout "You entered a"; std: icout "five"; std: : cout 'In'; else II value out of range std:; cout "You entered a"; std: icout "value out of range"; std:t:cout n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
