Implement a while loop that simulates the growth

Assignment Help Computer Engineering
Reference no: EM133703611

Bacterial growth is a fundamental concept in microbiology. Write a Python program named GrowthRate.py that simulates the growth of bacteria over time using a simple exponential growth model. The program will prompt the user to enter the initial number of bacteria and the growth rate. The program will then simulate the growth and display the population of bacteria at each time step until it reaches a specified maximum population.

Here's what your program should do:
1. Prompt the user to enter the initial number of bacteria.
2. Prompt the user to enter the growth rate as a percentage (e.g., 50 for 50% growth rate) per hour.
3. Prompt the user to enter the maximum population of bacteria.
4. Implement a while loop that simulates the growth of bacteria:
o Inside the loop, calculate the new population using the formula: population = population +
(growth_rate / 100) * population.
o Display the current population of bacteria in whole numbers.
o Check if the population exceeds the maximum population. If so, exit the loop.
5. Display a message indicating the final population reached and how many hours it took.
Here's an example of how the program should work:
Enter the initial number of bacteria: 100
Enter the growth rate (in percentage per hour): 25
Enter the maximum population: 1000
Population at hour 0 : 100
Population at hour 1 : 125
Population at hour 2 : 156

Population at hour 3 : 195
Population at hour 4 : 244
Population at hour 5 : 305
Population at hour 6 : 381
Population at hour 7 : 476
Population at hour 8 : 596
Population at hour 9 : 745
Population at hour 10 : 931
The final population reached is 1164 bacteria.
It took 11 hours for the population to reach the maximum.

Reference no: EM133703611

Questions Cloud

Evaluate and report the results with tags : Evaluate and report the results with tags from the dataset using precision, recall and F-score and Randomly select 50 sentences and store the sentences
Client is prescribed intravenous fluid therapy : A client is prescribed intravenous fluid therapy with 0.9% sodium chloride 100 mL per hour into the left-hand IV catheter.
What is good to write back to an intrusion detection system : What is good to write back to: An intrusion detection system looks at network or system activity for unauthorized activity and notifies the system or network
Develop a short presentation for an orientation session : Develop a presentation for an orientation session with new employees that discusses importance of using ethical and respectful performance management system.
Implement a while loop that simulates the growth : Prompt the user to enter the initial number of bacteria and Prompt the user to enter the growth rate as a percentage (e.g., 50 for 50% growth rate) per hour.
How you can check if all your pc parts are compatible : How you can check If all your PC parts are compatible with one another? Which part is the main culprit when it comes to compatibility issues
How the grand nursing theory can be applied to other nursing : How the grand nursing theory can be applied to other nursing practice situations, as well as nursing leadership and ethical decision-making relate to the theory
Write the tryparse statement : Write the TryParse statement that converts the user input in the txtMyNumber Text property to an integer, placing the converted value in intMyNumber
Explain how to construct a markov random field : Explain how to construct a Markov random field to represent the uniform probability distri- bution, p, over valid vertex covers of G

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd