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
Which option ie an example of an html end tag
Kay [80]
Any end tag in HTML needs to look like this, the word body used in this example is one of the more important elements, but you can replace it to any real element in HTML:
i.e. </body>
8 0
3 years ago
What is the main purpose of software imaging?
Irina18 [472]
A is the answer for your question
5 0
4 years ago
using the UML graphical notation for object classes, design the following object classes, identifying attributes and operations.
german

Answer:

Explanation:

check the attachment for the solution.

1)  graphical notation for  a telephone object class.

2)  a messaging system on a mobile

3) a personal computer

4) a bank account

5) a library catalog

6) personal stereo

5 0
3 years ago
Why does my Office Computer send packet #1? What device responds by sending back packet #2? What information does my Office Comp
AleksandrR [38]

Answer:

The office computer is part of a network.

The server responds with a packet when a request packet is sent by a client.

The computer confirms the IP address and port number to retrieve the encapsulated data, for a specific application in the system.

Explanation:

The computer network is the communication of two or more devices. There are two forms of network, there are peer to peer and client/server networks.

The peer to peer network allows for each computer to send and receive data, while the client/server network have a dedicated server to send resources to clients that request for it. Data transferred are encapsulated in the network, transport and data-link layer PDU headers and would be decided in the destination system to retrieve the data.

4 0
3 years ago
Maria's company recently experienced a major system outage due to the failure of a critical component. During that time period,
stira [4]

Answer:

A. Opportunity cost.

Explanation:

Opportunity cost shows a relationship between scarcity and choice. The choice and best source of sales for Maria's company is through online product request on e-store website.

The company has two options for sales, the online sales and physical sales in the company itself. When the company's system fails, they decide to focus on the physical sales for the duration of the system failure.

The opportunity cost is the online sales which was put aside for physical sales.

8 0
3 years ago
Other questions:
  • What seems to be the prevailing opinion about enterprise clouds?
    8·2 answers
  • Which component of the technological system is achieved when an automobiles airbag inflates
    15·1 answer
  • A _____ provides a file-system interface which allows clients to create and modify files.
    11·1 answer
  • Adding functionality to a Button is easy when you use the IDE. After you have dragged a Button onto a Form, you can ____ it to c
    7·1 answer
  • A new repair technician reports that he or she is having trouble installing the operating system. The problem arises when he or
    5·2 answers
  • What is an rgv in coding
    10·2 answers
  • Top-down programming divides a very large or complex programming task into smaller, more manageable chunks.
    8·1 answer
  • Find different between manocots and dicots clarify with example​
    14·1 answer
  • Can somebody tell me the Minecraft command to clear an entire world and destroy every block if u Dunno please don’t answer &gt;-
    13·1 answer
  • An information system will be developed to keep track of a utility company's assets, such as buildings, vehicles, and equipment.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!