Unit 4 Assignment 4.2
Unit 4 Assignment 4.2
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.
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
team 1 team 4
team 2 team 3
show team 1's show team 2's show team 3's show team 4's
score, candidates score, candidates score, candidates score, candidates
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>
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:
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