Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (anonymous):

I need help with a c++ assignment plz comment if you can help

OpenStudy (anonymous):

Do you have a specific question?

OpenStudy (anonymous):

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

OpenStudy (anonymous):

I'm not sure I get the \( + - \times \div \) thing. can you explain how does it work?

OpenStudy (anonymous):

like its four diferent quizes using +-x÷

OpenStudy (anonymous):

can you give me an example to a question in the quiz?

OpenStudy (anonymous):

like 2+2...

OpenStudy (anonymous):

Ok, I'm asking that because the exact nature of the questions is essential in order to generate them

OpenStudy (anonymous):

oh.. but my nubers are randomily generated 0 -20

OpenStudy (anonymous):

Is it always 2 numbers and one operation?

OpenStudy (anonymous):

CORRECT! its ment for a second grader

OpenStudy (anonymous):

Ok, just one more question, what do you mean by 'fully error trapped'?

OpenStudy (anonymous):

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

OpenStudy (anonymous):

Ok I see. So where are you stuck at?

OpenStudy (anonymous):

the whole thing lol

OpenStudy (anonymous):

Ok, what have you learned so far in C++?

OpenStudy (anonymous):

while and do while loops

OpenStudy (anonymous):

No classes yet, right? What about functions?

OpenStudy (anonymous):

Oh, and for loops, what about those? have you learned?

OpenStudy (anonymous):

yea

OpenStudy (anonymous):

So you know classes, functions and for loops as well?

OpenStudy (anonymous):

YEA

OpenStudy (anonymous):

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?

OpenStudy (anonymous):

OHK

OpenStudy (anonymous):

We will have to use virtual methods for this, do you know those?

OpenStudy (anonymous):

NOPE

OpenStudy (anonymous):

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

OpenStudy (anonymous):

If you're not familiar with polymorphism at all then I can find a short video explaining it =)

OpenStudy (anonymous):

ohk

OpenStudy (anonymous):

Ok give me a moment

OpenStudy (anonymous):

Give this a shot: https://www.youtube.com/watch?v=R_PPA9eejDw

OpenStudy (anonymous):

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

OpenStudy (alyssa_xo):

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

OpenStudy (anonymous):

thank you makes more sense!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!