Answered step by step
Verified Expert Solution
Question
1 Approved Answer
During the Roman Imperial Period from 27 BC until 476 AD, the following coins were used. The base unit of currency was the As.
During the Roman Imperial Period from 27 BC until 476 AD, the following coins were used. The base unit of currency was the As. All other coins are mesaured relative to each other. Name Quadrans Semis Denarius: 0 Quinarius: 0 Sestertius: 0 Dupondius Sestertius Dupondius: 1 As: 1 Semis: 0 Quadrans: 0 Quinarius Denarius Antoninianus Gold Quinarius Aureus Part 1: Example 1 Enter Number of Quadrans: 12 Aureus: 0 Gold Quinarius: 0 Antoninianus: 0. Write a program that takes as input the number of Quadrans a person has in their account. This number is always an integer because there is no smaller currency than the Quadrans. Then print out the minimal number of coins that can be used to represent this amount. Start with the largest value currency and work down to the smallest. For example, if the user has 12 Quadrans, this is 1 Dupondius and 1 As. Relative Value 1/2 a Semis 1/2 an As Base Unit 2 Asses 2 Dupondii 2 Sesterii 2 Quinarii 2 Denarii 25 Quinarii 25 Denarii Part 1: Example 2 Enter Number of Quadrans: 21432 Aureus: 13 Gold Quinarius: 0. Antoninianus: 4 Denarius: 1 Quinarius: 1 Sestertius: 1 Dupondius: 1 As: 0 Semis: 0 Quadrans: 0 Part 1: Example 3 Enter Number of Quadrans: 2655 Aureus: 1 Gold Quinarius: 1 Antoninianus: 1 Denarius: 1 Quinarius: 1 Sestertius: 1 Dupondius: 1 As: 1 Semis: 1 Quadrans: 1 Part 2: Working With Function Functions are a key tool for designing functions. In this part of the assignment, you will create three functions and use them to create a number of output. All values you work with in this part will be integers. The three functions you need to create are: f(x) = 2x - 7 g(x, y) = x - - Y Part 2: Working With Function Functions are a key tool for designing functions. In this part of the assignment, you will create three functions and use them to create a number of output. All values you work with in this part will be integers. The three functions you need to create are: f(x) = 2x - 7 g(x, y) = x y h(x) = 2x + 3x +9 You must implement these are three Python functions. 2 Ask for two values from the user. Both values will be integers. Compute the following values using your three functions and the two values give. Call the first value a and the second value b. f(a) f(b) g(a, b) g(b, a) h(a) h (b) f(h(a)) h(f(b)) g(f(a), h(b)) g(h(a), f(b)) Print out all the values you compute. Part 2: Example 1 Enter Value 1: 10 Enter Value 2: 12 f(10)=193 f(12)=281 g(10,12)=988 g(12,10)=1718 h(10)=239 h(12)=333 f(h (10))=114235 h(f (12))=158774 g(f (10),h(12))=7188724 g(h(10), f(12))=13651638 Part 2: Example 2 Enter Value 1: 1 Enter Value 2: 9 f(1) =-5 f (9)=155 g(1,9)=-8 g(9,1)=728 h(1)=14 h (9) 198 f(h(1))-285 if "___main__": # Introduction print('Compute the change due after paying for an item') print('') name == # Get Input From the User amountPaid = float(input("Enter Amount Paid (10.00): ")) amountDue = float(input("Enter Amount Due (9.99): ")) # Constants need for conversion CENTS_PER_DOLLAR = 100 CENTS_PER_QUARTER = 25 CENTS_PER_DIME = 10 CENTS_PER_NICKEL = 5 # First convert the amount paid and the amount due to cents amount Paid = int(amountPaid * 100) amountDue = int(amountDue* 100) # Computer the difference in cents. That is the chane due. change = amount Paid amount Due # Calculate how many dollars dollars change = change // CENTS_PER_DOLLAR change % CENTS_PER_DOLLAR
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started