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
vfiekz [6]
2 years ago
8

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

of organisms, their average daily population increase (as a percentage, expressed as a fraction in decimal form: for example 0.052 would mean a 5.2% increase each day), and the number of days they will multiply. A loop should display the size of the population for each day.
Input Validation.Do not accept a number less than 2 for the starting size of the population. If the user fails to satisfy this print a line with this message "The starting number of organisms must be at least 2.", display the prompt again and try to read the value. Similarly, do not accept a negative number for average daily population increase, using the message "The average daily population increase must be a positive value." and retrying. Finally, do not accept a number less than 1 for the number of days they will multiply and use the message "The number of days must be at least 1."
Computers and Technology
1 answer:
sineoko [7]2 years ago
6 0

Answer:

// using c++ language

#include "stdafx.h";

#include <iostream>

#include<cmath>

using namespace std;

//start

int main()

{

 //Declaration of variables in the program

 double start_organisms;

 double daily_increase;

 int days;

 double updated_organisms;

 //The user enters the number of organisms as desired

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

 cin >> start_organisms;

 //Validating input data

 while (start_organisms < 2)

 {

     cout << "The starting number of organisms must be at least 2.\n";

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

     cin >> start_organisms;

 }

 //The user enters daily input, here's where we apply the 5.2% given in question

 cout << "Enter the daily population increase: ";

 cin>> daily_increase;

 //Validating the increase

 while (daily_increase < 0)

 {

     cout << "The average daily population increase must be a positive value.\n ";

     cout << "Enter the daily population increase: ";

     cin >> daily_increase;

 }

 //The user enters number of days

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

 cin >> days;

 //Validating the number of days

 while (days<1)

 {

     cout << "The number of days must be at least 1.\n";

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

     cin >> days;

 }

 

 //Final calculation and display of results based on formulas

 for (int i = 0; i < days; i++)

 {

     updated_organisms = start_organisms + (daily_increase*start_organisms);

     cout << "On day " << i + 1 << " the population size was " << round(updated_organisms)<<"."<<"\n";

     

     start_organisms = updated_organisms;

 }

 system("pause");

  return 0;

//end

}

Explanation:

You might be interested in
You are a psychologist who needs to provide a qualitative evaluation for IQ scores. Create a program that takes IQ scores (one a
dsp73

Answer:

Check the explanation

Explanation:

#include <iostream>

#include <iomanip>

using namespace std;

int getIQ(); // return the score

void printEvaluation(int);

int main()

{

   int IQ = 0;

   IQ = getIQ();

   

   printEvaluation(IQ);

   return 0;

}

int getIQ()

{

   int score = 0;

   cout << "Please enter your IQ Score to receive your IQ Rating:\n";

   cin >> score;

   

   return score;

}

void printEvaluation(int aScore)

{

   cout << "IQ Score: " << aScore << " IQ Rating: ";

   

   if (aScore <= 100)

   {

       cout << "Below Average\n";

   }

   else if (aScore <= 119)

   {

       cout <<"Average\n";

   }

   else if (aScore <= 160)

   {

       cout << "Superior\n";

   }

   else if (aScore >= 160 )

   {

       cout << "Genius\n";

   }

}

4 0
2 years ago
For this assignment: Analyze and describe the network infrastructure. Describe and explain the various policies that will be nee
mamaluj [8]

Answer:

Explanation:

The Network infrastructure shown here are LAN and WAN. Wired and wireless communications.

The Various policies are:

1. Group related items together, for instance, grouping all Windows servers, into one virtual LAN (VLAN). Other asset groups might include infrastructure (routers, switches, VPNs and VoIP) in one VLAN and security assets (IDS, firewalls, web filters and scanners) may be grouped in another.

2. In general, it is good to adopt a default deny access posture for each VLAN.

3. Network segmentation is a very significant, long-term project, but each step along the way increases security. Log all traffic between segments to determine what is normal and needed for effective functioning.

4. Network segmentation is undeniably and unquestionably an effective component in a defense in depth strategy. Organizations that implement it must be prepared to manage scores of firewalls, switches and routers, each with hundreds of rules, all of which may be affected by the network segmentation process and potentially by updates and changes, even after it is in place.

5. Contribute to a secure WAN environment for all connected departments, offices,

agencies, boards, and commissions

6. Provide a uniform security framework to secure the integrity, confidentiality, and availability of info and info systems, at the WAN level.

7. Provide, in balance with operational requirements, legislative requirements, and information sharing agreements, the minimum WAN security requirements.

8. Raise awareness of information and information technology security needs for all users of the WAN by providing the security principles, requirements.

9. Define the clear roles and responsibilities of all users of the WAN, particularly WAN security staff.

* Vulnerabilities and exposures

1. Data requiring special protection such as credit card numbers that need to comply with PCI-DSS or patient information that is subject to HIPAA should be isolated from other data and put in their own VLANs.

2. Your aim is to limit access to sensitive information to those who need it within the organization and to create roadblocks to stop or slow intruders, who may have broken through one layer of security, from doing further damage.

3. Network segmentation is not a “set and forget” undertaking. The network access policy, defined in firewalls, routers and related devices, changes constantly to cater to new business requirements. Ensure that new changes do not violate your segmentation strategy requires a good degree of visibility and automation.

4. Reducing internal breaches and the infiltration of malicious software(malware). This

internal defense requires significant involvement with individual devices

on a network, which creates greater overhead on network administrators.

*Risks

1. Malicious software, also known as malware,makes its way onto a network through

employees, contractors and visitors. Personal laptops, wireless gadgets,

and of course the USB flash drives, all these provide excellent vectors through which

malware can enter the workplace.

2. Hackers, worms, spammers and other security dangers of the Internet via LAN.

3. The various vulnerabilities on your network represent potential costs — time, money and assets — to your library. These costs, along with the chance someone will exploit these vulnerabilities, help determine the level of risk involved.

4. Since the cost of adding another Internet connection, increasing the speed of the current connection or purchasing complex network monitoring equipment might be too prohibitive, the library has a higher tolerance for a periodically slow Internet connection.

5. External flash drives and other media are also concern when those enters the network.

6. The lost or stolen handheld device poses some serious risks if not incorporated into your network security policy. Such devices are often capable of being formatted of all company content remotely in the case of theft or robbery.

*Security measurements:

1. Address Resolution

Protocol (ARP) spoofing, Denial of Service (DoS) attacks such as Tear Drop

or Ping of Death.

2. In addition, network administrators can form a policy whereby network

users are required to install and maintain anti-malware scanners in their devices.

3. Many tools exist to check the existing security state of your network. The Microsoft Baseline Security Analyzer, Nmap .

4. Risk assessment is a combination of both quantifying (the cost of the threat) and qualifying (the odds of the attack).

5. Firewalls.

6. Antivirus systems.

7. Intrusion-detection systems (Host-based IDS,Network-based IDS)

8. Port scanners.

9. Network sniffers.

10. A vulnerability scanner is like a port scanner on steroids.

*Unnecessary Ports

1. It is not easy to say which ports exactly but we should know that the service ports which are open among 65,535 ports and although not exactly sure what service is running , it is safer to check the port and close it as "A Closed Port is a Safe Port".

7 0
3 years ago
What would be the results of the following code? int[] x = { 55, 33, 88, 22, 99, 11, 44, 66, 77 }; int a = 10; if(x[2] &gt; x[5]
Nezavi [6.7K]

Answer:

The answer is "Option A".

Explanation:

In the given code an integer array "x" is defined, that stores some elements and another integer variable "a" is declared, that holds a value that is "10". In this code a conditional statement is defined, which checks array element value, in if block element of array that position is 2 is greater then the element of array that position is 5.if this condition is true, so variable a value is change that is equal to 5. In else block if the above condition is not true so the value of a variable is equal to 8, and another options is wrong that can be described as follows:

  • In option B, The given condition is not false, that's why it is not correct.
  • In option C, The value of variable a is changed when condition is true or false, that's why it is not correct.
  • In option D, It is wrong because we can compare array elements.

6 0
3 years ago
Complete the function ending_time that determines the final clock time after a task has been completed. The function takes three
Ivanshal [37]

Answer:

  1. def ending_time(hour, minutes, seconds, work_time):
  2.    if((seconds + work_time) // 60 > 0):
  3.        minutes = minutes + (seconds + work_time) // 60
  4.        seconds = (seconds + work_time) % 60    
  5.        if(minutes // 60 > 0):
  6.            hour = hour + (minutes // 60)
  7.            minutes = minutes % 60
  8.    else:
  9.        seconds = seconds + work_time  
  10.    return str(hour) + ":" + str(minutes) + ":" + str(seconds)
  11. print(ending_time(2,30,59, 12000))

Explanation:

The solution code is written in Python 3.

Firstly create a function ending_time that takes the four required input parameters.

Next, create an if statement to check if the numerator of (seconds + work_times) divided by 60 is over zero. If so, increment the minute and reassign the remainder of the seconds to the variable (Line 2-4).

Next, create another if statement again to check if the numerator of (current minutes) divided by 60 is over zero, if so increment the hour and reassign the remainder of the minutes to the variable (Line 6-8)

Otherwise, just simply add the work_time to the current seconds

At last return the time output string (Line 12).

8 0
3 years ago
To assign a new keyboard shortcut, you would access backstage, word options then
Zarrin [17]
Customize ribbon, and the customize button.
6 0
2 years ago
Other questions:
  • What is a telecomunications system? 1) A system that enables the transmission of data over public or private networks. 2) A comm
    11·1 answer
  • How do you activate the Formula AutoComplete function of Excel 2016?
    15·2 answers
  • Company-wide systems that connect one or more local area networks (LANs) or wide area networks (WANs) are called _____. a) legac
    15·1 answer
  • Which of the following does not use a Graphic User Interface?
    14·1 answer
  • 1. Briefly explain the concept of signature of a function, in a function declaration. What signature components are crucial for
    9·1 answer
  • What are the advantages to using a linked implementation as opposed to an array implementation?
    8·1 answer
  • In confirmatory visualization Group of answer choices Users expect to see a certain pattern in the data Users confirm the qualit
    9·1 answer
  • SINCE I CANT SEE IT KANG LOOK
    6·2 answers
  • With a(n) ____ you can arrive at a scene, acquire the data you need, and return to the lab as quickly as possible.
    14·1 answer
  • What name is given to any changes to the original data such as users manually modifying data, programs processing and changing d
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!