0% found this document useful (0 votes)
8 views

Week 7 - Planning Your Project (1)

Uploaded by

bestx 21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Week 7 - Planning Your Project (1)

Uploaded by

bestx 21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Planning Your Project

Peter Blanchfield
The project description:
• This will be on the Now pages once the official
moderator has approved it
• However, members of the programming team have
seen it and have agreed to the project
• There are some aspects that need to be aligned with
the moule learning outcomes
• Do you know the module learning outcomes?
• (The module has two strands so I mean the programming
ones)
Programming strand learning
outcomes
• MLO2
• Demonstrate a simple understanding of state as a
computational context and programming as its manipulation
• MLO4
• Write Python programs as computing solutions to real-world
problems
• You have to realise MLO1 and MLO3 belong to the other
strand
• I think by this stage you have grasped
• A simple understanding of state as a computational context and
programming as its manipulation
In the coursework
• You will be expected to show that you have acquired
• A simple understanding of state as a computational context
and programming as its manipulation
• What does this mean?
• You will be able to write the basic codes that are needed to:
• Print to screen
• Read input from a user
• Make decisions on program flow according to that input
• Use If statements, While and For
• Recognise errors in user input
• Read from and write to files
• Catch errors
These basic things in your
coursework
• First of all you will be
• Telling the user what the program does
• This can become more complex but should at least involve
• Printing a list of options
• Getting a user response
• Making a decision based on the response
• Including checking that their response is valid
• So if you have a list of actions and expecting them to choose a valid
number
• You will catch any errors in the data type (exceptions)
• Responding to their request
• The more options you give them the more complex the situation will
become
• To pass there will be at least some options that do a certain set of steps
The data
• The data will be on a csv file
• You can use the csv module to access the data
• Or you can write your own csv reader functions
• There is lots of data that can lead to many different
questions
• I will list the basic ones:
• There is a column of candidate names
• One for their party
• One for their votes
• One for their percentage of votes
• This may constitute the basis for a Candidate class (or an MP class you
choose the name)
Party Class And Constituency Class
• Party Class would contain
• The list of MP objects
• And constituency objects
• Constituency Class
• Details of the constituency
• Name
• Country (England, Norther Ireland, Scotland and Wales)
The basic coursework description
•Voting Analysis Project

•The data to be analysed and presented in the project is available in a document on the
NOW pages of the module. The document was retrieved from the House of Commons
Library website https://commonslibrary.parliament.uk/research-briefings/cbp-10009/.
Further information on the data can be found on that web site. The file on the now
pages is a .csv taken from the full data set available on the government website
•The system will provide users with a set of options presented to them
as a menu. They should be able to use the system to enquire about:
• Candidate party
• Candidate name
• Parliamentary Seat (name)
• Total registered voters in the seat
• Total of votes cast
• Votes cast for the candidate
• Votes for a given party received as a percentage of total votes cast
• You are at liberty to add extra options that may improve the
understanding of the data.
I Have saved the original document into .csv format

Member
Constitue Region Country Constitue first Member Member First Second Electorat Valid Invalid Independ Independent
ncy name name name ncy type name surname gender Result party party e votes votes Majority Con Lab LD RUK Green SNP PC DUP SF SDLP UUP APNI ent winner vote

Aberafan
Maesteg Wales Wales County Stephen Kinnock Male Lab hold Lab RUK 72,580 35,755 79 10,354 2,903 17,838 916 7,484 1,094 0 4,719 0 0 0 0 0 801 0

Aberdeen
North Scotland Scotland Burgh Kirsty Blackman Female SNP hold SNP Lab 75,925 42,095 115 1,760 5,881 12,773 2,583 3,781 1,275 14,533 0 0 0 0 0 0 1,269 0

Aberdeen
South Scotland Scotland Burgh Stephen Flynn Male SNP hold SNP Lab 77,328 46,345 178 3,758 11,300 11,455 2,921 3,199 1,609 15,213 0 0 0 0 0 0 648 0

Aberdeen
shire
North
and
Moray SNP gain
East Scotland Scotland County Seamus Logan Male from Con SNP Con 70,058 38,188 170 942 12,513 3,876 2,782 5,562 0 13,455 0 0 0 0 0 0 0 0
Airdrie
and Stevenso Lab gain
Shotts Scotland Scotland County Kenneth n Male from SNP Lab SNP 70,199 36,666 95 7,547 1,696 18,871 725 2,971 0 11,324 0 0 0 0 0 0 1,079 0

South Lab gain


Aldershot East England Borough Alex Baker Female from Con Lab Con 78,553 48,544 179 5,683 14,081 19,764 4,052 8,210 2,155 0 0 0 0 0 0 0 282 0
Aldridge-
Brownhill West
s Midlands England Borough Wendy Morton Female Con hold Con Lab 70,268 40,912 156 4,294 15,901 11,607 1,755 9,903 1,746 0 0 0 0 0 0 0 0 0

Alloa and
Grangem Lab gain
outh Scotland Scotland County Brian Leishman Male from SNP Lab SNP 70,680 41,201 74 6,122 3,127 18,039 1,151 3,804 1,421 11,917 0 0 0 0 0 0 1,742 0

Altrincha
m and North Lab gain
Sale West West England Borough Connor Rand Male from Con Lab Con 74,025 51,452 184 4,174 16,624 20,798 4,727 4,961 3,699 0 0 0 0 0 0 0 643 0

Alyn and
Deeside Wales Wales County Mark Tami Male Lab hold Lab RUK 75,790 43,392 135 8,794 7,892 18,395 2,065 9,601 1,926 0 1,938 0 0 0 0 0 1,575 0

Amber East Farnswort Lab gain


Valley Midlands England County Linsey h Female from Con Lab RUK 71,546 42,531 105 3,554 10,725 15,746 1,590 12,192 2,278 0 0 0 0 0 0 0 0 0
I Have saved the original document into .csv format. The first few columns have the
following titles

Constituency name Region name Country name Constituency type Member first name Member
surname Member gender Result First party Second party Electorate Valid votes Invalid votes
Majority
So Where Do You Start
• First thing to do is:
• Set up a repository on the Enterprise GitHub
By now you should
already have some
repos
So you will press New
Make your repo have a sensible
name
• Like
• Voting Analysis Project
• Add a description a ReadMe and a gitignore
And press create
• To create the online version of the repo
Next make sure to clone it
• At home or in the lab
• In the lab get used to the idea of
• The Projects Folder
• For Python you can use anywhere
• But when you use C++ or C#
• You will create a .exe which
• Must be in the Projects folder provided
• So that it will run
• So just start developing good practice
Now start thinking about Use Cases
• In SAD next term you will learn about Use Case
diagrams
• But for now just do Use Case descriptions
• These will seem a bit like pseudo code
• (If you have done that before)
• Think of your use cases
• Start with your user interface
• How will this work
• (Other use cases may need to run first)
• But you can code and test this one
• You need to provide an option set
• With some way for your user to to choose
OK my example
• But in the lab think of what you need to do
• Steps:
• Display a welcome message
• Display a list of options
• I will store my options as a list of strings
• Start by writing the code
• Save it to the appropriate folder (the one you cloned your repo to)
Here is my quick go
• You don’t have to do it this way
• I will do it now so I can create my slides
Now test it – did it work
• No I failed to increment the
option number
• But I am going to commit
so I record the fails as well
as the successes
The changes
• To the local repo
• Should first be committed
• Admit to my failure
• And how I intend to bugfix
• When committed PUSH!
The changes
• To the local repo
• Should first be committed
• Admit to my failure
• And how I intend to bugfix
• When committed PUSH!
View on GitHub
• To verify it arrived
• I will make changes
• Before updating ReadMe
Made the changes
Now it works
Now commit and push
• Not completed use case
• Need to add user
• Response
• Then Action use case can
• Start
Update the ReadMe
• That also need
• Commit
Check the Network and see the
progress
• Shows all my commits
The online repo is now in advance
• Synchronise locally by fetch from origin
The online repo is now in advance
• Synchronise locally by fetch from origin
Synchronising
• Will be vital when you work in teams
• Each person will have their work to do
• Usually in an “issue” branch
• Which must eventually be merged into the main!

You might also like