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
attashe74 [19]
3 years ago
6

This is due in like an hour but I'm confused so please do lend assistance

Computers and Technology
1 answer:
blagie [28]3 years ago
4 0
Yes you do have to program it first.
You might be interested in
Identify congruent triangles. Justify why these triangles are congruent?
dem82 [27]
4 because it’s a triangular ruler
3 0
3 years ago
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
A computer system has 9,850 processes and 172 of them were suspended while 276 of them were terminated. Explain why some of the
Mrrafil [7]

Answer:

Check below for answers and explanations.

Explanation:

The major reasons why computer processes are suspended or terminated are:

1. When there is insufficient memory for successful completion of the process

2. When there's an unauthorized access of any of the computer resources by the process.

It is possible that some processes are terminated why some are suspended because, when the system runs out of memory, the running processes are put on hold until the system is able to create free memory space for the completion of the process. In this case the process is suspended. But if the system cannot provide enough space for the process, the process is terminated.

In the example provided in this exercise, some of the processes were suspended because the system wants to create free memory space for their completion while others are terminated either because the available space is not sufficient for their completion or they want to access an unauthorized resources on the system.

4 0
3 years ago
The most popular transmission media option for wired home ethernet networks is ________ cable. fiber-optic power-line unshielded
tino4ka555 [31]
<span>This is called an unshielded twisted pair cable, which is also known as a UTP cable. This type of cable has four pairs of wires that are twisted around each other. Because the wires are like this, the electrical interference is reduced.</span>
3 0
3 years ago
Jenna received an interesting email about dolphins that she wants to share with her brother. Which operation will allow Jenna to
KATRIN_1 [288]
The answer is Forward

5 0
3 years ago
Other questions:
  • What precaution can you take while using a social networking site to prevent a data breach?
    15·1 answer
  • What is <br> Warehouse schema.
    14·1 answer
  • You are attempting to gather information about a client's network, and are surveying a company site. Access is gained via secure
    8·1 answer
  • The picture that graphically represents the items you use in Windows is called a/an
    11·1 answer
  • When creating a chart or graph, which should be completed first?
    9·2 answers
  • In rolling a die four times, what is the odds that at least one 5 would appear?
    6·1 answer
  • Write a program that prompts the user to enter two positive integers less than 1,000,000,000 and the program outputs the sum of
    15·1 answer
  • POINT AND BRAINLIEIST GIVE AWAY!!!
    11·2 answers
  • Briefly describe the traditional definition of the digital divide. What is it and who is affected, positively and adversely? How
    15·1 answer
  • Hi can someone please help me with this homework please?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!