1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Olin [163]
3 years ago
9

Write a program LotheryPrinter that picks a combination in a lottery. In this lottery, players can choose 6 numbers ( possibly r

epeated) between 1 and 50. (
Computers and Technology
1 answer:
Damm [24]3 years ago
3 0

Answer:

#include <bits/stdc++.h>

using namespace std;

void LotheryPrinter(int number[])

{

   int a=1000;

   srand(time(0));//for generating different number on each program execution..

   while(a>50)

   {

       a=rand();//generating lottery number between 1 to 50...

   }

   cout<<a<<endl;//printing the lottery number..

   bool lottery=false;

   for(int i=0;i<6;i++)

   {

       if(number[i]==a)//finding that user has won the lottery or not..

       {

           cout<<"You have won the lottery"<<endl;

           lottery=true;

           break;

       }

   }

   if(!lottery)

   cout<<"Sorry try other time"<<endl;

}

int main() {

  int number[6];//array of integers of size 6..

  cout<<"Choose 6 numbers between 1 to 50"<<endl;

  for(int i=0;i<6;i++)

  cin>>number[i];

  LotheryPrinter(number);//calling the function..

return 0;

}

Output:-

Choose 6 numbers between 1 to 50

5 20 12 45 10 36

33

Sorry try other time

Explanation:

I have created a function called LotheryPrinter to generate a lottery number and and then matching the lottery number with the numbers entered by the user and all the number are between 1 to 50.

You might be interested in
What is the name of the function used to open a file in C?
Rudiy27

Answer:

prompt box

Explanation:

the term has changed over the years.

4 0
3 years ago
The main activity area or the brain of the computer is called the ________
Darya [45]

Motherboard

Its a computer chip



6 0
3 years ago
Definition of laptop
zaharov [31]
A device that sucks bc mien broke
7 0
3 years ago
Read 2 more answers
Select the correct statement below about database services or database instances:
Zigmanuir [339]

The correct statement about database services or database instances is

( B).<u>An instance of the cloud database operates as a service that handles all application requests to work with the data in any of the databases managed by that instance.</u>

<u />

Explanation:

An instance of the Database Engine can be defined as a service that <u>all application requests to work with the data in any of the databases managed by that instance.The data can be on the same system or can be on another system </u>

So in case of a Cloud based database engine

( B).<u>An instance of the cloud database operates as a service that handles all application requests to work with the data in any of the databases managed by that instance.</u>

<u />

8 0
3 years ago
What is the common name for the growth rate function N?
kolezko [41]

Answer:

Linear.

Explanation:

The common name for the growth rate function N is linear.N growth rate is directly proportional to the input.So it grows linearly.It does not grow rapidly like other growth functions like quadratic,exponential and cubical.

Constant growth does not grow over time it stays as it is.

Hence the answer to this question is linear.

3 0
3 years ago
Other questions:
  • Landon starts his computer and receives the error message, "Hard drive is not found." In a panic, he calls you because he did no
    14·2 answers
  • All ofthe following are correct EXCEPT one option when it comes towriting disappointing news letters. Identify theexception.
    6·1 answer
  • Prompt the user ‘Enter a row vector of any numbers’ in the command window, and enter an arbitrary row vector and store it to x.
    6·1 answer
  • Write a program that prompts the user to enter the year and the first three letters of a month name (with the first letter in up
    8·1 answer
  • A database administrator (DBA) must have a clear understanding of the fundamental business of an organization, be proficient in
    11·1 answer
  • Of the key reasons for creating organizational units which of the following is not one of them?
    13·1 answer
  • What is the definition of software? Group of answer choices an instruction that causes a single specific action to be performed
    11·1 answer
  • I need to change the subject before they get onto me. I am only revealing info today if you are a friend.
    5·1 answer
  • Something I should look for when trying to decide if a source is credible is the publication's ....
    10·1 answer
  • Which of the following images illustrates safe driving?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!