Standings Line (Arrays and Methods)
Synopsis
Create a program that prints out some information that might appear in a table that shows the standings of teams in a sports league
We’ll only have wins, losses and ties. No overtime or shoot-out wins or losses. We also won’t track goals for and against.
The program reads in a list of wins, losses and ties. It reports back several items of interest.
Details
Your program executes the following steps, in the following order — using methods in most steps:
In writing your program, you will create and use the following (static!) methods:
Reminders and Warnings:
Remember to start with the steps of your program (the 7 steps listed above) as pseudo-code comments in your program. It will help keep you from biting off too-big pieces of code to do.
Remember to start with stubs of all the methods you require.
And remember that a stub is a very short method definition — usually the shortest one that’ll compile — and that it almost never does the right thing.
Remember also that the methods you need here are static.
Finally, make sure that you understand the job of each of the required methods. Make sure that your implementation does that job and no other. And make sure that you use each method in the required way. Your main is going to be mostly method calls and output commands. Most of the “work” is going to be in the other methods.
Hints
When reading in the game results, make an array that’s big enuf to hold all 100 games. Make your for loop to read in all 100 games, BUT check each result after reading it. If it’s a valid game result, add it to the array and count it. If it’s not a valid game result, then bump your loop control variable up to 100.
Sample Output:
Standings Line Generator
————————
This program prints out some stuff that might be useful if you’re printing out
standings charts for some sports league.
by Ben Adam
Press enter…
Enter the game results here:
w w w w l w w l w t w l w w w w w x
As a check, here is the data you entered:
WWWWLWWLWTWLWWWWW
Press enter…
Your won-lost-tied record is 13-3-1.
The number of points for that record is 27.
Press enter…
The last ten of those games:
LWTWLWWWWW
Your won-lost-tied record is 7-2-1.
The number of points for that record is 15.
Press enter…
Standings Line Generator
————————
This program prints out some stuff that might be useful if you’re printing out
standings charts for some sports league.
by Ben Adam
Press enter…
Enter the game results here:
w w w w l w w l w w l w w w w w .
As a check, here is the data you entered:
WWWWLWWLWWLWWWWW
Press enter…
Your won-lost-tied record is 13-3-0.
The number of points for that record is 26.
Press enter…
The last ten of those games:
WLWWLWWWWW
Your won-lost-tied record is 8-2-0.
The number of points for that record is 16.
Press enter…
Standings Line Generator
————————
This program prints out some stuff that might be useful if you’re printing out
standings charts for some sports league.
by Ben Adam
Press enter…
Enter the game results here:
L L L L L L L L L L L L L L
done
As a check, here is the data you entered:
LLLLLLLLLLLLLL
Press enter…
Your won-lost-tied record is 0-14-0.
The number of points for that record is 0.
Press enter…
The last ten of those games:
LLLLLLLLLL
Your won-lost-tied record is 0-10-0.
The number of points for that record is 0.
Press enter…
Standings Line Generator
————————
This program prints out some stuff that might be useful if you’re printing out
standings charts for some sports league.
by Ben Adam
Press enter…
Enter the game results here:
W l l l w t T ;
As a check, here is the data you entered:
WLLLWTT
Press enter…
Your won-lost-tied record is 2-3-2.
The number of points for that record is 6.
Press enter…
The last ten of those games:
WLLLWTT
Your won-lost-tied record is 2-3-2.
The number of points for that record is 6.
Press enter…
Standings Line Generator
————————
This program prints out some stuff that might be useful if you’re printing out
standings charts for some sports league.
by Ben Adam
Press enter…
Enter the game results here:
w w w w w w w w w w
w w w w w w w w w w
w w w w w w w w w w
w w w w w w w w w w
w w w w w w w w w w
w w w w w w w w w w
w w w w w w w w w w
w w w w w w w w w w
w w w w w w w w w w
w w w w w w w w w w
As a check, here is the data you entered:
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
Press enter…
Your won-lost-tied record is 100-0-0.
The number of points for that record is 200.
Press enter…
The last ten of those games:
WWWWWWWWWW
Your won-lost-tied record is 10-0-0.
The number of points for that record is 20.
Press enter…
Standings Line Generator
————————
This program prints out some stuff that might be useful if you’re printing out
standings charts for some sports league.
by Ben Adam
Press enter…
Enter the game results here:
NONE
As a check, here is the data you entered:
Press enter…
Your won-lost-tied record is 0-0-0.
The number of points for that record is 0.
Press enter…
The last ten of those games:
Your won-lost-tied record is 0-0-0.
The number of points for that record is 0.
Press enter…
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more