Filters

Other

D

Your name is required for this document. It is only stored on this local computer and no where else. Please enter your name below:

S3 ComputingPractical Assignment 1

DGS badge
S3 ComputingPractical Assignment 1

You will design and create a Python program for a café called Cathy’s Café. The steps of the program are:

  • Ask the user for their name.
  • Display a welcome message to the user using their name.
  • Ask the user how many smoothies they want to order.
  • Ask the user to enter the base price of a smoothie.
  • Loop for the number of smoothies.
  • Inside the loop, start with the base price for that smoothie.
  • Ask the user to enter the flavour of the smoothie and store it in a variable flavour.
  • If the flavour is banana, add a 50p charge to the price (this is also communicated to the user at this point).
  • Ask the user to enter the size of the smoothie and store it in a variable size.
  • If the size is medium or large, add an additional charge to the price (this is also communicated to the user at this point).
  • Keep a running total of the cost of all smoothies.
  • Display the details of the current smoothie (flavour, size and price).
  • After the loop, display how many smoothies were ordered and the final total price for all smoothies.

This assignment assesses your understanding of:

  • Input and output
  • Variables
  • Data types
  • if statements
  • Fixed loops
  • Flowchart design

Task 1 – Flowchart

Create a flowchart that shows the logic for a program that:

  1. Asks the user how many smoothies they want to make.
  2. Repeats a set of steps for each smoothie.
  3. Asks for the smoothie flavour.
  4. Adds an extra cost if the flavour is banana (and tell the user of this extra cost).
  5. Asks for the smoothie size.
  6. Adds an extra cost if the size is Medium or Large (and tell the user of this extra cost).
  7. Displays a final message when all smoothies are processed.
  8. Displays the smoothie details
  9. Stops the loop and displays how many smoothies were ordered and the final cost

Your flowchart must include a loop and a decision.

Task 2 – Inputs and Outputs

Write a Python program that welcomes the user by name. Your program must collect and display information in a user-friendly way.

Task 3 – Variables and Data Types

Your program must store:

  • The customer’s name (string)
  • The number of smoothies requested (integer)
  • The base price of a smoothie (float)
  • The number of medium and large smoothies requested

You must collect these values from the user and use them in later tasks.

Task 4 – Decision Making

Your program must check the size of each smoothie. If the smoothie is Medium or Large, an extra cost must be added.

Task 5 – Fixed Loop

Your program must repeat the ordering process for the number of smoothies entered by the user. Inside the loop, you must collect details for each smoothie and calculate the correct price.

Task 6 – Final Output

When all smoothies are processed, your program must display a final summary message. You may include extra details if you want (e.g., number of large smoothies).

Success Criteria

To complete this assignment successfully, your program must:

  • Use input and output
  • Use appropriate variable types
  • Include at least one if statement
  • Include at least one fixed loop
  • Produce clear and understandable output
  • Follow the logic shown in your flowchart
Output
  Enter your name: Mickey Mouse
  Welcome, Mickey Mouse!
  How many smoothies do you want to make? 3
  Enter the base price of a smoothie (£): 2.50

  Smoothie 1
  Enter smoothie flavour: Strawberry
  Enter size (Small/Medium/Large): Medium
  Extra 75p added for medium size!
  Smoothie details:
   Flavour: Strawberry
   Size:    Medium
   Price:  £ 3.25

  Smoothie 2
  Enter smoothie flavour: Banana
  Enter size (Small/Medium/Large): Small
  Extra 50p added for banana flavour.
  Smoothie details:
   Flavour: Banana
   Size:    Small
   Price:  £ 2.5

  Smoothie 3
  Enter smoothie flavour: Raspberry
  Enter size (Small/Medium/Large): Large
  Extra £1 added for large size!
  Smoothie details:
   Flavour: Raspberry
   Size:    Large
   Price:  £ 3.5

  All smoothie orders complete!
  Total smoothies: 3
  Medium smoothies ordered: 1
  Large smoothies ordered: 1
  Total cost is £9.25
Provide Feedback

What did you think of this document?

!
-- DragonDocs version 0.9 --

20.08.2017

Started on DragonDocs
Created a YASS/PHP and HTML-based system for saving and retrieving data

21.08.2017
Added CSS styles to page
Added JavaScript code to the page

02.02.2018
Added the multipage option (used in my dissertation)
Added the XMLHttpRequest-based multipage requests

08.02.2018
Added the Accessibility features
Filters added

10.02.2018
Purple filter added

17.03.2018
Added the Note class
Added the Did You Know class

-- DragonDocs version 1.0 (Yosemite) --

02.10.2019
First trial of DragonDocs in teaching

04.10.2019
Added the Task, Starter, Review your learning sections

07.10.2019
Added the feedback feature
Added the Dark Mode toggle

19.09.2020
Performance gains through the removal of unnecessary code
Added the Learning Intentions and Success Criteria features
Added the school badge

31.09.2021
Changed the headings (h2) to be more consistent with my website
Added sections to the pages - sections must be preceded by a h2
Added the "I have read this section" buttons
Changed the main heading zone to gradient text like my website
Added the table of contents feature

02.02.2022
Added the Print feature
Updated the footer to feature a new gradient
Added the Test It! class
Added the green flag
Automated the table of contents using JavaScript

06.02.2022
Added the 'includes' feature to the document, allowing inclusion of other files easily
Removed the requirement that the IP address must be one of the schools I have taught at, opening these documents to the public

02.03.2022
Once a section has been read or completed, the user can now hide that section

10.10.2022
Added the Extension task class
Changed the scrollbar on Windows to match that of macOS

-- DragonDocs version 2.0 (Kilimanjaro) --

07.08.2023
Added the Save button and the ability to save 'results' or answers to a Word document

12.01.2024
Added the large numbers class
Removed the background of the page navigation

-- DragonDocs version 2.1 (Aurora) --

08.02.2024
Added the active class to active links in the bottom section

09.02.2024
Added the image upload feature

10.02.2024
Added a fix that prevents the upload of non-image files into an image upload
Added pasting images to the upload feature

11.02.2024
Added the ability to view the changelog from a document
Improved the feedback system by recording the DragonDocs User ID and the Document ID data
The feedback from DragonDocs can be accessed much easier

12.02.2024
Added the new step_by_step_mode feature, allowing sections to be viewed individually
Added the ability to lock and unlock DragonDocs

22.02.2024
Added new checkboxes to each list item in a .task or .step
Added functionality to said checkboxes to add a strikeout to steps completed

23.02.2024
Added the new 'step' class
Steps are now auto incremented in CSS so the name displays the step number
Activities are now also auto incremented to display the activity number

25.02.2024
Added the 'matcher' feature to DragonDocs
Fixed an issue in which a closed section would retain it's original height within the document navigation
Added starters and the lesson review to the navigation on the side
The learning intentions and success criteria in teaching documents have now been redesigned to match my slides design

26.02.2024
All buttons are now on the right hand side
The accessibility button now has WAI under it

-- DragonDocs version 2.2 (Serengeti) --

26.02.2024
Code has been rewritten from the ground up to be object-oriented, making additional features easier to add

28.08.2024
Changed the look of grouped multiple choice buttons

06.03.2024
Added the new dragondocs_name feature and the requires_name property which allows names to be prepended to saved documents

09.03.2024
Added code so when the user types in their name and hits the enter key it will save that data and close the modal window
Added the new DragonShow and DragonDocs Link - a connection between both services that allows the presenter to communicate with users of DragonDocs from a DragonShow
Added the new timer option which is sent from DragonShows

04.04.2024
The matcher feature is no longer embed from jamiebalfour.scot but actually a feature of DragonDocs
Made DragonDocs 100% object-oriented, meaning much better management and better performance

05.04.2024
Made subtle changes to the interface to tidy it up a bit

06.04.2024
The multiple choice questions are now also part of the object oriented interface

09.04.2024
As requested, h3 elements are now included in the 'floating navigation'
The active navigation element now becomes bold and the left border has been retired

05.06.2024
Saving files now exports as a PDF which now also embeds all fonts (removed now)

18.06.2024
Select dropdowns are now temporarily saved to local storage and are now recovered when the document is reopened

19.12.2024
Multipage navigation now switches pages seamlessly - it's beautiful

17.01.2025
Added support for multi-select storage and reloading

-- DragonDocs version 2.3 (Great Barrier) --

17.02.2025
Added support for reorder tasks
Added lines and attachment circles for matching tasks

19.02.2025
Improved the performance of API calls
Separated the API from the core HTTP code

20.02.2025
Colours can be applied to matcher elements
Matcher colours now match the colours of the elements

Time left

: