![]() You don't have any methods defined but you need to know the convention. So, in your code: playeranswer becomes playerAnswer, and so on. Net convention is to use PascalCase for methods and classes and the like, and camelCase for variables. I think it is better to have declaration and assignment in one line, it is terser and more readable: ( int numofquestions = Convert.ToInt32(Console.ReadLine()) ). So it is better to declare then inside the loop (or you might accidentally use them outside or simply crowd your intellisense).Īlso, for some variables you're splitting declaration ( int numofquestions ) and assignment ( numofquestions = Convert.ToInt32(Console.ReadLine()) ), and for other you're not. But as your application gets bigger and better you don't want too many variables in scope.įrom your code: num01, num02, playeranswer, and answer are only used within the loop. This is to decrease variable pollution in bigger functions. While it might be more performance friendly to declare all variables from the outset, it is best practice, I think, to declare variables only within the scope they're used. I got some comments, some of which are my personal opinion (for example how to declare variables), some are accepted conventions (naming), and some are bug fixes. ![]() Letting the user know how many answers they got right.Ĭonsole.WriteLine("You got " + numofcorrect + " of " + numofquestions + " correct!") ![]() Playeranswer = Convert.ToInt32(Console.ReadLine()) Ĭonsole.WriteLine(playeranswer + " is correct!") Ĭonsole.WriteLine(playeranswer + " is incorrect! Try again.") Answering a question correctly increases your score.Ĭonsole.Write("What is " + num01 + " times " + num02 + "? ") This is the loop which handles the actual question/answer core of the game. ![]() int timer = 30 I considered a timer function but that ended up being way over my head.Ĭonsole.Write("How many questions would you like to answer? ") It does work as intended, and I'm really just fishing for someone to yell at me for doing something glaringly bad practice in the code below. If you face any issues or have any questions, please comment below.I am only a beginner when it comes to programming, but after reading tons of tutorials on and offline, I have been able to create this simple math quiz. Hope this guide helps you to enjoy 123 Simple Math Quiz Free on your Windows PC or Mac Laptop. Double-click the app icon to open and use the 123 Simple Math Quiz Free in your favorite Windows PC or Mac. Once the installation is over, you will find the 123 Simple Math Quiz Free app under the "Apps" menu of Memuplay.Always make sure you download the official app only by verifying the developer's name. Now you can search Google Play store for 123 Simple Math Quiz Free app using the search bar at the top.On the home screen, double-click the Playstore icon to open it. Memuplay also comes with Google play store pre-installed.Just be patient until it completely loads and available. It may take some time to load for the first time. Once the installation is complete, open the Memuplay software.Click it and it will start the download based on your OS. Once you open the website, you will find a big "Download" button.Open Memuplay website by clicking this link - Download Memuplay Emulator.Double-click the app icon to open and use the 123 Simple Math Quiz Free in your favorite Windows PC or Mac.ġ23 Simple Math Quiz Free Download for PC Windows 7/8/10 – Method 2: Once the installation is over, you will find the 123 Simple Math Quiz Free app under the "Apps" menu of BlueStacks.Click "Install" to get it installed. Always make sure you download the official app only by verifying the developer's name. BlueStacks comes with Google play store pre-installed.You will see the home screen of Bluestacks. Once the installation is complete, open the BlueStacks software.Installation is as simple and easy as any other software installation. After the download is complete, please install it by double-clicking it.Once you open the website, you will find a green color "Download BlueStacks" button.Open BlueStacks website by clicking this link - Download BlueStacks (Recommended □).
0 Comments
Leave a Reply. |