This assignment asks you to implement a guessing game as

This assignment asks you to implement a guessing game as a C++ program. For this you need to familiarize yourself with variables, ifs (nested and multiple ifs), random numbers, and loops. The program should do the following: Print a welcome message • Repeat the following until the game is over indicated by user entering ‘Q’ or ‘q”. o Select a random number between 1 and 20. Ask the user to input a number between 1 and 20. o Check if the user input is equal to the generated random number. If they are equal then the user has won. Print appropriate message. If they are not equal then give the user a hint as to whether the user’s entered number is greater or less than the random number and provide two more turns to the user giving the hint at each turn. (Total number of tries at guessing the generated random number is three (3)) (a) Write pseudocode for your program. Exercise 2 [Find & Generate] (8 marks) Please answer the following: 1. (2 marks) Which variables do you need? 2. (2 marks) Which variables do you use for input? 3. (2 marks) Which types do you use for which variable. Explain why? 4. (2 marks) What type of loop is best to validate the input? What is the loop condition? Exercise 3 [Evaluate & Reflect] (10 marks) Please describe at least three test cases that will allow you to assess whether the program is correct. Which inputs should you choose, and what outputs would you expect? Answer in less than 300 words. Does your program actually satisfy those test cases?

 

Leave a Comment

Your email address will not be published. Required fields are marked *

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top