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:

National 5 Computing Science Software Design and Development: Refresher lesson

Knox badge
National 5 Computing Science Software Design and Development: Refresher lesson
This is a refresher task, testing many of your skills from S3 and from before the summer.

You are expected to produce a program that meets the following requirements.

A small record label wishes to know more about the people that buy music from it. It has created a survey for it's customers and it now needs to analyse that data using a computer program.

The program will be run so that 10 users can insert their own information. The program will then analyse the information given to it and calculate an average.

They have hired you to develop this program.

The data collected by the survey is shown below:

Name Score
Fiona Barbour 65
Ahmed Schall 70
David Wheeler 46
Beth MacCallum 98
Findlay Peterson 87
Brian Wilson 96
Euan Tobin 87
Emma Wilson 100
Patrick Heller 43
Hamish Peters 12
Hamish Branan-Horobin 92
Gael Roberts 5

The program - design

In this first step, you are expected to create a flow chart of this program. Once you have done this, show this to your teacher.

Setup

You are now going to begin writing the code for the program.

Create and set up your variables. You will need variables such as an array to store the user's feedback whilst the program is running.

What other variables might you need?

Collect the data from the user

The program should first of all ask the user to insert what percentage each user gave in the survey. Use the table shown previously for the data.

You should create an input validation loop like the one shown below to ensure that the user types in a number between 0 and 100.

Python
print("Please insert your username")
username = input()
print("Please insert your password")
password = input()
while username != "maggie" or password != "glenn":
  print("Incorrect username and password combination provided")
  print("Please reenter your username")
  username = input()
  print("Please reenter your password")
  password = input()
VB.NET
Dim username As String = InputBox("Please insert your username")
Dim password As String = InputBox("Please insert your password")
While Not(username = "maggie") Or Not(password = "glenn")
  MsgBox("Incorrect username and password combination provided")
  username = InputBox("Please reenter your username")
  password = InputBox("Please reenter your password")
End While

Analyse the data

The program should now run through the percentages array, counting the number of them that are below 50.

At the end of running through the array again, it should display how many people gave percentages less than 50.

You might find it helpful to create an variable called something like moreThan50 and then inside your loop just check if the percentage is less than 50 and add 1 to the moreThan50 variable if it is.

Display the average

The program should now display the average. The average is calculated by adding all the percentages together then dividing them by 10.

When displaying the value, round it to no decimal places.

You can modify your original loop when collecting the data from the user to add to a total as you collect the information.

Test and document your program

Test your program by debugging it, testing a range of different values.

Ensure you have commented your code nicely.

!
-- 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

Time left

: