Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please fix this code and put as many comments as possible. i attached the desired output as the last photo. #code to calulate flop units

please fix this code and put as many comments as possible. i attached the desired output as the last photo.


student submitted image, transcription available below

student submitted image, transcription available below

student submitted image, transcription available below 

#code to calulate flop units (kilo,mega etc) transistors int(input("Starting number of transistors: ")) flops = transistors 50 flops_unit - flops unit_count = 0 unit "flops" while flops unit > 1000: flops_unit flops unit/1000 unit_count unit_count +1 if unit_count == 1: unit "KiloFLOPS" elif unit_count == 2: unit "megaFlops" elif unit_count == 3: unit "gigaFlops" elif unit_count == 4: unit "teraFlops" elif unit_count == 5: unit "petaFlops" elif unit_count == 6: unit "exaFlops" elif unit_count == 7: unit "zettaFlops" elif unit_count == 8: unit "yottaFlops" elif unit_count == 0: unit "Flops" rounded_flops =round(flops_unit,2) #Initialize variables year = input("Starting Year: ") num years input("Total number of Years: ") print() print("YEAR : TRANSISTORS: FLOPS : ") Convert input to integers transistors = int (transistors) year =int(year) num years int(num_years) year_range= num years/2 + 1 year range int (year_range)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions