# The world criticizes the US for using the old English system of measurements # instead of the metric system. In fact, not every aspect of the imperial # system is flawed compared to metric. At least our units of volume # are arguably superior to metric measurements: two cups = one pint; # two pints = one quart, four quarts = one gallon (and two quarts is a # half-gallon). This system is BINARY! It is base-2 instead of base-10. # Your assignment is to write a program that takes a number of quarts, # pints and cups and convert it to the most efficient representation. # By this I mean, for example, if the input is 1 quart, 3 pints and # 5 cups, you want to convert that to 3 quarts, 1 pint and 1 cup. # if the input is 0 quarts, 1 pint and 3 cups, you want to convert that to # 1 quart, 0 pints and 1 cup. Note that in the most efficient representation # (one that uses the larger units when possible) the numbers of pints and # cups is always 0 or 1. # hint: x%y returns the remainder after dividing x by y. So x % 2, for example, # is always either 0 or 1. q,p,c = input("Enter number of quarts, pints and cups: ") # write your program to do the conversion. Suggestion: use new variables # qa, pa, and ca to represent the answer; don't reuse the original variables. # Sample output: # Enter number of quarts, pints and cups: 1,3,5 # This is equal to 3 quarts 1 pint and 1 cup # Enter number of quarts, pints and cups: 0,1,3 # This is equal to 1 quart 0 pints and 1 cup ## Note that my output uses the plural or singlar forms correctly. # Can you do that too? This is additonal refinement is to be regarded as # a challenge (it is optional).