logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Script programs are useful for text processing involving many files.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Script programs are useful for text processing involving many files. Write a bash shell script called minileague to input the scores of soccer games and draw up the league table among a few selected teams. The script will first read in the team information from a file whose name is specified as the first parameter, e.g. big6.dat. Each line of the file contains the short name of a team, followed by the name of the team. Your program then reads in a sequence of files containing the scores of games on different days or weeks, as indicated by the prefix of those files specified as the second parameter, e.g. score2122. This concept of a mini-league is useful for some common tie-breaking rules.

In a soccer game, there could be one winning team and one losing team, or both teams end up with a draw. The winning team will score 3 points, the losing team will score 0 point. If the game ends up with a draw, both teams will score 1 point. The ranking criterion is according to the number of points earned by a team. The champion is the one scoring the highest number of points. In case of a tie among two or more teams, the number of points earned by the teams in a Mini-League (i.e. just consider the games among those teams) will be used to rank them. Note that your program minileague could be used to perform this ranking criterion on the subset of teams involved in the tie-breaking situation. If there is still a tie among the teams, tie breaking will be based on the goal difference and the team with a larger goal difference will rank higher. In case of a tie in goal difference, tie breaking will be based on the number of goals scored and the team with a higher number of scored goals will rank higher. If there is still a tie after using the goal difference and goal scored, both teams will be considered to rank equally.

Note that for a double round-robin league common in most countries, each team needs to meet each other team twice, once at home and once away. If the number of teams, n, is even, each round will involve all n teams in n/2 games, and we need n-1 rounds for the first round-robin, and then another n-1 rounds for the second round-robin. If n is odd, there will be one team enjoying a bye round, and only (n- 1)/2 teams are involved. A total of n rounds are needed for the first round-robin, and the same for the second round-robin.

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

878 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

836 Answers

Hire Me
expert
Husnain SaeedComputer science

629 Answers

Hire Me
expert
Atharva PatilComputer science

766 Answers

Hire Me

Get Free Quote!

285 Experts Online