I need help with a c++ assignment plz comment if you can help
Do you have a specific question?
like we have to create a menu driven quiz that uses +-x÷ in whole numbers have a way to quit give them points out of number correct and fully error trapped
I'm not sure I get the \( + - \times \div \) thing. can you explain how does it work?
like its four diferent quizes using +-x÷
can you give me an example to a question in the quiz?
like 2+2...
Ok, I'm asking that because the exact nature of the questions is essential in order to generate them
oh.. but my nubers are randomily generated 0 -20
Is it always 2 numbers and one operation?
CORRECT! its ment for a second grader
Ok, just one more question, what do you mean by 'fully error trapped'?
that it is fully error trapped like if my quiz menu is only 1 thru 4 then if they enter anything esle other than 1 thru 4 it wont take the answer
Ok I see. So where are you stuck at?
the whole thing lol
Ok, what have you learned so far in C++?
while and do while loops
No classes yet, right? What about functions?
Oh, and for loops, what about those? have you learned?
yea
So you know classes, functions and for loops as well?
YEA
Ok, so let's start with a Screen abstract class, we will make child classes for specific menus, like MainScreen, QuizScreen, StatsScreen and so on We will redirect any input to those screens and they will decide what is good for them and what's not. Sounds ok?
OHK
We will have to use virtual methods for this, do you know those?
NOPE
virtual methods are a very powerful tool. they allow you to harness the power of polymorphism in your favor. For example it will allow us to get input at and pass it to the active Screen without caring what it really is, a MainScreen, QuizScreen or w/e. It may sound a little complicated at first, but the truth is that it makes things much cleaner and easier to work with
If you're not familiar with polymorphism at all then I can find a short video explaining it =)
ohk
Ok give me a moment
Bleh, I see that he gets to virtual functions only in the next video, that continues that one.. https://www.youtube.com/watch?v=DudHooleNVg
that's kinda /extra/ just have 4 functions for add/sub/mult/div generate 2 random numbers between 0-20 and a third one between 0-3 have the third number decide the operation
thank you makes more sense!
Join our real-time social learning platform and learn together with your friends!