GCSE Computing Mini Assignment
Mini Assignment Having completed a variety of mini tasks we have now established an understanding of the following programming tools: Print Input Variables Int() #for numbers with decimal places use float() Calculations Random Numbers While loop (Conditional controlled) For Loops (Count controlled) You are now required to apply all of these to help solve the problem on the following slides. Once complete it will be uploaded for marking where the quality of coding, output presentation and use of comments will be assessed.
One new skill to help… In the task you will be required to round up a value. For example you cannot buy 2.3 tins of paint so it should be 3. Test this code before proceeding to the actual task: import math number = float(input("Enter a value :")) print(number) print(round(number)) #this will round up or down print(math.ceil(number)) #this will round up (uses the ceiling statement)
Mini Assignment 1 – Main Task Having gained employment as a computer programmer for B & Q you have been asked to create a “Paint cost calculator” program that could be used by customers in their stores. It will need to perform the following: Output a Header for Title Ask the user to input the height and width of the wall to be painted #use float() rather than int()* Calculate the area of the wall Calculate and output the number of tins required (1 tin covers 5m2) #can you round up to an integer value? Calculate and output the cost (1 tin costs £12)
Mini Assignment 1 – Extension 1 There is a sale at the store where the price of each tin is reduced by a random number between 1 and 4. Add code so that a reduced price is used (Note: import random will be required)
Mini Assignment 1 – Extension 2 Add a While Loop that will allow the user to have multiple attempts or close the program.
Mini Assignment 1 – Extension 3 Add a For Loop to your code to have a countdown from 10 to 1 before providing the user with the final price.
Mini Assignment 1 – Extension 4 There is a circular window in the wall that does not require paint. Ask the user to enter the radius of the circle, calculate and output the area using πr2. Subtract this area from the total area of the wall before calculating the number of tins required and cost.
Roundup import math tins = math.ceil(area/5)
import time for i in range(10,0,-1): print (i) time.sleep(1)
Mini Assignment 1 – Assessment Criteria [100 Marks] Skill Mark Header created using print, \n and a dividing line of stars 10 Data input and stored in suitable variables Accurate calculations for area, number of tins and price Data output is well presented and clear Round up code works effectively Ext 1: Correct use of random numbers Ext 2: Correct use of while loop Ext 3: Correct use of for loop Ext 4: Correct use formula to subtract circle area Effective use of comments