Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

program is pycharm Part I: Calculate the cost of a Custom License Plate (10 points) Write a function license plate.cost() that determines the cost of

image text in transcribed program is pycharm
image text in transcribed
Part I: Calculate the cost of a Custom License Plate (10 points) Write a function license plate.cost() that determines the cost of a custom license plate according to the rules described below. The function takes one argument: plate: a string that provides the contents of the license plate The price of the license plate is calculated according to the following rules: A license plate is guaranteed to have at least 4 alphanumerical characters. The base cost of a license plate CSE 101 - Spring 2020 Homework #2 is $4. Your function may assume that every string has at least 4 characters. People can increase number of characters in the license plate up to 7. For every character beyond 4, add $2 to the cost. If the license plate contains the same character in the first and last positions, add $2 to the cost. If the license plate does not contain the same character in the second and second-to-las the cost If the license plate starts with a 'Q', add $4 to the cost. . Only alphanumerical characters may be used in a license plate. You may assume that the function argument is always valid and contains 4, 5, 6 or 7 alphanumerical characters. Note: a loop is not needed to solve this problem. Just write a multi-way if-state Examples: 11 Function Argument Return Value "ABCD" "ABCD12" "ABCD1A" 13 "A1CD1A" "QBCD1A" 15 "QBCD21A" 17 10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a SIMPLE 401(k) plan?

Answered: 1 week ago