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
tester [92]
3 years ago
13

How many comparisons will be made to find 8 in this list using a linear search?

Computers and Technology
1 answer:
Kobotan [32]3 years ago
6 0

Answer:

4

Explanation:

4

You might be interested in
In the classic experimental design, there are two groups: the _____ group and the _____ group.
Tju [1.3M]

Main Answer:In the classic experimental design, there are two groups: the <u>treatment group and the control group.</u>

<u>Sub heading:</u>

<u>Explain treatment group and control group?</u>

Explanation:

1.The treatment group also known as the experimental group receives the treatment that the researcher is evaluating.

2.the control group  on the other hand does not receive the treatment.

Reference link:

https://brainly.com

Hashtag:

#SPJ4

5 0
2 years ago
Write a program that generates a random number between 5 and 15 and asks the user to guess what the number is. If the user’s gue
stepan [7]

Answer: The c++ program for the number guessing game is given below.

#include <iostream>

using namespace std;

// method declaration without parameters

void game();

int main() {    

char reply;

// calling the game method

game();  

cout<<"Would you like to continue with the game ? Enter y to continue. Enter q to quit the game. " <<endl;

cin>>reply;  

if(reply == 'y')

    game();      

if(reply == 'q')

    cout<<"Quitting the game..."<<endl;  

return 0;

}

void game()

{

   int num, guess, attempt=0;  

num = (rand() % 10) + 6;  

cout<<endl<<"Welcome to the game of guessing the correct number "<<endl;  

   do

{    

    cout<<"Enter any number between 5 and 15. "<< endl;

    cin>>guess;      

    if(guess<5 || guess>15)

    {

        do

        {

            cout<<"Invalid number. Enter any number between 5 and 15. "<<endl;

            cin>>guess;

        }while(guess<5 || guess>15);

    }  

    if(guess < num)

    {

        cout<<"Too Low"<<endl;

        attempt++;        

    }

    if(guess > num)

    {

        cout<<"Too High"<<endl;

        attempt++;          

    }      

}while(guess != num);  

cout<<"Congratulations. You figured out my number in "<<attempt<< " attempts."<<endl;

}

Explanation:

The expression

(rand() % 10)

generates a random number between 0 and 9. 6 is added to generate a random number between 5 and 15.

The integer variable attempt is initialized to 0.

Next, user is asked to guess the number. If the user enters an invalid input, the do-while loop begins until a valid input is received from the user.

    cout<<"Enter any number between 5 and 15. "<< endl;

    cin>>guess;      

    if(guess<5 || guess>15)

    {

        do

        {

            cout<<"Invalid number. Enter any number between 5 and 15. "<<endl;

            cin>>guess;

        }while(guess<5 || guess>15);

    }  

User is prompted to input the guess using the same do-while loop as above. Until the user guesses the correct number, the loop continues. Each incorrect guess by the user, increments the variable attempt by 1. This represents the number of attempts done by the user to guess the correct number.

    if(guess < num)

    {

        cout<<"Too Low"<<endl;

        attempt++;        

    }

    if(guess > num)

    {

        cout<<"Too High"<<endl;

        attempt++;          

    }  

The random number generation and the guessing logic is put in a separate method game().

The entry and exit from the game only is put inside the main method.

4 0
4 years ago
What is the most credible website or webpage you have ever visited? Why is it so credible? Describe some of the qualities that m
8_murik_8 [283]
— Look for Sites from Established Institutions.
— Look for Sites with Expertise
— Do not click on Commercial Sites
— Beware of Bias
— Check when it was last updated, so you get recent info.
— Check Links
— Avoid Anonymous Authors.
6 0
4 years ago
Read 2 more answers
&gt;&gt;&gt; phrase = "abcdefgh" <br><br> &gt;&gt;&gt; phrase[3:6]
Scrat [10]

Answer:

Following are the correct code to this question:

phrase = "abcdefgh"#defining a variable phrase that holds a string value

print(phrase[3:6])#use print method for slicing and print its value

Output:

def

Explanation:

In the above code, a variable "phrase" is defined that holds a string value, and use a print method, inside the method, the variable is used as a list and use slicing.

It is a characteristic that enables you to access the series parts like strings, tuples, and lists. It also uses for modifying or removing objects in series, in the above slicing it starts from 3 and ends when it equal to the 6th letter, that's why it will print "def".

6 0
3 years ago
What task did the u.s. government undertake that many people identify as the birth of the internet
blsea [12.9K]
The answer is a. the government developed a computer system to be used in military communications. It started in the 1960s and was developed and used to serve as communication without experiencing disturbances from bombs and gain security for military purposes. This was the time when ARPANET (Advanced Research Projects Agency Network) came into the picture. Soon it was opened to people starting from the 70s when emails were used and became more popular. It then paved for further development and largely contributed to technology and communication.
8 0
3 years ago
Read 2 more answers
Other questions:
  • In the 21st century organization we will see:
    10·1 answer
  • An independent frame that holds a program, document, or folder contents in windows 7 is called a ____.
    11·1 answer
  • The most widely used presentation software program is Microsoft PowerPoint. You can produce a professional and memorable present
    15·1 answer
  • What type of malicious software masquerades as legitimate software to entice the user to run it?
    14·1 answer
  • The following code segment is a count-controlled loop going from 1 to 5. At each iteration, the loop counter is either printed o
    11·1 answer
  • Which of these identifies the intersection of row 16 and column D?
    14·1 answer
  • 1. Why is it important for IT technicians to keep documentation on computers for which they are
    13·1 answer
  • Why computer is used in education sector<br>​
    7·2 answers
  • How can edge computing be used to increase sustainability
    8·1 answer
  • What are the different types of topology?​ in details
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!