• Home
  • Blog
  • Programming Project computer science homework help

Programming Project computer science homework help

0 comments

 there is something I want to to do before you start
1 I want to you to tell me your idea
2-uesing this link

 Results.txt (249 B)
 Table.txt (109 B)

  Programming Assignment 1
A soccer competition consists of 4 teams playing against each other at a home and away basis (each team hosts the game against a specific team once). The total number of games is 6. The list of results is provided in the “Results.txt” file.
Write a program that reads the result of each match and updates the standings table. Then writes the final standings to the file “Table.txt”.
Your program should consist of, at least, the following classes:
• Team:
o Attributes:
ï‚§ string teamName;
ï‚§ int points;  // 3 points for win, 1 point for tie and 0 for loss
ï‚§ int goalScored;
ï‚§ int goalsAllowed;
ï‚§ int goalsDifference; // goalScored – goalsAllowed
ï‚§ vector<string> streak; // ”w” for win, “l†for loss and “t” for tie
o Functions:
ï‚§ Team(string teamName); // initialize the Teamâ€s data fields
ï‚§ Getters of each attribute
ï‚§ Setters of each attribute
• Match:
o Attributes:
ï‚§ Team homeTeam, awayTeam;
ï‚§ int homeGoals, awayGoals;
o Functions:
ï‚§ Match(int matchID);
ï‚§ Getters of each attribute
ï‚§ Setters of each attribute
• Table:
o Attributes:
ï‚§ vector<Team> standing;
ï‚§ vector<string> streak; // longest list of matches of the same results for the same team
o Functions:
ï‚§ Table(); // initialize the initial standing vector
ï‚§ void sortTable(); // after updating the table with points, goals scored and allowed for every team, sort the table
ï‚§ int linearSearch(Team team, vector<Team> table) // search for the index of a team, whose result in being considered from the result.txt, in the table standing vector
ï‚§ string computeStreak(Team team) // compute the longest serie of matches of the same result for a certain team
ï‚§ Getters of each attribute
ï‚§ Setters of each attribute
Feel free to add more methods if you feel you need them.
When arranging the standing table, the order of team is determined by the highest number of points.
You can initially (before taking account of any game result) place the teams in standings array in alphabetical order and the goalsAllowed, goalsScored, goalsDifference and streak to have all zeroes.
When writing the final standing to the file “Table.txt” append the content to the existing content and use tabulation “t” as delimiter instead of the single space “ “ that is used for “Results.txt” file. Also when writing the streak to “Table.txt”, the syntax is the number of games followed by “L” for loss, “W” for win and “T” for tie. For instance, if the streak is winning 6 games put 6W; if it is losing 3 games put 3L; if it is 2 ties put 2T.
Note: computing the streak for each team is an extra credit worth 10 points. Therefore, all data fields and member functions dealing with computing and outputting the streak for each team is optional.
Note: You should keep the main method in a different file where you can also parse the text file in there and possibly have other helper methods. This is where most of the logic of the program will be as it will be linking all classes together.
Deliverables:
Zipped file of the Visual studio C++ Project.
You have to include comments on the behavior of the member functions in your classes.
This is an individual work. Any plagiarism is subject to penalties.
 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post Programming Project computer science homework help appeared first on Nursing Writers Hub.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}