I have a working code, but seems to be missing where to add the floating decimal point with changing the entire line. Please see the below as I am looking to get the end result to be $56.00 not $56.0 and seems that I am missing a piece there. # Calculate total amount storage, frequency for a weekdef calculate_backup_size(data_size, backup_frequency):     return data_size * backup_frequency    # Calculate storage cost for backup storage, cost per gb def calculate_storage_cost(backup_size, cost_per_gb):     return backup_size * cost_per_gb # Calculate the backup size, total,cost, cost per gbdef storage_info(data_size, backup_frequency, cost_per_gb, weeks):    backup_size = calculate_backup_size(data_size, backup_frequency)    total_cost = calculate_storage_cost(backup_size, cost_per_gb)    total_cost_weeks = total_cost * weeks    return "The total storage needed for backup is {} GB and the total cost for {} weeks is ${} dollars".format(backup_size, weeks, total_cost_weeks) # Positive number checker, will not process if not positive or valid numberdef get_positive_number(prompt):    while True:        try:            value = float(input(prompt))            if value <= 0:                print("Please enter a positive number.")            else:                return value        except ValueError:            print("Please enter a valid number.") # User enter data size, back up frequency, cost per gb and timedata_size = get_positive_number("Enter the data size (in gigabytes): ")backup_frequency = get_positive_number("Enter the backup frequency: ")cost_per_gb = get_positive_number("Enter the cost per gigabyte: ")weeks = get_positive_number("Enter the number of weeks: ") # Call up storage functionresult = storage_info(data_size, backup_frequency, cost_per_gb, weeks)print(result)

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
icon
Related questions
Question
100%

I have a working code, but seems to be missing where to add the floating decimal point with changing the entire line. Please see the below as I am looking to get the end result to be $56.00 not $56.0 and seems that I am missing a piece there.

# Calculate total amount storage, frequency for a week
def calculate_backup_size(data_size, backup_frequency):
     return data_size * backup_frequency
    
# Calculate storage cost for backup storage, cost per gb 
def calculate_storage_cost(backup_size, cost_per_gb):
     return backup_size * cost_per_gb

# Calculate the backup size, total,cost, cost per gb
def storage_info(data_size, backup_frequency, cost_per_gb, weeks):
    backup_size = calculate_backup_size(data_size, backup_frequency)
    total_cost = calculate_storage_cost(backup_size, cost_per_gb)
    total_cost_weeks = total_cost * weeks
    return "The total storage needed for backup is {} GB and the total cost for {} weeks is ${} dollars".format(backup_size, weeks, total_cost_weeks)

# Positive number checker, will not process if not positive or valid number
def get_positive_number(prompt):
    while True:
        try:
            value = float(input(prompt))
            if value <= 0:
                print("Please enter a positive number.")
            else:
                return value
        except ValueError:
            print("Please enter a valid number.")

# User enter data size, back up frequency, cost per gb and time
data_size = get_positive_number("Enter the data size (in gigabytes): ")
backup_frequency = get_positive_number("Enter the backup frequency: ")
cost_per_gb = get_positive_number("Enter the cost per gigabyte: ")
weeks = get_positive_number("Enter the number of weeks: ")

# Call up storage function
result = storage_info(data_size, backup_frequency, cost_per_gb, weeks)
print(result)

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education