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
nalin [4]
3 years ago
13

Anyone knows how to do this??

Computers and Technology
1 answer:
a_sh-v [17]3 years ago
4 0
I dont know how to do that
You might be interested in
Lottery Number Generator Design a program that generates a 7-digit lottery number. The program should have an Integer array with
Nikolay [14]

Answer:

/******************************************************************************

                             Online C++ Compiler.

              Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

#include <string>

#include <sstream>

using namespace std;

bool equal(int sys[],int user[])

{

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

{

 if(sys[i]!=user[i]){

     return false;

 }

}

return true;

}

int main()

{

int sys[7];

int user[7];

int min=0

;int max=9;

string userinput;

while(0==0){

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

{

    sys[i]=rand() % (max - min + 1) + min;

}

cout <<endl;

   cout<<"enter numbers"<<endl;

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

{

 getline (cin,userinput);

    if(userinput=="x"){

        return 0;

    }

    else{

 stringstream(userinput) >> user[i];

   

    }

}

     cout<<"User number"<<endl;

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

{

    cout << user[i];

}

    cout<<"system number"<<endl;

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

{

    cout << sys[i];

}

if(equal(sys,user))

{

   cout<<"You won !"<<endl;

}else {

       cout<<"Try again :("<<endl;

}

}

   return 0;

}

Explanation:

Using c++ rand function generate a random number between 0-9.

Formula for random number is rand (max-min +1)+min.

Run this in a loop for 7 time and store each number to an array index in sys array which is for system generated number.

now using string take input from user and check if input is x close program else use stringstream to parse input string to int and store it in user array. Stringstream is a cpp header file used for parsing and handling of strin g inputs. Run this program in loop for 7 times.

Now create a function of type boolean denoted by "bool". This will take both arr as parameter and check if both are equal or not. It compares eac index of user array against each index of sys array and if both values are not equal returns false.

5 0
3 years ago
Gloria is in her sophomore year of college and works part time. She has assignments saved on her home computer, her aunt's lapto
Tanzania [10]
I think this answer, "<span>Upload all existing documents to a cloud-based program," is correct. Hope I helped!!</span>
4 0
3 years ago
Read 2 more answers
You have a manager who makes decisions without getting input from anyone. They are unwilling to change anything once a decision
saw5 [17]

Answer:

autocratic

Explanation:

taking no account of other peoples wishes or opinions; domineering

3 0
2 years ago
Write a program that accepts a whole number as
SashulF [63]

This is for Python

number = int(input('Number: '))

number = number * 12

print(number)

3 0
2 years ago
Describe what a layer 3 router is and what are its advantages and drawbacks compared to other network devices.
Oduvanchick [21]

Answer:

Did you mean layer 3 switch? Because a router always operates at layer 3

Explanation:

If the answer is yes, then a layer 3 is a switch that combines the functions of a switch and a router. So it is capable of operate layer 2 and layer 3. Some of its benefits are: Support routing between VLAN, decrease network latency because the packets don’t have to make extra hops to go through a router and reduce security management. But they are really expensive and lack of WAN functionality so they are used mostly for large intranet environments.

3 0
3 years ago
Other questions:
  • What is binary in computer science ​
    11·1 answer
  • Your friend called and told you that he saw information about the classified XYZ program on the Internet. As a cleared employee
    14·1 answer
  • Which of the following illustrations is depicted in the icon that's used to access Windows Help and Support files?
    13·1 answer
  • Which statement is correct? a. choice of metric will influence the shape of the clusters b. choice of initial centroids will inf
    12·1 answer
  • PLEASE ANSWER FAST, WILL GIVE BRAINLIEST AND 20 POINTS
    11·2 answers
  • Based on the following passage on construction technology during the Middle Ages, why might a worker not be allowed to join a gu
    15·1 answer
  • Stacy is in the process of creating a storyboard for her personal website, but she is unable to decide which storyboarding techn
    13·1 answer
  • Write a program that repeatedly takes integers from the user as long as he
    7·1 answer
  • Explain software piracy and Hacking​
    13·2 answers
  • Quick I need help ASAP
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!