• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Start selling Create your account
Document preview thumbnail
Preview 2 out of 14 pages
Essay

Unit 4 - programming assignment 2 example distinction (contains C++ code snippets)

Document preview thumbnail
Preview 2 out of 14 pages

NOTE! This document only contains 90% of the assignment. It is missing some small portion of Learning aim B. Also, this tournament system was made by one person so having things such as a record of the review and a document that demonstrates that you have shown individual responsibility and effective self-management was not applicable. If the project would've been done by more than one person, then these would be required. This document contains a description of the tournament system, evaluation, code snippets for the tournament system that is needed for assignment 2, design (flowchart), optimization, and also test logs.

Content preview

Programming Assignment 2



Tournament event system



Make a dice roll function, that would determine team event pick que.

It will generate random values from 2 to 12 (two dices) for each team. It will bubble sort the teams
in an array to make a que for teams to choose events they want to participate in.

e.g. “Team 1 rolls 8”, “Team 2 rolls 9”, “Team 3 rolls 2”, “Team 4 rolls 12”

So, the team que according to the function will be:

1. Team 4
2. Team 2
3. Team 1
4. Team 3

Then, it will ask for the Team 4 (since it rolled the highest value) to choose 1 out of 5 events.

e.g. “Team 4, please choose 1 out of 5 possible events that you will be participating, by typing in
their number.”

*Displays the event*

“1. Event One 2. Event Two 3. Event Three 4. Event Four 5. Event Five”



After the team chooses the event, it will store the choice for the specific team.

Array that contains 4 place holders for the choices



When the events have been assigned to the teams, then each member in the teams will start taking
their part in the event.

e.g. “Team 1 started Event Three”

“Member 1 from Team 1 has scored 14 (random value)”

“Member 2 from Team 1 has scored 32 (random value)”

“Member 3 from Team 1 has scored 15 (random value)”

“Member 4 from Team 1 has scored 76 (random value)”

“Member 5 from Team 1 has scored 4 (random value)”

After the team finished their event, they it will calculate the total score and put it into the score
array. In the score array the score will be bubble sorted and the winners will be decided.

, 1. Output members of teams using for loops
2. If statements based on the chosen event
3. If statements will contain main formula for which the score will be calculated
4. The if statement has to be in the for loop

Connected book
 image
Publisher: Unknown ISBN: 9781910523155 Edition: Unknown

Document information

Study Level
Uploaded on
March 16, 2021
Number of pages
14
Written in
2019/2020
Type
Essay
Professor(s)
Unknown
Grade
D
£7.49
Purchased by 41 students

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BpoBpo
3.7
(73)
Sold
312
Followers
250
Items
78
Last sold
5 months ago


Reviews from verified buyers

4 year ago

this was not the work i was looking for and its definitely not a distinction level work




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions