Question

PYTHON 3.7 Write an ALGORITHM/PROGRAM to find the number of pictures that can be stored on...

PYTHON 3.7 Write an ALGORITHM/PROGRAM to find the number of pictures that can be stored on a flash drive. Assume all the pictures to be stored have the same resolution and color depth. Please take this stuff into account: https://imgur.com/a/apsXus3

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the required script as the following:

#==============================================

import math;

print('Please provide the resolution of the image: ');

imw=int(input('Width of the image (in pixels): '));

imh=int(input('Height of the image (in pixels): '));

cdepth=int(input('Please provide the color depth of the image (bytes per pixel): '));

fsize=int(input('Please provide the size of the flash drive in GB: '));

print('The number of image files that can be stored on the flash drive are: ',int((fsize*math.pow(2,30))/(imw*imh*cdepth)));

#================================================

sample run:

Please provide the resolution of the image:
Width of the image (in pixels): 100
Height of the image (in pixels): 200
Please provide the color depth of the image (bytes per pixel): 3
Please provide the size of the flash drive in GB: 2
The number of image files that can be stored on the flash drive are: 35791

Add a comment
Know the answer?
Add Answer to:
PYTHON 3.7 Write an ALGORITHM/PROGRAM to find the number of pictures that can be stored on...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Can you help me write a Python 3.7 code for this question? Write a program using...

    Can you help me write a Python 3.7 code for this question? Write a program using functions and mainline logic which prompts the user to enter a number, then generates that number of random integers and stores them in a list. It should then display the following data to back to the user: The list of integers The lowest number in the list The highest number in the list The total sum of all the numbers in the list The...

  • Use Python 3.7 to write the following program: Given a list of n numbers, write a...

    Use Python 3.7 to write the following program: Given a list of n numbers, write a function to shift the numbers circularly by some integer k (k < n). The function should take a list, the amount to shift k, and an argument specifying the direction to shift (left or right). Suggestion: use the % operation and also you need a number between 0 inclusive and the length of the list.

  • Write the PYTHON code that displays the following numbers: The program should have a header that...

    Write the PYTHON code that displays the following numbers: The program should have a header that displays "Number   Doubled Tripled" above the start of the numbers. If putting all numbers on the same line, then they will need to be separated so you can see he individual number.(https://www.programiz.com/python-programming/methods/built-in/print) The program should display Every whole number from 1 through 35. The program should display that number doubled. The program should also display that number tripled. Make a working version of this...

  • Write a Python program stored in a file q2.py that asks for a starting number and...

    Write a Python program stored in a file q2.py that asks for a starting number and an ending number, and then prints all the Fibonacci numbers between them (and including the starting and ending numbers, if they are also Fibonacci numbers). Each Fibonacci number, must be separated by a space. Example: Enter starting number : 5 Enter ending number : 500 10 Fibonacci numbers between 5 and 500 are : 5 8 13 21 34 55 89 144 233 377

  • Write an Intel 8085 assembly program to find the largest of N numbers stored in memory...

    Write an Intel 8085 assembly program to find the largest of N numbers stored in memory using the algorithm below. Hand trace (execute) the program showing the changes made to all affected registers and memory locations. Max = a(1) For i = n to N If max < a(i) then max = a(i) Next i It is important for me to see the Hand Trace so i can understand the program. With out the trace the answer is incomplete.

  • Write a PYTHON program that does the following: (instructions in the picture) Please use a 3.5...

    Write a PYTHON program that does the following: (instructions in the picture) Please use a 3.5 version; You can use this website to write the code and then share the link here; because if you write the code and post here, it will have a problem with the indentations https://repl.it/languages/python3

  • Number Comparison: Write a program in PYTHON that compares three numbers and displays the following: Check...

    Number Comparison: Write a program in PYTHON that compares three numbers and displays the following: Check if they are all the same, all different, or neither. Determine if 3 numbers are in increasing order, decreasing order, or neither. Find the highest and lowest number.

  • Write a program that asks the user to enter 1000 integers to be stored in an...

    Write a program that asks the user to enter 1000 integers to be stored in an array called "numbers". Since the same integer might occur (exist) in the array multiple times, your program needs to fill a second array, called "Isolate" that contains all the integers from the first array but NOT REPAPTED (every integer will exist only once). Finally, your program will print the integers of the second array sorted by occurrence (occurrence is: the number of times the...

  • Write a python program that will create a histogram of the number of times each character occurs ...

    Write a python program that will create a histogram of the number of times each character occurs in a file. Check https://en.wikipedia.org/wiki/Histogram and http://interactivepython.org/runestone/static/thinkcspy/Functions/ATurtleBarChart.html for help. Your program will read any input text file and print the histogram. If you have a huge file you should have a graph similar to: Note the y-axis shows the percentage of each letter. The height of each bar is percentage of that letter. Program MUST show the graph with percentage marks on y-axis...

  • Motorola MC68000 Please Problem 3) Write a Motorola program that calculates X (a 16bit number stored in memory) raised to the Y (a 8bit number stored in memory) power. The prograri should have a whil...

    Motorola MC68000 Please Problem 3) Write a Motorola program that calculates X (a 16bit number stored in memory) raised to the Y (a 8bit number stored in memory) power. The prograri should have a while repetition control structure. Problem 3) Write a Motorola program that calculates X (a 16bit number stored in memory) raised to the Y (a 8bit number stored in memory) power. The prograri should have a while repetition control structure.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT