Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You must complete the following items The Create a class project At least one GU

ID: 3831631 • Letter: Y

Question

You must complete the following items

The Create a class project

At least one GUI project

Any 4 of the others

You will code 6 total projects.

Submit your code to Blackboard – Clearly label that project that I am grading

Since this is out of class, you may work together, or consult any resource.

Projects

1. Create a class

Create a class called SportsGame. Include the following fields (String league, String team1, String team2, team1Score, team2Score). Include all setters, getters, constructors, toString method. Create a method named Winner that returns a string holding the winning team and the number of points they won by. Be sure that your Winner method can handle a tie. Instantiate the class in a program and call the methods.

2. Inherit a class

Create a class called Overtime that inherits from SportsGame. Add the following fields (Boolean suddenDeath, int minutes). Override the toString, and constructors. Create the setters and getters. Instantiate and call in a main.

3. File IO

Use exercise.csv file to complete these tasks. The first column holds exercise names. The second holds the date I performed the exercise. Finally, the last column holds the number I did on that day.

Use Java to read the file. Produce output that tells me the total number of each exercise I performed. For example, I did 70 total burpies.

4. XML IO

Read and parse the books.xml file. Display in an attractive format the author, title, genre, and price. The books file was borrowed from https://msdn.microsoft.com/en-us/library/ms762271(v=vs.85).aspx.

5. Create and parse an array 1

Create an array of size 1000 populated with random integers between 1 and 1000. Sort the array. Display the array. Count and display the number of times your favorite number appears.

6. Create and parse an array 2

Create an array of SportsGame holding 10 SportsGames (have different leagues, the other data can be the same). Implement the Comparable class to sort by league. Display the sorted array to the screen.

7. Exceptions and loop

At the console, create a program that asks the user for a number between 1 and 100. The routing should be idiot proof. It should catch ay exceptions and continue to ask until the user correctly enters the a valid number.

8. Decisions

Create a program that asks the user for a month. The user can enter the number, full name, or abbreviation. It will then redisplay the name of the month and the number of days within that month.

9. GUI 1

Create a JFrame application that asks for a height and a length. The program will calculate and display the area of a square (length * width), and the area of a triangle (length * width * .5). The program should not allow negative numbers.

10. GUI 2

Create a JFrame application with a JComboBox and a label. Populate the JComboBox with the names of 5 movies. Whenever a movie is selected, the movie poster is displayed along with the year the movie was released.

11. Database

Create the premiere database in Netbeans. Display the parts table in a Java Program.

Explanation / Answer

Hi, I have implemented Q1 and Q6 completely.

Please repost others questions separately.

public class SportsGame implements Comparable<SportsGame> {

  

   private String league;

   private String team1;

   private String team2;

   private int team1Score;

   private int team2Score;

  

   public SportsGame() {

      

   }

   // constructor that takes following information

   public SportsGame(String league, String team1, String team2) {

       this.league = league;

       this.team1 = team1;

       this.team2 = team2;

   }

   // setters and getters

  

   public String getLeague() {

       return league;

   }

   public String getTeam1() {

       return team1;

   }

   public String getTeam2() {

       return team2;

   }

   public int getTeam1Score() {

       return team1Score;

   }

   public int getTeam2Score() {

       return team2Score;

   }

   public void setLeague(String league) {

       this.league = league;

   }

   public void setTeam1(String team1) {

       this.team1 = team1;

   }

   public void setTeam2(String team2) {

       this.team2 = team2;

   }

   public void setTeam1Score(int team1Score) {

       this.team1Score = team1Score;

   }

   public void setTeam2Score(int team2Score) {

       this.team2Score = team2Score;

   }

  

   @Override

   public String toString() {

       return "League :"+league+" "+

               "Team1: "+team1+" "+

               "Team1 Score: "+team1Score+" "+

               "Team2: "+team2+" "+

               "Team2 Score: "+team2Score;

   }

  

   public String winner(){

      

       if(team1Score > team2Score){

           return team1+" won by "+(team1Score-team2Score)+" points";

       }else if(team1Score < team2Score){

           return team2+" won by "+(team2Score-team1Score)+" points";

       }else{

           return "Tie!!!";

       }

   }

  

   @Override

   public int compareTo(SportsGame o) {

       return league.compareTo(o.league);

   }

}

############ Test Class ######

import java.util.Arrays;

public class SportsGameTest {

  

   public static void main(String[] args) {

       SportsGame game1 = new SportsGame("T20", "India", "Austrilia");

       SportsGame game2 = new SportsGame("Champion Trophy", "India", "Austrilia");

       SportsGame game3 = new SportsGame("World Cup", "India", "Austrilia");

       SportsGame game4 = new SportsGame("Mini World Cup", "India", "Austrilia");

       SportsGame game5 = new SportsGame("IPL", "India", "Austrilia");

       SportsGame game6 = new SportsGame("Asia Cup", "India", "Austrilia");

       SportsGame game7 = new SportsGame("Allen Boarder Trophy", "India", "Austrilia");

       SportsGame game8 = new SportsGame("Indo Series", "India", "Austrilia");

       SportsGame game9 = new SportsGame("ZZZXX Series", "India", "Austrilia");

       SportsGame game10 = new SportsGame("MustSeen Trophy", "India", "Austrilia");

      

       // creating array

       SportsGame[] sports = {game1, game2, game3, game4, game5, game6,

               game7, game8, game9, game10};

      

       // sorting

       Arrays.sort(sports);

      

       for(SportsGame s : sports)

           System.out.println(s.getLeague());

      

   }

}

/*

Sample run:

Allen Boarder Trophy

Asia Cup

Champion Trophy

IPL

Indo Series

Mini World Cup

MustSeen Trophy

T20

World Cup

ZZZXX Series

*/

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote