Question
(+10 ) Problem #14 in the Chapter review problems on Page 199 Answer a provided a. 5.18.35 b. c. (+10 ) Problem #15 in the
(+10 ) Problem #14 in the Chapter review problems on Page 199
Answer a provided
a. 5.18.35
b.
c.
(+10 ) Problem #15 in the Chapter review problems on Page 199
Answer c provided
a.
b.
c. 0000 1000 0000 1100 0001 0100 0000 1101
(+10 ) Convert the following twos complement representations to its equivalent base 10 value. Recall if the most significant bit is a 1 the number is negative
1101110 _______
0110110 ________
(+5 ) The entire URL required to retrieve the Web document named bulldogs.html from the Webserver at animals.org assuming that the document is stored in the directory named dogs:
a. https://animals.org/dogs/bulldogs.html
b. http://animals.org/dogs/bulldogs.html
c. http://dogs.animals.org/bulldogs.html
d. http://animals.org/dogs.bulldogs.html
(+5 ) Can the following 2s complement calculation be performed using 6 bits?
32 - 31
a. Yes the result is 000001
b. No, -31 cannot be expressed using 6 bits
c. No 32 cannot be expressed using 6 bits
d. Yes the result is 000011
(+5 ) Can the following 2s complement calculation be performed using 4 bits?
-8 + 7
a. Yes the result is 1111
b. Yes, the result is 0001
c. No -8 cannot be expressed using 4 bits
d. No 7 cannot be expressed using 4 bits
---
(+20) Provide a python program to determine the parking fees at the airport based on the following time constraints :
Any amount of time less than or equal to one hour, the parking fee is 5.00. This means if your parked for 5, 15, 55 or 60 minutes you pay $5.00
Minutes parked | Hrs*Fee=parking fee |
25 minutes (0 hour and 25 minutes) | 1*5.00 |
05 minutes (0 hour and 5 minutes) | 1*5.00 |
55 minutes (0 hours and 55 minutes) | 1*5.00 |
30 minutes (0 hour and 30 minutes) | 1*5.00 |
10 minutes (0 hour and 10 minutes) | 1*5.00 |
60 minutes (1 hour and 0 minutes) | 1*5.00 |
Any amount of time greater than one hour but less than or equal to 5 hours (300 minutes), the parking fee is 4.00 per hour and any fraction thereof. This means:
Minutes parked | Hrs*Fee=parking fee |
65 minutes (1 hour and 5 minutes) | 2*4.00 |
95 minutes (1 hour and 35 minutes) | 2*4.00 |
120 minutes (2 hours) | 2*4.00 |
135 minutes (2 hour and 15 minutes) | 3*4.00 |
180 minutes (3 hour and 0 minutes) | 3*4.00 |
195 minutes (3 hour and 15 minutes) | 4*4.00 |
240 minutes (4 hours) | 4*4.00 |
260 minutes (4 hours 20 minutes ) | 5*4.00 |
300 minutes (5 hours) | 5*4.00 |
Any amount of time greater than 5 hours, the parking fee is 2.00 per hour and any fraction.
Minutes parked | Hrs*Fee = parking fee |
320 minutes (5 hour and 20 minutes) | 6*2.00 |
400 minutes (6 hour and 40 minutes) | 7*2.00 |
800 minutes (13 hour and 20 minutes) | 14*2.00 |
825 minutes (13 hour and 45 minutes) | 14*2.00 |
600 minutes (10 hours) | 10*2.00 |
Use the following test cases to make sure the results of your code are as expected
Minutes parked Cost
Suggested template PLEASE modify as needed :
rate1 = 5 # $5 rate rate2 = 4 # $4 rate rate3 = 2 # $2 rate #various calculations using ROUND, INT % / // functions and operators
#these calculations can be removed from your final code
Illustrative purposes only REMOVE from your code if NOT needed
x = round(25.3456, 1) print("1 x == ", x) x1 = round(25.3456, 2) print("2 x1 == ", x1) y = int(24.88) print("3 y == ", y) z = 174 % 60195 print("4 Z == ", z) a = 33/60 print("5 a == ", a) b = 33//60 print("6 b == ", b)
fee = 0.0 # initialize m = int(input(" Please enter number of minutes parked...")) if (0 < m and m <= 60 ): #table 1 hrs = int(m/60) + 1 fee = hrs*rate1 print("Parking fee for ", m, " minutes is $", fee) # now for table 2 elif (m > 60 and m <= 300): # table 2 # calculations needed print('we are in table 2 fee is ', fee) elif ( m > 300): # table 3 #calculations needed print('we are in table 3 fee == ', fee) else: print("error negative minutes", m )
1 x ==25.3
2 x1 ==25.35
3 y ==24
4 Z ==54
5 a ==0.55
6 b ==0
Please enter number of minutes parked...
we are in table 2 fee is0.0
:
: minutes parked
: Parking fee
Your program should ask the user for minutes parked, use the various functions/operators as needed to determine in which table 1, 2 3 the minutes falls into, compute and output the parking fee
Let m = minutes parked
fee = parking fee
Please make sure your code uses the constants:rate1 rate2 rate3
Once you have determined your algorithm, try it for several of the minute examples provided in the tables above for accuracy
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