Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m not allowed to use arrays for this program, so please DON\'T USE ARRAYS. I

ID: 440546 • Letter: I

Question

I'm not allowed to use arrays for this program, so please DON'T USE ARRAYS. I have 6 sets of numbers that need to be displayed randomly to the user in the exact order shown to the user. The sets are (8,5,8,1), (5,1,6,1), (8,7,8,2), (3,9,4,1), (9,2,5,2), (8,6,4,2). The program then needs to ask the user to enter in 3 mathematic operators out of these 4 choices (+,-,*,/). Then the program needs to take whatever the first operator was input and apply it to the first two numbers, and then the second operator to the sum or product of the first two numbers, and then so on. The purpose of the program is to enter three operators that use the set of numbers randomly displayed to obtain the number 24. A sample would look like this: (8,5,8,1) Please enter three operators to obtain the number 24 (+,-,*,/): -,*,/ 8-5=3 3*8=24 24/1=24 Congrats! You got 24 If the user doesn't get 24 an error should appear and then ask if the user wants to play again. Please help

Explanation / Answer

From your picture,http://i.imgur.com/hPwykd9.jpg?1, there is no error in the code, rather user error. The program takes one character at a time and asks for the ? operation between 2 numbers as such. Note the line before last shows you what the program read as valid input

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote