Question: Write a Python program named mb_convert_firstname that converts the storage in mega bytes(MB) into Bytes, KiloBytes(KB), GigaBytes(GB) and TerraBytes(TB). In this file there should be

Write a Python program named mb_convert_firstname that converts the storage in mega bytes(MB) into Bytes, KiloBytes(KB), GigaBytes(GB) and TerraBytes(TB). In this file there should be four methods defined. Write a method named conv_byte_firstName, which accepts the megabytes(MB) as an argument into the function. The method should compute the storage in bytes and return the storage in bytes. The formula for calculating the bytes from MB is given below. Write a method named conv_KB_firstName, which accepts the megabytes(MB) as an argument into the function. The method should compute the storage in KiloBytes(KB) and return the storage in kilobytes. The formula for calculating KB from MB is given below. Write a method named conv_GB_firstName, which accepts the megabytes(MB) as an argument into the function. The method should compute the storage in GigaBytes(GB) and return the storage in GigaBytes. The formula for calculating GB from MB is given below. Write a method named conv_TB_firstName, which accepts the megabytes(MB) as an argument into the function. The method should compute the storage in TerraBytes(TB) and return the storage in TerraBytes. The formula for calculating TB from MB is given below. Now Write a Python program named menu_firstname that asks the user to convert storage from MB into other storage units. The program will then present the following menu of selections: Convert to Bytes Convert to KiloBytes (KB) Convert to GigaBytes(GB) Convert to TerraBytes(TB). Quit the program The program will convert the data in MegaBytes(MB) to bytes, kilobytes(KB), GigaBytes(MB), or TerraBytes(TB), depending on the users selection rounded to six decimals. Here are the specific requirements: Write a void method named menu_firstName that displays the menu of selections. This method should not accept any arguments. This program should import mb_convert_firstname and should be able to use the functions from that file to do the conversion. Write a valid_input function in the menu file which takes one argument and returns True if the input is greater than 0. The program should continue to display the menu until the user enters 5 to quit the program. If the user selects an invalid choice from the menu, the program should display an error message. Based on the option entered, corresponding convert function from the other file is invoked and the storage is displayed by the Menu program. For example if option 4 is entered, the menu program should ask for the storage in MB Make sure that the input is a positive number greater than 0 by calling the valid_input function in the Menu file which returns True if the input is greater than 0. This valid_input function can be reused for all inputs. Once the input is validated, it calls the conv_TB_firstName function in the other file which returns the converted value. The storage in TB is displayed. Format the TB output to six decimals As usual submit the two files in the form of a zip file Add comments to show what each function does. Use if __name__ == "__main__": main() Here are the formula used for storage conversion: 1 GB = 1024 MB 1 MB = 1024 KB 1 KB = 1024 Bytes 1TB = 1024 GB.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!