Reference no: EM132609571
CP1401 Fundamentals of Problem Solving and Programming - James Cook University
Task:
For this assessment, you are to plan and then code 3 separate console-based programs in Python 3. This assignment is designed to help you build skills using:
1. Pizza Pay Calculator: Input, Processing and Output
2. Superhero Results: Decision structures
3. Hiking Tracker: Repetition structures
Do not define any of your own functions or use any code constructs that have not been taught in this subject. 100% of what you need to know to complete this assignment successfully is taught in the lectures and practicals.
Each program should be written in a separate Python file with the prescribed file name.
Each file should follow the structure provided below by example. That is, each file should start with a module docstring comment at the very top containing your own details and your pseudocode, then your solution code should follow. Replace the parts in <brackets>, which are there to show you where to put your details and work.
Coding Requirements and Suggestions:
• We suggest you work incrementally on these tasks: focus on completing small parts rather than trying to get everything done at once.
• Sample output from the programs are provided with each program description.
Ensure that your programs match these, including spacing, spelling, etc.
Think of this as helpful guidance as well as training you to pay attention to detail. The sample output is intended to show a full range of situations so you know how the programs should work. It should be obvious what parts of the samples are user input.
• You do not need to handle incorrect types in user input. E.g. if the user is asked for the number of minutes and enters "none" instead of an integer, your program should just crash. That's fine.
• Make use of named constants as appropriate, e.g. for things that would otherwise be "magic numbers", like pay rates or maximum distance.
• You are expected to include appropriate comments in each of your programs (not just the module docstring). Use # block comments on their own line for things that might reasonably need a comment. Do not include unnecessary or many comments as these are just "noise" and make your program harder to read.
• Check the rubric below carefully to understand how you will be assessed. There should be no surprises here - this is about following the best practices we have taught in class.
Program 1 - Pizza Pay Calculator:
Learning outcome focus: Input, Processing, Output
File name: a1_1_pizza_pay_calculator.py
Warm Pizza is a new company revolutionising the pizza home delivery experience by paying its drivers by the trip and minute.
(The faster drivers go, the more trips they can do, but the fewer minutes they get paid for. Interesting...) This program is a simple calculator for pizza delivery drivers to calculate their pay for a shift based on how many trips they do and how long they drive for.
Warm Pizza pays $1.45 per trip and $0.95 per minute.
Note: there is no looping or error-checking in this program.
The sample output below shows the currency values displayed with two decimal places. This can be achieved using string formatting, like:
print(f"Money be like ${value:.2f}")
Sample Output from 2 different runs:
Warm Pizza Pay Calculator Number of trips: 17
Number of minutes: 2
For 17 trips, your pay is: $24.65 For 2 minutes, your pay is: $1.90 Your total pay is $26.55
Warm Pizza Pay Calculator Number of trips: 7
Number of minutes: 93
For 7 trips, your pay is: $10.15 For 93 minutes, your pay is: $88.35 Your total pay is $98.50
Program 2 - Superhero Results:
Learning outcome focus: Decision Structures
File name: a1_2_superhero.py
This program helps determine the fate of trainee superheroes. Trainee superheroes enter their test scores for strength and smarts. The system then determines their results.
Trainees fail if the total of their two scores is under 50. If they pass, then they can either become:
- a super smasher, if their strength score is greater than or equal to their smarts score
- a super spy, if their smarts score is greater than their strength score If a trainee's total score is 90 or greater, they make the elite squad.
Program 3 - Hiking Tracker:
Learning outcome focus: Repetition Structures
File name: a1_3_hiking.py
This program helps hikers keep track of how far they have walked per day.
Hikers will be asked for the number of days they hiked, then the distance hiked for each of those days. When this is entered, the program will tell them the total and average distance as well as whether last day was above/below/equal to the average distance.
Number of days and each distance must be error checked (following the pattern you have been taught). There is no maximum number of days, but the minimum is 1.
Attachment:- Fundamentals of Problem Solving and Programming.rar