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
Serjik [45]
1 year ago
8

Give a real-world example of a selection control structure.

Computers and Technology
1 answer:
yuradex [85]1 year ago
6 0

An example of selection structure is when a group of people wanted to know the exact  number of days through the use of a data set that has the daily high temperature which ranges from above 80 degrees, and as such, a programmer can use the if-end statement.

<h3>What is an if statement?</h3>

An IF statement is known to be a kind of statement that is executed due to the happening of a specific condition.

Note that IF statements must start with IF and end with the END.

Therefore, An example of selection structure is when a group of people wanted to know the exact  number of days through the use of a data set that has the daily high temperature which ranges from above 80 degrees, and as such, a programmer can use the if-end statement.

Learn more about  if-end statement from

brainly.com/question/18736215

#SPJ1

You might be interested in
In powerpoint, what is line thickness measured in?
katrin [286]
Impasto. Hope this helps!
5 0
2 years ago
My HTC Desire 510's mobile data stopped working, how to I make it work again?
denis-greek [22]
Ask your mobile operator
2.go to hrs service
3. Turn on and turn off
4 0
3 years ago
The Zootopia Police Department is recruiting new officers and has come up with an innovative equation to hire. They define hireS
Dahasolnce [82]

Answer:

#include<iostream>

#include<limits>

#include<iomanip>

using namespace std;

//function that returns true

//if there is invalid input like giving string as input

// for integer value.

bool isInvalidInput()

{

  //return true if cin.fail

  if(cin.fail())

  {

      //clear the buffer

      cin.clear();

      cin.ignore(numeric_limits<streamsize>::max(),'\n');

      return true;

  }

  return false;

}

//function that calculates the hire score for given 3 parameters.

double calHireScore(double agility,double strength,double speed)

{

  return (1.8*agility) + (2.16 * strength) + (3.24 * speed);

}

//calculate hire score for fox.

void calFoxHireScore()

{

  double agility,strength;

 

  cout<<"Enter Agility Value: ";

  //get agility as input and validate it.

  cin >> agility;

  if(isInvalidInput() || agility <= 0)

  {

      cout<<"\nError: Agility value must be > 0"<<endl;

      return;

  }

 

  cout<<"Enter Strength Value: ";

  cin >> strength;

  if(isInvalidInput() || strength <= 0)

  {

      cout<<"\nError: Strength value must be > 0"<<endl;

      return;

  }

 

  cout<<"\nHire Score for Fox: "<<calHireScore(agility,strength,0)<<endl;

}

//function that asks input from user for

//calculating hire score for Sloth.

void calSlothHireScore()

{

  double strength,speed;

 

  cout<<"Enter Strength Value: ";

  cin >> strength;

  if(isInvalidInput() || strength <= 0)

  {

      cout<<"\nError: Strength value must be > 0"<<endl;

      return;

  }

 

  cout<<"Enter Speed Value: ";

  cin >> speed;

  if(isInvalidInput() || speed <= 0)

  {

      cout<<"\nError: Speed value must be > 0"<<endl;

      return;

  }

 

  cout<<"\nHire Score for Sloth: "<<calHireScore(0,strength,speed)<<endl;

}

//function that asks input from user for

//calculating hire score for Bunny.

void calBunnyHireScore()

{

  double agility,speed;

 

  cout<<"Enter Agility Value: ";

  cin >> agility;

  if(isInvalidInput() || agility <= 0)

  {

      cout<<"\nError: Agility value must be > 0"<<endl;

      return;

  }

 

  cout<<"Enter Speed Value: ";

  cin >> speed;

  if(isInvalidInput() || speed <= 0)

  {

      cout<<"\nError: Speed value must be > 0"<<endl;

      return;

  }

 

  cout<<"\nHire Score for Bunny: "<<calHireScore(agility,0,speed)<<endl;

}

//function to display menu for user.

void menu()

{

  cout<<"\n1. Fox"<<endl;

  cout<<"2. Bunny"<<endl;

  cout<<"3. Sloth"<<endl;

  cout<<"0. Quit"<<endl;

  cout<<"Enter your choice: ";

}

//main method

int main()

{

  int choice;

  do

  {

      //asks choice

      menu();

      cin >> choice;

      //if invalid input print erro message

      if(isInvalidInput())

      {

          cout<<"\nError: Invalid choice enetered. Try Again\n";

      }

      else

      {

          cout<<"\n";

          //if any one of the choices do accordingly

          //for invalid choice print error mesage.

          switch(choice)

          {

              case 1:

                  calFoxHireScore();

                  break;

              case 2:

                  calBunnyHireScore();

                  break;

              case 3:

                  calSlothHireScore();

                  break;

              case 0:

                  cout<<"\nQutting...\n";

                  break;

              default:

                  cout<<"Invalid choice entered."<<endl;

                  break;

          }

      }

     

  }while(choice != 0);

 

  return 0;

}

Explanation:

3 0
3 years ago
Which of the following are responsibilities of information security management? Defining the protection required for systems and
Talja [164]

Answer:

all of them are responsibilities

Explanation:

4 0
2 years ago
Why is iot architecture important?
Harlamova29_29 [7]
They need to make sure your building is easy to move around in. Beyond the building itself, architecture and design can help bring balance to people's lives. ... Well-designed schools create better learning environments. Workplaces with good architecture experience higher productivity.
7 0
3 years ago
Other questions:
  • You need to put cabling for connecting two new computers in a room, which did not have any network infrastructure. Because of th
    9·2 answers
  • What types of automation device might require specialist installer training?
    5·1 answer
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. 
    5·1 answer
  • What are the characteristics of the Global Address List? Check all that apply.
    13·1 answer
  • Which ofthe following sentence beginnings would be best to use in apersuasive request?
    8·1 answer
  • Manuel has set up his network so that some employees can open and view files but are unable to edit them. Others can open, view,
    10·1 answer
  • Consider the following code:
    12·1 answer
  • How do you change the order of the slides in your presentation in the slide pane 
    15·2 answers
  • The specific instructions that a computing device needs to boot up and control the hardware
    12·1 answer
  • In your own words, what is Cryptocurrency?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!