Write a program that prompts the User for if they would like to enter a real number. If yes, prompt the User for the real number. Continue to do this until the User enters “no” to the first question. After the User enters “no”, display the average of all the numbers entered.
This is what I have so far. I am confused and I need help. How do I keep asking a question for a string and keep repeating this process? Then how do I store all the numbers entered so I can find the mean?
Q=input('Would you like to enter a real number? (Yes or No) ','s');switch Q case 'Yes' n=input('Enter a number: '); Q=input('Would you like to enter a real number? (Yes or No) ','s'); while Q~= 'No' n=input('Enter a number: '); end case 'No' mean(,)end
Best Answer