nerdexam
Python_Institute

PCEP-30-02 · Question #304

The ABC Video company needs a way to determine the cost that a customer will pay for renting a DVD. The cost is dependent on the time of day the DVD is returned. However, there are also special…

The correct answer is A. XXX --> == 'n' YYY --> == 'Sunday' ZZZ --> == 'Thursday'. See the full explanation below for the reasoning.

Question

The ABC Video company needs a way to determine the cost that a customer will pay for renting a DVD. The cost is dependent on the time of day the DVD is returned. However, there are also special rates on Tuesdays and Sundays. The fee structure is shown in the following list: - The cost is $1.59 per night. - If the DVD is returned after 8 PM, the customer will be charged an extra day. - If the video is rented on a Sunday, the customer gets 30% off for as long as they keep the video. - If the video is rented on a Thursday, the customer gets 50% off for as long as they keep the video. You need to write code to meet the requirements.

ABC Video, DVD Rental Calculator

ontime = input('Was the video returned before 8 pm? y or n').lower() days_rented = int(input('How many days was the video rented?')) day_rented = input('What day was the video rented?').capitalize() cost_per_day = 1.59 if ontime XXX: days_rented += 1 if day_rented YYY: total = (days_rented * cost_per_day) * .7 elif day_rented ZZZ: total = (days_rented * cost_per_day) * .5 else: total = (days_rented * cost_per_day) print('Cost of the DVD rental is: $', total) What should you insert instead of XXX, YYY and ZZZ?

Options

  • AXXX --> == 'n' YYY --> == 'Sunday' ZZZ --> == 'Thursday'
  • BXXX --> == 'y' YYY --> == 'Sunday' ZZZ --> == 'Thursday'
  • CXXX --> == 'n' YYY --> is 'Sunday' ZZZ --> is 'Thursday'
  • DXXX --> != 'n' YYY --> is 'Sunday' ZZZ --> is 'Thursday'
  • EXXX --> == 'y' YYY --> == 'Sunday' ZZZ --> == 'Thursday'

How the community answered

(28 responses)
  • A
    86% (24)
  • B
    4% (1)
  • C
    4% (1)
  • E
    7% (2)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice