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
Evgesh-ka [11]
3 years ago
11

Your friend is working on a Lab experiment to decide which insect is the fastest. You will help your friend and write an algorit

hm and a C++ program that allows your friend to enter the names of the insects and the measured speed of each insect. The names of the insects and the measured speeds should be stored in two arrays. The program should then sort and print the insects in descending order based on their speed. Your program should also output the name of the fastest insect.
Computers and Technology
1 answer:
7nadin3 [17]3 years ago
3 0

Answer:

#include <iostream>

#include <string>

using namespace std;

int main()

{

    int size=100;

   float insect_speed [size];

   string insect_name [100]={""};

int max=0;

int max_index=0;

for(int i=0;i<size;i++){

   

   cout<<"insect speed"<<endl;

cin>>insect_speed[i];

cin.ignore();

   cout<<"insect name"<<endl;

   getline(cin,insect_name[i]);

if(insect_speed[i]>max){

   max=insect_speed[i];

   max_index=i;

}

   cout<<"Fastest insect is "<<insect_name[max_index]<<" with speed "<<insect_speed[max_index]<<endl;

}

   return 0;

}

Explanation:

Initially took max size of 100. Using string define an string array of size for insect name and float array of size for speeds.

Define a variable max and set to 0 and a max_index and set to 0. max index will store the index of maximum value in array of speed.

For every input of speed check if it greater than max set max to current input vale of speed and max_index to current index of array.

print speed and insect name at max_index for fastest insect.

System will calculate fastest insect at run time an update user after every input.

You might be interested in
P*********** is considered a serious social problem justify this statement​
vredina [299]

Answer:

I think it's not a social problem but they are doing that by their own choice . but if the girls are forced to do that is the social problem

7 0
3 years ago
Read 2 more answers
What are examples of scanning devices?
eimsori [14]

Here the examples of scanning devices :

  • Drum Scanner.
  • Handheld Scanner.
  • Flatbed Scanner.
  • Optical Character Recognition.
  • Magnetic Ink Character Recognition.
  • Image Scanner.

<h3>What is meant by scanning ?</h3>
  • A text is scanned quickly in order to find a specific piece of information. In daily life, scanning is regularly used for tasks like looking up a word in a dictionary or finding a friend's name in your phone's contacts list.
  • Scanners may basically be divided into three categories. These consist of network scanning, port scanning, and vulnerability scanning.
  • There are three different types of scanners: portable scanners, flatbed scanners, and drum scanners. While flatbed scanners are commonly used in offices and classrooms, drum scanners are mainly used in the publishing industry to print high-quality pictures.
  • Three processes make up the basic scanning process: scan, register, and detail.

Learn more about scanning refer to :

brainly.com/question/25106178

#SPJ4

4 0
1 year ago
Write a public static method named insert. The insert method should have the signature insert(String[] words, String newWord, in
Mumz [18]

Answer:

Explanation:

The following code was written in Java and performs the exact requirements listed in the question. It has also been tested by the runner code and works perfectly.

public static boolean insert(String[] words, String newWord, int place) {

               if (place > words.length) {

                   return false;

       } else {

                   for (int x = words.length - 1; x >= 0; x--) {

                       if (place == x) {

                           words[x] = newWord;

                           break;

                       } else {

                           words[x] = words[x-1];

                       }

                   }

                   return true;

               }

   }

5 0
3 years ago
The process of converting software to operate in a second language is called software _______.
kari74 [83]

Answer:

software localization

Explanation:

As international systems penetrate deeper into management and clerical groups, a common language is formed

4 0
2 years ago
What does it mean to say that there is a relationship between two tables?
NeTakaya

Answer:

Definition

Explanation:

A database relationship is a situation between two relational database tables when one table has a foreign key that refers to the other table's primary key.

Relationships allow for the separation and storing of information in different tables when connecting disparate data objects.

4 0
3 years ago
Other questions:
  • Web client software, such as Chrome, Firefox, Internet Explorer, Safari, and Opera, that are used to view Web pages are known as
    14·2 answers
  • Janis is preparing a financial document. She needs to use the dollar symbol placed above the number key 4. Which key will Janis
    12·2 answers
  • Jed is the database administrator for a mid-sized computer component manufacturer. He is responsible for validating the data mod
    12·1 answer
  • Given coins of denominations (value) 1 = v1 &lt; v2&lt; … &lt; vn, we wish to make change for an amount A using as few coins as
    11·1 answer
  • Jargon is:
    6·2 answers
  • A PC is not able to connect to a wired network. Pinging the loopback address is successful, but the gateway cannot be reached. O
    12·1 answer
  • If you type too much text on a PowerPoint slide, the additional text is added to a second slide.
    9·1 answer
  • The first row in a table is referred to as the _____ row and the last row is considered the _____ row.
    9·1 answer
  • Son opciones de configuración espacio multimedia llamado blog
    9·1 answer
  • Group of answer choices When declaring a variable, you also specify the type of its values. Variables cannot be assigned and dec
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!