Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please assist on how to tackle this one. its an application that simulates a simple guessing game similar to playing Lotto. The user

Can you please assist on how to tackle this one. its an application that simulates a simple guessing game similar to playing Lotto. The user

guesses six unique numbers between 1 and 39. The program (Lotto machine) also generates six

unique random numbers in the same range. The program compares the user's guess to the

set of random numbers generated and displays a score. The score says how many of the user's

numbers matches that of the program.

The random numbers are generated and the score of the game is calculated by the

class GuessingGame

The data member num stores the number (e.g. 6) of random numbers to be generated for the

game, fromNum (e.g. 1) stores the starting number and toNum (e.g. 39) stores the

ending number. generateNumbers() can generate and return unique or non-unique

random numbers. The getters simply return the relevant values stored in the data members.

score() returns the number of numbers correctly guessed by the user.

Use the qrand() and qsrand() functions in Qt to generate random numbers.

Implement the main() function so that the user can enter six numbers in the range 1 - 39

in one QInputDialog (using an appropriate separator, which should be indicated in the

QInputDialog). These numbers should then be compared to the six numbers generated by

GuessingGame. Display the score to the user using a QMessageBox. Give the user a choice to

play the game again before quitting the application.

The input entered by the user should be validated so that only six unique numbers in the range

1 - 39 are accepted.

It must be in c++ using Qt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

What objectives should a marketing plan accomplish?

Answered: 1 week ago

Question

What is the approximate diameter of the human eye ?

Answered: 1 week ago

Question

The front transperant part of the sclerosis known as.....?

Answered: 1 week ago

Question

What is the refractive index of the cornea....?

Answered: 1 week ago

Question

Common defects of the eye?

Answered: 1 week ago

Question

The eye is responsible for producing tears....?

Answered: 1 week ago