11/20/22, 11:11 AM Assignment 7: Interfaces
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/3
Assignment 7: Interfaces
Due Monday by 11:59pm Points 100 Submitting a file upload File Types java
Available until Nov 28 at 11:59pm
Start Assignment
Interfaces are very similar to classes, however there are a few properties that make it unique. The first
is when we use a class or abstract class, the child class can only extend one class. However, you can
implement multiple interfaces. Another important thing to note is you can include variables and othe
states within classes. Interfaces do not them.
With basketball starting this Monday at UCF it is exciting. We also have FSU and Miami coming in this
year. Those games are going to be great. In the games of football and basketball you have three times
of offensive scoring. In football you have a touchdown (7 points), field goal (3 points) and an extra point
(1 point). In basketball, you have the three-point shot (3 points), the 2 pointer (2 points) and the free
through (1 point).
In this assignment you will be writing a simulation of scoring for each game. The amount of teams
playing is not limited to two. You may have anywhere from 2-100 teams playing. In addition, we can put
any combination of basketball and/or football teams onto the scoreboard. Your goal is to play the game
and rank them by score.
You will need to include the following:
Interface named Sports
Methods Include:
score_large()
score_med()
score_small()
They all do not return a value.
get_score() - int
get_id() - int
Class named Football that implements Sports and Comparable
Keeps the score of the team
Keeps the team ID number.
The team score starts at 0.
11/20/22, 11:11 AM Assignment 7: Interfaces
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/3
Large points scores 7 points per call
Medium is 3 points
Small is 1
You should compare Sports scores descending
Class name Basketball that implements Sports and Comparable
Keeps the score of the team
Keeps the team ID number.
The team score starts at 0.
Large points scores 3 points
Medium is 2 points
Small is 1
You should compare Sports scores descending
Class name Sport Runne
Asks the user for a file name of the test run.
File name will be formatted in the following way:
First line will include how many teams in the competition, we will call this value n.
The next n lines will have the word “Basketball” or “Football” to determine what type of
team it is. As you enter these values, the team’s ID number will start at 0 and increase
y 1 for each line.
The next line will have an integer with the number of scores, we will call this value s.
The next s lines will include which team scored, and how many points they earned.
The amount of points will be given as an s, m, l for small, medium and large. Example:
1 l
Print out the scoreboard at the end of the program.
Example Input
3
Basketball
Basketball
Football
10
0 s
0 l
2 m
1 s
1 m
0 l
2 l
1 l
1 m
1 l
11/20/22, 11:11 AM Assignment 7: Interfaces
https:
webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/3
Output
1 - 11
2 - 10
0 - 7