Photo AI
Question 8
OCR town are holding an election with three candidates (A, B and C). An electronic voting booth will be used to allow people to vote. Write an algorithm that: - Al... show full transcript
Step 1
Step 2
Step 3
Answer
if vote == 'A':
countA += 1
totalVotes += 1
elif vote == 'B':
countB += 1
totalVotes += 1
elif vote == 'C':
countC += 1
totalVotes += 1
elif vote == 'END':
break
else:
print('Invalid input, please enter A, B or C')
Step 4
Report Improved Results
Recommend to friends
Students Supported
Questions answered
CPU Architecture, Performance & Embedded Systems
Computer Science - AQA
Primary & Secondary Storage
Computer Science - AQA
Data Storage & Compression
Computer Science - AQA
Networks & Topologies
Computer Science - AQA
Wired & Wireless Networks, Protocols & Layers
Computer Science - AQA
Identifying & Preventing Threats to Computer Systems & Networks
Computer Science - AQA
Operating Systems & Utility Software
Computer Science - AQA
Ethical, Legal, Cultural & Environmental Impact
Computer Science - AQA
Computational Thinking, Searching & Sorting Algorithms
Computer Science - AQA
Designing, Creating & Refining Algorithms
Computer Science - AQA
Programming Fundamentals & Data Types
Computer Science - AQA
Additional Programming Techniques
Computer Science - AQA
Defensive Design & Testing
Computer Science - AQA
Boolean Logic Diagrams
Computer Science - AQA
Programming Languages & Integrated Development Environments (IDEs)
Computer Science - AQA
OCR Exam Reference Language
Computer Science - AQA