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

Unit 4 Assignment 4.2

The document details the development of a scoring software for an upcoming college tournament. It includes: 1) A flowchart showing the steps a user would take to select their team and enter their score. 2) Code written in C++ that uses if/else statements to assign point values from 100 to 5 based on the user's rank input. 3) Testing of the code by inputting different ranks, validating correct output and errors for out-of-range inputs.

Uploaded by

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

Unit 4 Assignment 4.2

The document details the development of a scoring software for an upcoming college tournament. It includes: 1) A flowchart showing the steps a user would take to select their team and enter their score. 2) Code written in C++ that uses if/else statements to assign point values from 100 to 5 based on the user's rank input. 3) Testing of the code by inputting different ranks, validating correct output and errors for out-of-range inputs.

Uploaded by

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

Unit 4 Assignment 4.

2 Arjun Gill
Introduction:
This is assignment 2 for unit 4 on programming. In this assignment I will be
detailing my software development for the upcoming college tournament. The
software should be able to manage the scoring system for the upcoming
tournament. I am going to use illustrations and diagrams to build my design
report then following the report I will engage in developing and implementing
a program that can be used by the college.

Critical success factors:


The client would like the algorithm to be:
Simple and easy to use, efficient, data inputting to be entered easily, have
minimal mistakes, be accurate, be clear and logical, be able to calculate the
scores for the 4 different teams and be tested thoroughly.

Flowchart:
This is what the steps I took and how the code functions and is put in a simple
flowchart so it's easy to understand for anyone.
start program

what team are


you selecting?

team 1 team 4
team 2 team 3

what's your what's your what's your what's your


name? name? name? name?

enter score enter score enter score enter score

show team 1's show team 2's show team 3's show team 4's
score, candidates score, candidates score, candidates score, candidates

show all teams results

end

Development of my code.
I will be using c++ as my programming language of choice.
I’m using an ide to write the code. It will act as one of the first lines of testing
as I will periodically run the code so that I can allow the ide to show me any
errors in the code that I need to correct.
Software development life cycle is a process used to develop and design high
quality software. The aim is to produce high quality software which can meet
or exceed the client's expectations within reasonable time and reaches
completion within cost estimates.
#include <iostream>

using namespace std;

int main()
{
int team;
cout << "type the team number you would like to be from the list below\n" ;
cout << "team numbers: 1, 2, 3 or 4 ";
cin >> team;
std::cout << "Welcome everyone!\n"; //this is a sentence that will display in
red
int rank;// this line is describing the variable which is rank
cout << "input your rank:";// in this line its asking the user to input their or
anyone's ranking
cin >> rank;// in this line we are defining rank as a substitute for the defined
variable rank
if (rank ==1)// this line is where the if-else function starts and it is saying here
that if the inputted number is 1
cout << "You get 100 points";// the user will be shown the line stating 'You get
100 points'
else if (rank== 2) // if this isn't the case it will go further and check if the
number is maybe '2'
cout << "You get 95 points";// and it will give the stated points
else if (rank == 3) // it goes on until the number matches the condition or till
line 51
cout << "You get 90 points";
else if (rank == 4)
cout << "You get 85 points";
else if (rank == 5)
cout << "You get 80 points";
else if (rank == 6)
cout << "You get 75 points";
else if (rank == 7)
cout << "You get 70 points";
else if (rank == 8)
cout << "You get 65 points";
else if (rank == 9)
cout << "You get 60 points";
else if (rank == 10)
cout << "You get 55 points";
else if (rank == 11)
cout << "You get 50 points";
else if (rank == 12)
cout << "You get 45 points";
else if (rank == 13)
cout << "You get 40 points";
else if (rank == 14)
cout << "You get 35 points";
else if (rank == 15)
cout << "You get 30 points";
else if (rank == 16)
cout << "You get 25 points";
else if (rank == 17)
cout << "You get 20 points";
else if (rank == 18)
cout << "You get 15 points";
else if (rank == 19)
cout << "You get 10 points";
else if (rank == 20)
cout << "You get 5 points";
else { // but if in the case the number is <1 or >20 the user will receive a
different prompt
cout << "ERROR: please enter a valid rank between 1 and 20"; //they will
this error
}
std:: cout << " Thanks for your participation!\n"; // this paragraph will show
the corresponding prompt so that the user knows the interaction with the
code has ended
return 0; // this line of code returns back to 0 where everything can start
again if the user desires to
} // this closes the code
Running the code for the first time, I don’t get any errors:

Testing and development


I decided to undergo physical testing to test the functionality of the code and
to see if the code is working correctly and to see if it is easy to understand.
Test 1:
I will be checking the input and output of the code by inputting the rank 1 to
see if it displays the correct output which should be 100:

As you can see in the first test it works correctly.


Test 2:
Same test but replacing 1 with 12 which should show the output of 45:
Test 2 success.
Test 3:
Same again but with the input of 19 which should show the output of 10
points:

Test 3 success.
Test 4:
In this test we will be trying a smaller number then in the range specified
which should output a error:

Test 4 success.
Test 5:
This time we will be using a number higher than the range specified which has
the output of an error:
Test 5 success.
Recommendations and improvements:
I added choosing a team which you are on

Evaluation:
In my opinion the code reached the requirements set for it having both
simplicity and functionality

You might also like