Suppose a regional council wants to see the effect of reducing the chorophyll, nitrogen, and phosphorus values in a lake by a certain percentage each year. For example, Lake Whangape could do with a clean up: Define a function print_variables_over_time(c_a, tn_, tp_0, percent_reduction, final year) that accepts current levels for CHLA, TN, and TP and prints out a table showing a forecast of these values over time, provided all are reduced by the given percentage each year. Parameter summary • c_0, tr_0, and tp_e are initial CHLA, TN, and TP values respectively (i.e. at year 0). percent_reduction is the percentage reduction in all three values, per year, and will be given as a value between 0 and 100. • final year = number of the last year to print, e.g. 4 means print years 0, 1, 2, 3, 4. You can assume final year is at least 1. Notes: • Use 'Year CHLA TN TP for the header row. • The year should be printed with width 3 (ie, :3d will be helpful) CHLA, TN, and TP should be printed with width 10 and 2 decimal places. (Hint: :10.2f will help.) . You must use a while loop for this - it will help with the next question! • You cannot use any for loops or list comprehensions. For example: Test print_variables_over_time (128, 2048, 256, 12.5, 5) Result Year 0 1 2 3 4 5 TN CHLA 128.00 2048.00 112.00 1792.00 98.00 1568.00 85.75 1372.00 5 6 7 8 9 10 75.03 1200.50 65.65 1050,44 print variables_over_time (128, 1024, 256, 6.25, 10) Year CHLA 128.00 TN 1024.00 8 1 120.00 960.00 112.50 900.00 105.47 843.75 2 3 4 71.61 67.13 TP 256.00 224.00 572.85 537.05 196.00 171.50 TP 256.00 240.00 225.00 210.94 98.808 791.02 197.75 92.70 741.58 185.39 86.90 695.23 173.81 81.47 651.78 162.94 76.38 611.04 152.76 150.06 131.30 143.21 134.26
Suppose a regional council wants to see the effect of reducing the chorophyll, nitrogen, and phosphorus values in a lake by a certain percentage each year. For example, Lake Whangape could do with a clean up: Define a function print_variables_over_time(c_a, tn_, tp_0, percent_reduction, final year) that accepts current levels for CHLA, TN, and TP and prints out a table showing a forecast of these values over time, provided all are reduced by the given percentage each year. Parameter summary • c_0, tr_0, and tp_e are initial CHLA, TN, and TP values respectively (i.e. at year 0). percent_reduction is the percentage reduction in all three values, per year, and will be given as a value between 0 and 100. • final year = number of the last year to print, e.g. 4 means print years 0, 1, 2, 3, 4. You can assume final year is at least 1. Notes: • Use 'Year CHLA TN TP for the header row. • The year should be printed with width 3 (ie, :3d will be helpful) CHLA, TN, and TP should be printed with width 10 and 2 decimal places. (Hint: :10.2f will help.) . You must use a while loop for this - it will help with the next question! • You cannot use any for loops or list comprehensions. For example: Test print_variables_over_time (128, 2048, 256, 12.5, 5) Result Year 0 1 2 3 4 5 TN CHLA 128.00 2048.00 112.00 1792.00 98.00 1568.00 85.75 1372.00 5 6 7 8 9 10 75.03 1200.50 65.65 1050,44 print variables_over_time (128, 1024, 256, 6.25, 10) Year CHLA 128.00 TN 1024.00 8 1 120.00 960.00 112.50 900.00 105.47 843.75 2 3 4 71.61 67.13 TP 256.00 224.00 572.85 537.05 196.00 171.50 TP 256.00 240.00 225.00 210.94 98.808 791.02 197.75 92.70 741.58 185.39 86.90 695.23 173.81 81.47 651.78 162.94 76.38 611.04 152.76 150.06 131.30 143.21 134.26
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education