A2 Project Description – Tropical Autos Implementation You are required to implement your plan from Assignment 1 using Python 3. The basic requirements for this program are given below, and there are...

the question for assignment is in file uploaded


A2 Project Description – Tropical Autos Implementation You are required to implement your plan from Assignment 1 using Python 3. The basic requirements for this program are given below, and there are some additional behaviours that have been added. Basic Functionality A car rental company has asked you to write a program to help calculate the rates per day for renting various cars in their fleet. Your program should ask the user what type car they want, for how many days, whether they require a GPS, whether they need insurance and the age of the renter. If the renter is younger than 25 he/she will be charged a "youth tax" of 30%. Use the table below for the data that the program will use: Car rental rates per day: $25 – compact car $35 – larger sedan style car $45 - SUV $100 – Hummer (HumV military style vehicle) Insurance per day: Compact - $5 Full Size - $10 SUV - $15 Hummer - $40 GPS per day $5 per day Age of driver Under 25 – additional 30% per day Your program should greet the user, ask them what type of car they want, whether they want insurance, ask how many days is the rental, ask their age and whether they want to rent a GPS. Then it should tell the user the total for the entire rental period. Additional Behaviours 1 – Data Validation All user inputs MUST be validated. The requirement for each input are listed below: Input Requirement Name Cannot be blank Type of car Must be “C”, “F”, “S”, or “H”. Upper and lower case are both accepted Insurance wanted Either “Y” or “N”. Upper and lower case are both accepted GPS wanted “Y” or “N”. Upper and lower case are both accepted Age Must be 18 or greater. Non-numerical inputs do NOT need to be checked Number of days Must be 1 or more. Non-numerical inputs do NOT need to be checked 2 – GST included Once all details have been entered, and the total cost calculated, we need to add 10% GST. This is then added to the total cost of the rental. 3 – Invoice An additional function is required to display the invoice to the customer. This invoice needs to display the following information: Name Car Type Daily Rental Fee Daily Insurance Fee Daily GST Fee Daily Age Tax Number of Days requested Total Cost, excluding GST GST Total Cost, including GST General Principles: In this assignment, you will be focusing on implementation using selections, repetition, and functions. Lists may be used where they make sense. Use the techniques and patterns that you have learned and seen demonstrated in class. · Coding standards: · Variables: · Wherever possible, variables should be set at the top of the function · Although Python does not use constants you may set variables to values that will remain the same for the life of the program. These should be named in all caps · You should be able to modify these variables to adjust the various values of items. This is an important aspect of this assignment, so consider carefully how to use constants. Remember to use these variables everywhere you can. · You will need to decide the best position to place these variables. · You should AVOID the use of global variables unless they are needed in multiple places in the application · In other words, you should pass the values to any functions that need them and any constants only needed in one function should be ONLY in that function · Identifier Names · Variables should be named appropriately using either camelCase or under_scores · No variables should be a single character such as “x” or “y” unless they are used in a loop as an index. Variable names should be meaningful, and describe their use and/or purpose · Any list variable should be named with plurals to show multiple data is held (e.g. prices versus price) · Function names should begin with a verb (they are active), for example getValue() is better than value(). Good verbs include – ‘get’, ‘display’, ‘calculate’, ‘check’ etc (not all these are good for this problem...) · Comments: · You will need to add at LEAST one comment for each function that you define including main · The comment should either be placed directly above or below the function header · The comment should describe: (a) the purpose of the function, (b) any inputs and (c) any returned values · Additional comments should be placed at any position where the functionality of the program may be unclear · All code MUST be properly indented · Output · Make your output display all required information, and use formatting to make your final invoice look appealing. · Use Google to find out how to display tabs and other special characters using Python 3, or how to display things at a set width · Python Functions · Check out https://docs.python.org/3/ and look up: · ‘upper’ or ‘lower’ to see case conversion functions Submission: You are to submit a single Python 3 code file (*.py). Name this file LastnameFirstnameA2.py (e.g. if your name were Miles Davis, the filename would be DavisMilesA2.py) This file is to be submitted to the dropbox for your campus, or enrolment mode, on LearnJCU. Sample output from the program is listed below. The words in red are only labels, they are not part of the program Output: Welcome to Tropical Autos. Output: Please enter your name. Input: Dianna Output: Please enter your age. Input: 18 Output: How many days would you like to rent the vehicle? Input: 5 Output: What type of car would you like to rent? Choose one: (C)ompact, (F)ull Size, (S)UV or (H)ummer Input: H Output: Would you like a GPS? (y/n) Input: Y Output: Would you like insurance? (y/n) Input: y Output: Calculating your quote…please wait. Output: Your order is listed below: Output: Name: Dianna Output: Rental period: 5 days Output: Rental type: Hummer Output: Base rental: $100/day Output: GPS: $5/day Output: Insurance: $40/day Output: Youth tax: $43.50/day Output: Total: $942.50 ex.GST Output: GST: $94.25 Output: Total: $1036.75
Oct 10, 2020
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here