nerdexam
Python_Institute

PCEP-30-02 · Question #304

PCEP-30-02 Question #304: Real Exam Question with Answer & Explanation

Sign in or unlock PCEP-30-02 to reveal the answer and full explanation for question #304. The question stem and answer options stay visible for context.

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'

Unlock PCEP-30-02 to see the answer

You've previewed enough free PCEP-30-02 questions. Unlock PCEP-30-02 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full PCEP-30-02 Practice