100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

COP1000C Unit 2 Assignment

Rating
-
Sold
-
Pages
1
Uploaded on
23-04-2025
Written in
2023/2024

Create a program. Write a program that requests the download speed in megabits per second (Mbs) and the size of a file in megabytes (MB). The program should calculate the download time for the file. Note that in this context one byte is eight bits. Use type float, and use / for division. The program should report all three values (download speed, file size, and download time) showing two digits to the right of the decimal point, as in the following: At 18.12 megabits per second, a file of 2.20 megabytes downloads in 0.97 seconds.

Show more Read less








Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
April 23, 2025
Number of pages
1
Written in
2023/2024
Type
Other
Person
Unknown

Content preview

Unit 2 Assignment

Creating a program that request the download speed in megabits per second and the
size of a file in megabytes.


Algorithm
1. request the download speed in megabits per second
2. Request the file size in megabytes
3. Convert file size from MB to megabites
4. Calcuate the download time in seconds
5. Display the download speed, file size, and download time with two decimal
places
"""


def main():
#Request the download speed in megabits per second
download_speed = float(input("Enter the download speed (Mbs):"))


#Request the file size in megabytes
file_size = float(input("Enter the file size (MB): "))


#Convert file size from MB to megabites
file_size_in_bits = file_size * 8


# Calcuate the download time in seconds
download_time = file_size_in_bits/download_speed


#Display the download speed, file size, and download time with two decimal places
print(f"Download speed: {download_speed:.2f} Mbs")


print(f"File size: {file_size:.2f} MB")


print(f"Download time: {download_time:.2f} seconds")



main()

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
byrena
View profile
Follow You need to be logged in order to follow users or courses
Sold
10
Member since
2 year
Number of followers
8
Documents
6
Last sold
1 month ago

3.5

4 reviews

5
1
4
1
3
1
2
1
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions