Python辅导 | MIS 740 Software Concepts

Page 1 of 3
MIS 740: Software Concepts
Fall 2019
Individual Assignment 3
Due Date: 5:29 PM, October 24, 2019 (Submit via WebCampus).
Weight: 5% of the total grades
Purpose:
 Practice the use of list in the program
 Get familiar with the application of dictionary in the program
 Practice the manipulation of strings in the program
 Practice the design of functions, including passing variables and returning value.
1. Joe’s Automotive (50 %): Joe’s automotive offers maintenance services. Please develop a program that
provides a service quote based on the selected services.
The price of each service is listed below. A customer can choose any number of services.
oil change $26
lube job $18
radiator flush $30
transmission flush $80
inspection $15
muffler replacement $100
tire rotation $20
Joe has special service contracts with a few brands (Acura, Honda, Infiniti, Lexus, Mazda, Mitsubishi,
Nissan, Subaru, Suzuki, and Toyota). If the car in service is one with a contract, a 10% discount will be
applied to the total price. The application should show the breakdown of the charges (including discounts
applied), as well as the total of the service quote.
When the user enters a service twice, show a message and do not add the service again. When a service not
on the list is entered, show a message and do not add the service. The user can enter the service name and
brand name in either lowercase, uppercase, or mix-case. If the user does not enter any services, show a
message indicating the situation.
Page 2 of 3

Grading criteria:
Correctness:
 The code can be executed without any syntax error.
 The code can generate the requested results, including the function
 The program is properly documented using comments, including the header (i.e., the purpose of the
program, author name, and date) and in-code comments.
Technique used:
 Use list in the program to represent the brands with a special contract.
 Use dictionary in the program to represent the services and prices.
 Use variables in the program and follow the naming conventions discussed in class.
 Use the in/ not in operator for list and/or dictionary.
 Align the result properly.
 Design and use function(s) in the program.
 The user’s input is handled properly as requested.
Page 3 of 3
2. Room Rate Checker (50 %): The Happy Resort needs an application to check the room rate for the guests.
The front desk agent would enter the room number to get the price of the room per night. Each room at the
Happy Resort is identified by a 4-character room number. The first character is either the letter L or the letter
N. The letter L indicates that the room is a luxury type, and letter N is for a normal type room. The last
character is either K or S. K indicates that the room is one with a kitchen, and S indicates that the room is one
without kitchen. The based rate of a room is $60 per night. A luxury room costs $20 more per night and a
room with kitchen costs $10 more per night. The second character represents the floor; for rooms above 3th
floor, charge $30 more per night. For example, room L34K is $90 per night, N80S is $90 per night, L25S is
$80 per night, and N17K is $70 per night.
When user enters the room number, the program should verify the format of the data entered, including the
first, second and last characters of the room number, as well as the length of room number. If format of room
number entered is not correct, show an error message and prompt the user to enter again.
If the format of room number is correct, program should determine the room rate. Use a function with return
value to determine the room rate based on the room number.
Grading criteria:
Correctness:
 The code can be executed without any syntax error.
 The code can generate the requested results, including the function
 The program is properly documented using comments, including the header (i.e., the purpose of the
program, author name, and date) and in-code comments.
Technique used:
 Use tuple to represent the room rates for different types of rooms.
 Use variables in the program and follow the naming conventions discussed in class.
 User input validation is done with the proper message shown to the user.
 Design a function to calculate the room rate.