Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Greeting of the Program
- print('Welcome to the "Picures on the Go" Program')
- print()
- print('This Program will determine how many images can be stored on the USB Drive, given the space offered')
- print()
- program = False
- while program == False:
- # USB Space Offered
- userUSB =int(input('Enter the amount of space on your USB Drive in Gigabytes (GB) : '))
- print()
- # Camera Resolution
- print('Please Enter the MegaPixels of your camera (8, 12, 16): ')
- # mP = input('Please Enter the camera resolution offered, in Mega Pixels: ')
- mP=input()
- if mP =='8':
- res= 3264*2448
- elif mP =='12':
- res= 4290*2800
- elif mP =='16':
- res = 4920*3264
- print()
- # Calculations
- gIFBytes = (res * 1) / 5
- pNGBytes = (res * 3) / 10
- jPEGBytes = (res * 3) / 8
- tIFFBytes = (res * 6)
- storageUSB = userUSB * 1000000000
- gIFPictures = storageUSB //gIFBytes
- pNGPictures = storageUSB //pNGBytes
- jPEGPictures = storageUSB //jPEGBytes
- tIFFPictures = storageUSB //tIFFBytes
- # Display the Results of the Calculations
- print('The amount of pictures that your USB Drive can hold is: ')
- print('For GIF Pictures', format( gIFPictures,'.2f'))
- print('For PNG Pictures', format( pNGPictures,'.2f'))
- print('For JPEG Pictures', format( jPEGPictures,'.2f'))
- print('For TIFF Pictures', format( tIFFPictures,'.2f'))
- # This section will prompt the user if they want to run the program again
- print()
- response = input("Would you like to run this program again? (y/n: )")
- response = response.lower()
- print()
- while response != 'y' and response != 'n':
- input("Please Enter 'y' or 'n': ")
- response = response.lower()
- if response == 'n':
- program = True
- elif response != 'y':
- program = False
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement