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
Xelga [282]
4 years ago
6

Write a program that will predict the size of a population of organisms. The program // should ask the user for the starting num

ber of organisms, their average daily population // increase (as a percentage of the current population), and the number of days they will // multiply. A loop should display the size of the population for each day.
Computers and Technology
1 answer:
nordsb [41]4 years ago
7 0

Answer:

Following are the program in the C++ Programming Language:

#include <iostream>

using namespace std;

int main() {

 float starting, average;

 int num;

 std::cout <<"Enter starting number of the organisms: ";

 while(!(std::cin >> starting)|| starting < 2){

   std::cout<<"starting number must be greater than 2\n";

   std::cout <<"Enter starting number of the organisms: ";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

 std::cout <<"Enter the average of daily population is increase %: ";

 while(!(std::cin >> average)|| average < 0){

   std::cout<<"Average must be greater than 0\n Enter average";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

   average *= .01;

 std::cout <<"Enter the number of days: ";

 while(!(std::cin >> num)|| num < 1){

   std::cout<<"Number of days no be less than 1\n" <<"Enterthe number of days\n";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

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

   std::cout<<"population size of day"<<(i+1);

   std::cout<<": "<<starting<<std::endl;

   starting +=(starting*average);

 }

 return 0;

}

<u>Output</u>:

Enter starting number of the organisms: 4

Enter the average of daily population is increase %: 5

Enter the number of days: 4

population size of day1: 4

population size of day2: 4.2

population size of day3: 4.41

population size of day4: 4.6305

Explanation:

Here, we define header file "<iostream>" and namespace "std".

  • Then, we define the main() inside it, we set two float data type variable i.e., "starting", "average" and set an integer data type variable i.e., "num".
  • Then, we print a message and after that, we set the while loop for get input from the user in variable "starting" and pass the condition inside loop we print message than clear cin and ignore 123 then, we again do this to get  input from user in variable "average".
  • Then, we set the for loop and pass the condition inside the loop print the size of the day then print the value of "starting" after that we multiply.
  • Finally, we return 0 and close the main function.
You might be interested in
Computers store temporary Internet files in the Recycle Bin. These files take up space and slow down a computer. Which tool can
Musya8 [376]
Disk cleanup, B. it cleans unwanted files
6 0
3 years ago
The Cisco ____ model does not describe how communications take place. Rather, it focuses on how best to design a network, especi
Rom4ik [11]

The Cisco t<u>hree-layer hierarchical</u> model doesn't describe how communications take place.

<h3>What is Cisco three-layer hierarchical model?</h3>

The Cisco three-layer hierarchical model is also referred to as a hierarchical internetworking model and it can be defined as a three-layer model that's used for the design of an enterprise (large) network based on the following layers:

  • Core layer
  • Distribution layer
  • Access layer

In conclusion, the Cisco t<u>hree-layer hierarchical</u> model doesn't describe how communications take place, but it focuses on how best to design a an enterprise (large) network.

Read more on Cisco three-layer hierarchical model here: brainly.com/question/3787380

#SPJ1

7 0
2 years ago
What variation of a dictionary attack involves a dictionary attack combined with a brute force attack, and will slightly alter d
allochka39001 [22]

Answer:

hybrid

Explanation:

A hybrid attack is a blend of both a dictionary attack method as well as brute force attack. This means that while a dictionary attack method would include a wordlist of passwords, the brute-force attack would be applied to each possible password in that list.

7 0
3 years ago
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
Sladkaya [172]

Answer:

The program written in Java is given in the explanation section

Explanation:

public class num9 {

//Defining the method CountCharacters()

   public static int CountCharacters(char userChar, String userString){

       int c = userString.length();

       int count=0;

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

           if(userString.charAt(i)==userChar){

               count++;

           }

       }

       return count;

   }

//Main method begins here

   public static void main(String[] args) {

   char n ='n';

   String word = "Monday";

//Calling the method CountCharacters()

       System.out.println(CountCharacters(n,word));

   }

}

4 0
3 years ago
What is the purpose of filters in a database?
malfutka [58]

Answer:

A: Filters allow you to see only the records that meet specific criteria.

Explanation:

Imagine you having a database full of first and last names. You could use a filter to only show the people who have a specific first or last name.

6 0
4 years ago
Other questions:
  • (04.01 MC)
    11·1 answer
  • When using a graphics editing program, which option allows you to adjust the space around an image?
    15·1 answer
  • A user is trying to delete a file located on an NTFS volume on his Windows 8 computer but is unable to do so. Why is this?
    6·1 answer
  • What date does GTA 6 come out<br> A. 2020<br> B. 2019<br> C. 2021<br> D. 2022
    10·2 answers
  • File compression is only available on hard-disk drives. <br><br><br> a. True <br><br><br> b. False
    6·1 answer
  • Give the uses of Word’s mail merge.
    8·1 answer
  • 5. Compare the telephone network and the internet. What are the similarities? What are the differences?
    12·1 answer
  • You have purchased a new LED monitor for your computer. On the back of the monitor, you see the following port (pictured below).
    9·1 answer
  • Which of these agents of education empowers the other..........
    15·2 answers
  • When adopting and implementing a software as a service (saas) platform such as salesforce for your business, which responsibilit
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!