SlideShare a Scribd company logo
public class Team {
//Attributes
private String teamId;
private String name;
private String firstName;
private String lastName;
private String phone;
private String email;
/**
* Constructor
* param teamId
* param name
* param firstName
* param lastName
* param phone
* param email
*/
public Team(String teamId, String name, String firstName, String lastName, String phone,
String email) {
this.teamId = teamId;
this.name = name;
this.firstName = firstName;
this.lastName = lastName;
this.phone = phone;
this.email = email;
}
/**
* return the teamId
*/
public String getTeamId() {
return teamId;
}
/**
* return the name
*/
public String getName() {
return name;
}
/**
* return the firstName
*/
public String getFirstName() {
return firstName;
}
/**
* return the lastName
*/
public String getLastName() {
return lastName;
}
/**
* return the phone
*/
public String getPhone() {
return phone;
}
/**
* return the email
*/
public String getEmail() {
return email;
}
Override
public String toString() {
return "Team {teamId=" + teamId + ", name=" + name + ", firstName=" + firstName + ",
lastName=" + lastName
+ ", phone=" + phone + ", email=" + email + "}";
}
Override
public boolean equals(Object obj) {
if(obj == null)
return false;
else {
if(!(obj instanceof Team))
return false;
else {
Team other = (Team)obj;
if(this.teamId.equalsIgnoreCase(other.teamId) &&
this.name.equalsIgnoreCase(other.name) &&
this.firstName.equalsIgnoreCase(other.firstName) &&
this.lastName.equalsIgnoreCase(other.lastName) &&
this.phone.equalsIgnoreCase(other.phone) &&
this.email.equalsIgnoreCase(other.email))
return true;
else
return false;
}
}
}
/**
* Checks if the email id contains "(at sign)".
* Is yes returns true else returns false
*/
public boolean isValidEmail() {
return this.email.contains("(at sign)");
}
}
public class Game {
//Attributes
private String gameID;
private String homeTeamId;
private String guestTeamId;
private String gameDate;
private int homeTeamScore;
private int guestTeamScore;
/**
* Constructor
* param gameID
* param homeTeamId
* param guestTeamId
* param gameDate
* param homeTeamScore
* param guestTeamScore
*/
public Game(String gameID, String homeTeamId, String guestTeamId, String gameDate, int
homeTeamScore,
int guestTeamScore) {
this.gameID = gameID;
this.homeTeamId = homeTeamId;
this.guestTeamId = guestTeamId;
this.gameDate = gameDate;
this.homeTeamScore = homeTeamScore;
this.guestTeamScore = guestTeamScore;
}
/**
* return the gameID
*/
public String getGameID() {
return gameID;
}
/**
* return the homeTeamId
*/
public String getHomeTeamId() {
return homeTeamId;
}
/**
* return the guestTeamId
*/
public String getGuestTeamId() {
return guestTeamId;
}
/**
* return the gameDate
*/
public String getGameDate() {
return gameDate;
}
/**
* return the homeTeamScore
*/
public int getHomeTeamScore() {
return homeTeamScore;
}
/**
* return the guestTeamScore
*/
public int getGuestTeamScore() {
return guestTeamScore;
}
Override
public String toString() {
return "Game {gameID=" + gameID + ", homeTeamId=" + homeTeamId + ",
guestTeamId=" + guestTeamId + ", gameDate="
+ gameDate + ", homeTeamScore=" + homeTeamScore + ", guestTeamScore=" +
guestTeamScore + "}";
}
Override
public boolean equals(Object obj) {
if(obj == null)
return false;
else {
if(!(obj instanceof Game))
return false;
else {
Game other = (Game)obj;
if(this.gameID.equalsIgnoreCase(other.gameID) &&
this.homeTeamId.equalsIgnoreCase(other.homeTeamId) &&
this.guestTeamId.equalsIgnoreCase(other.guestTeamId) &&
this.gameDate.equalsIgnoreCase(other.gameDate) &&
(this.homeTeamScore == other.homeTeamScore) &&
(this.guestTeamScore == other.guestTeamScore))
return true;
else
return false;
}
}
}
/**
* Checks if the game date is between 20160101 and 20160531
* If yes return true or return false
*/
public boolean isValidDate() {
int date = Integer.parseInt(gameDate);
return ((20160101 <= date) && (date <= 20160531));
}
}
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Test {
/**
* Creates a Team object with the parameter passed and returns it
* param teamId
* param name
* param firstName
* param lastName
* param phone
* param email
* return
*/
public static Team setTeamAttribute(String teamId, String name, String firstName, String
lastName, String phone, String email) {
return new Team(teamId, name, firstName, lastName, phone, email);
}
/**
* Creates a Game object with the parameter passed and returns it
* param gameID
* param homeTeamId
* param guestTeamId
* param gameDate
* param homeTeamScore
* param guestTeamScore
* return
*/
public static Game setGameAttribute(String gameID, String homeTeamId, String guestTeamId,
String gameDate, int homeTeamScore,
int guestTeamScore) {
return new Game(gameID, homeTeamId, guestTeamId, gameDate, homeTeamScore,
guestTeamScore);
}
public static void main(String[] args) {
//Input file
final String INPUT_FILENAME = "input/hw1input.txt";
//Test 1a
System.out.println("RUNNING TEST 1a");
Team team1 = new Team("1", "Team1", "Ann", "Matt", "123456", "abcxyz.com");
System.out.println(team1);
//Test 1b
System.out.println();
System.out.println("RUNNING TEST 1b");
Game game1 = new Game("101", "Home Team", "Guest Team", "20160303", 12, 18);
System.out.println(game1);
//Open input file
Scanner input = null;
Team team2 = null;
Game game2 = null;
try {
input = new Scanner(new File(INPUT_FILENAME));
//Read first line
String[] inputDtls = input.nextLine().split(",");
//Test 2a
if(inputDtls[0].equalsIgnoreCase("TEAM")) {
System.out.println();
System.out.println("RUNNING TEST 2a");
team2 = setTeamAttribute(inputDtls[1], inputDtls[2], inputDtls[3], inputDtls[4], inputDtls[5],
inputDtls[6]);
if(!team2.isValidEmail())
System.err.println("ERROR: Invalid email address. Is missing (at sign): " +
team2.getEmail());
//Display team1 attributes
System.out.println(team2.getTeamId());
System.out.println(team2.getName());
System.out.println(team2.getFirstName());
System.out.println(team2.getLastName());
System.out.println(team2.getPhone());
System.out.println(team2.getEmail());
}
//Read second line
inputDtls = input.nextLine().split(",");
//Test 2b
if(inputDtls[0].equalsIgnoreCase("GAME")) {
System.out.println();
System.out.println("RUNNING TEST 2b");
game2 = setGameAttribute(inputDtls[1], inputDtls[2], inputDtls[3], inputDtls[4],
Integer.parseInt(inputDtls[5]), Integer.parseInt(inputDtls[6]));
if(!game2.isValidDate())
System.err.println("ERROR: Invalid game date: " + game2.getGameDate());
//Display team attributes
System.out.println(game2.getGameID());
System.out.println(game2.getHomeTeamId());
System.out.println(game2.getGuestTeamId());
System.out.println(game2.getGameDate());
System.out.println(game2.getHomeTeamScore());
System.out.println(game2.getGuestTeamScore());
}
} catch(FileNotFoundException fnfe) {
System.err.println("Data file not found");
} finally {
//Close file
if(input != null)
input.close();
}
//Test 3a
System.out.println();
System.out.println("RUNNING TEST 3a");
System.out.println("TEAM 1 : " + team1);
System.out.println("TEAM 2 : " + team2);
if(team1.equals(team2))
System.out.println("The two teams are same");
else
System.out.println("The two teams not are same");
//Test 3b
System.out.println();
System.out.println("RUNNING TEST 3b");
System.out.println("GAME 1 : " + game1);
System.out.println("GAME 2 : " + game2);
if(game1.equals(game2))
System.out.println("The two games are same");
else
System.out.println("The two games not are same");
}
}
SAMPLE OUTPUT:
RUNNING TEST 1a
Team {teamId=1, name=Team1, firstName=Ann, lastName=Matt, phone=123456,
email=abcxyz.com}
RUNNING TEST 1b
Game {gameID=101, homeTeamId=Home Team, guestTeamId=Guest Team,
gameDate=20160303, homeTeamScore=12, guestTeamScore=18}
RUNNING TEST 2a
ERROR: Invalid email address. Is missing (at sign): roadrunner#gmail.com
1
Road Runner
David
Brown
303-123-4567
roadrunner#gmail.com
RUNNING TEST 2b
ERROR: Invalid game date: 20150105
101
1
2
20150105
4
3
RUNNING TEST 3a
TEAM 1 : Team {teamId=1, name=Team1, firstName=Ann, lastName=Matt, phone=123456,
email=abcxyz.com}
TEAM 2 : Team {teamId=1, name=Road Runner, firstName=David, lastName=Brown,
phone=303-123-4567, email=roadrunner#gmail.com}
The two teams not are same
RUNNING TEST 3b
GAME 1 : Game {gameID=101, homeTeamId=Home Team, guestTeamId=Guest Team,
gameDate=20160303, homeTeamScore=12, guestTeamScore=18}
GAME 2 : Game {gameID=101, homeTeamId=1, guestTeamId=2, gameDate=20150105,
homeTeamScore=4, guestTeamScore=3}
The two games not are same
Solution
public class Team {
//Attributes
private String teamId;
private String name;
private String firstName;
private String lastName;
private String phone;
private String email;
/**
* Constructor
* param teamId
* param name
* param firstName
* param lastName
* param phone
* param email
*/
public Team(String teamId, String name, String firstName, String lastName, String phone,
String email) {
this.teamId = teamId;
this.name = name;
this.firstName = firstName;
this.lastName = lastName;
this.phone = phone;
this.email = email;
}
/**
* return the teamId
*/
public String getTeamId() {
return teamId;
}
/**
* return the name
*/
public String getName() {
return name;
}
/**
* return the firstName
*/
public String getFirstName() {
return firstName;
}
/**
* return the lastName
*/
public String getLastName() {
return lastName;
}
/**
* return the phone
*/
public String getPhone() {
return phone;
}
/**
* return the email
*/
public String getEmail() {
return email;
}
Override
public String toString() {
return "Team {teamId=" + teamId + ", name=" + name + ", firstName=" + firstName + ",
lastName=" + lastName
+ ", phone=" + phone + ", email=" + email + "}";
}
Override
public boolean equals(Object obj) {
if(obj == null)
return false;
else {
if(!(obj instanceof Team))
return false;
else {
Team other = (Team)obj;
if(this.teamId.equalsIgnoreCase(other.teamId) &&
this.name.equalsIgnoreCase(other.name) &&
this.firstName.equalsIgnoreCase(other.firstName) &&
this.lastName.equalsIgnoreCase(other.lastName) &&
this.phone.equalsIgnoreCase(other.phone) &&
this.email.equalsIgnoreCase(other.email))
return true;
else
return false;
}
}
}
/**
* Checks if the email id contains "(at sign)".
* Is yes returns true else returns false
*/
public boolean isValidEmail() {
return this.email.contains("(at sign)");
}
}
public class Game {
//Attributes
private String gameID;
private String homeTeamId;
private String guestTeamId;
private String gameDate;
private int homeTeamScore;
private int guestTeamScore;
/**
* Constructor
* param gameID
* param homeTeamId
* param guestTeamId
* param gameDate
* param homeTeamScore
* param guestTeamScore
*/
public Game(String gameID, String homeTeamId, String guestTeamId, String gameDate, int
homeTeamScore,
int guestTeamScore) {
this.gameID = gameID;
this.homeTeamId = homeTeamId;
this.guestTeamId = guestTeamId;
this.gameDate = gameDate;
this.homeTeamScore = homeTeamScore;
this.guestTeamScore = guestTeamScore;
}
/**
* return the gameID
*/
public String getGameID() {
return gameID;
}
/**
* return the homeTeamId
*/
public String getHomeTeamId() {
return homeTeamId;
}
/**
* return the guestTeamId
*/
public String getGuestTeamId() {
return guestTeamId;
}
/**
* return the gameDate
*/
public String getGameDate() {
return gameDate;
}
/**
* return the homeTeamScore
*/
public int getHomeTeamScore() {
return homeTeamScore;
}
/**
* return the guestTeamScore
*/
public int getGuestTeamScore() {
return guestTeamScore;
}
Override
public String toString() {
return "Game {gameID=" + gameID + ", homeTeamId=" + homeTeamId + ",
guestTeamId=" + guestTeamId + ", gameDate="
+ gameDate + ", homeTeamScore=" + homeTeamScore + ", guestTeamScore=" +
guestTeamScore + "}";
}
Override
public boolean equals(Object obj) {
if(obj == null)
return false;
else {
if(!(obj instanceof Game))
return false;
else {
Game other = (Game)obj;
if(this.gameID.equalsIgnoreCase(other.gameID) &&
this.homeTeamId.equalsIgnoreCase(other.homeTeamId) &&
this.guestTeamId.equalsIgnoreCase(other.guestTeamId) &&
this.gameDate.equalsIgnoreCase(other.gameDate) &&
(this.homeTeamScore == other.homeTeamScore) &&
(this.guestTeamScore == other.guestTeamScore))
return true;
else
return false;
}
}
}
/**
* Checks if the game date is between 20160101 and 20160531
* If yes return true or return false
*/
public boolean isValidDate() {
int date = Integer.parseInt(gameDate);
return ((20160101 <= date) && (date <= 20160531));
}
}
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Test {
/**
* Creates a Team object with the parameter passed and returns it
* param teamId
* param name
* param firstName
* param lastName
* param phone
* param email
* return
*/
public static Team setTeamAttribute(String teamId, String name, String firstName, String
lastName, String phone, String email) {
return new Team(teamId, name, firstName, lastName, phone, email);
}
/**
* Creates a Game object with the parameter passed and returns it
* param gameID
* param homeTeamId
* param guestTeamId
* param gameDate
* param homeTeamScore
* param guestTeamScore
* return
*/
public static Game setGameAttribute(String gameID, String homeTeamId, String guestTeamId,
String gameDate, int homeTeamScore,
int guestTeamScore) {
return new Game(gameID, homeTeamId, guestTeamId, gameDate, homeTeamScore,
guestTeamScore);
}
public static void main(String[] args) {
//Input file
final String INPUT_FILENAME = "input/hw1input.txt";
//Test 1a
System.out.println("RUNNING TEST 1a");
Team team1 = new Team("1", "Team1", "Ann", "Matt", "123456", "abcxyz.com");
System.out.println(team1);
//Test 1b
System.out.println();
System.out.println("RUNNING TEST 1b");
Game game1 = new Game("101", "Home Team", "Guest Team", "20160303", 12, 18);
System.out.println(game1);
//Open input file
Scanner input = null;
Team team2 = null;
Game game2 = null;
try {
input = new Scanner(new File(INPUT_FILENAME));
//Read first line
String[] inputDtls = input.nextLine().split(",");
//Test 2a
if(inputDtls[0].equalsIgnoreCase("TEAM")) {
System.out.println();
System.out.println("RUNNING TEST 2a");
team2 = setTeamAttribute(inputDtls[1], inputDtls[2], inputDtls[3], inputDtls[4], inputDtls[5],
inputDtls[6]);
if(!team2.isValidEmail())
System.err.println("ERROR: Invalid email address. Is missing (at sign): " +
team2.getEmail());
//Display team1 attributes
System.out.println(team2.getTeamId());
System.out.println(team2.getName());
System.out.println(team2.getFirstName());
System.out.println(team2.getLastName());
System.out.println(team2.getPhone());
System.out.println(team2.getEmail());
}
//Read second line
inputDtls = input.nextLine().split(",");
//Test 2b
if(inputDtls[0].equalsIgnoreCase("GAME")) {
System.out.println();
System.out.println("RUNNING TEST 2b");
game2 = setGameAttribute(inputDtls[1], inputDtls[2], inputDtls[3], inputDtls[4],
Integer.parseInt(inputDtls[5]), Integer.parseInt(inputDtls[6]));
if(!game2.isValidDate())
System.err.println("ERROR: Invalid game date: " + game2.getGameDate());
//Display team attributes
System.out.println(game2.getGameID());
System.out.println(game2.getHomeTeamId());
System.out.println(game2.getGuestTeamId());
System.out.println(game2.getGameDate());
System.out.println(game2.getHomeTeamScore());
System.out.println(game2.getGuestTeamScore());
}
} catch(FileNotFoundException fnfe) {
System.err.println("Data file not found");
} finally {
//Close file
if(input != null)
input.close();
}
//Test 3a
System.out.println();
System.out.println("RUNNING TEST 3a");
System.out.println("TEAM 1 : " + team1);
System.out.println("TEAM 2 : " + team2);
if(team1.equals(team2))
System.out.println("The two teams are same");
else
System.out.println("The two teams not are same");
//Test 3b
System.out.println();
System.out.println("RUNNING TEST 3b");
System.out.println("GAME 1 : " + game1);
System.out.println("GAME 2 : " + game2);
if(game1.equals(game2))
System.out.println("The two games are same");
else
System.out.println("The two games not are same");
}
}
SAMPLE OUTPUT:
RUNNING TEST 1a
Team {teamId=1, name=Team1, firstName=Ann, lastName=Matt, phone=123456,
email=abcxyz.com}
RUNNING TEST 1b
Game {gameID=101, homeTeamId=Home Team, guestTeamId=Guest Team,
gameDate=20160303, homeTeamScore=12, guestTeamScore=18}
RUNNING TEST 2a
ERROR: Invalid email address. Is missing (at sign): roadrunner#gmail.com
1
Road Runner
David
Brown
303-123-4567
roadrunner#gmail.com
RUNNING TEST 2b
ERROR: Invalid game date: 20150105
101
1
2
20150105
4
3
RUNNING TEST 3a
TEAM 1 : Team {teamId=1, name=Team1, firstName=Ann, lastName=Matt, phone=123456,
email=abcxyz.com}
TEAM 2 : Team {teamId=1, name=Road Runner, firstName=David, lastName=Brown,
phone=303-123-4567, email=roadrunner#gmail.com}
The two teams not are same
RUNNING TEST 3b
GAME 1 : Game {gameID=101, homeTeamId=Home Team, guestTeamId=Guest Team,
gameDate=20160303, homeTeamScore=12, guestTeamScore=18}
GAME 2 : Game {gameID=101, homeTeamId=1, guestTeamId=2, gameDate=20150105,
homeTeamScore=4, guestTeamScore=3}
The two games not are same

More Related Content

Similar to public class Team {Attributes private String teamId; private.pdf

Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
AroraRajinder1
 
question.(player, entity ,field and base.java codes are given)Stop.pdf
question.(player, entity ,field and base.java codes are given)Stop.pdfquestion.(player, entity ,field and base.java codes are given)Stop.pdf
question.(player, entity ,field and base.java codes are given)Stop.pdf
shahidqamar17
 
public interface Game Note interface in place of class { .pdf
public interface Game  Note interface in place of class { .pdfpublic interface Game  Note interface in place of class { .pdf
public interface Game Note interface in place of class { .pdf
kavithaarp
 
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdfHere is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
trishulinoverseas1
 
Here are the instructions and then the code in a sec. Please R.pdf
Here are the instructions and then the code in a sec. Please R.pdfHere are the instructions and then the code in a sec. Please R.pdf
Here are the instructions and then the code in a sec. Please R.pdf
aggarwalshoppe14
 
mainpublic class AssignmentThree {    public static void ma.pdf
mainpublic class AssignmentThree {    public static void ma.pdfmainpublic class AssignmentThree {    public static void ma.pdf
mainpublic class AssignmentThree {    public static void ma.pdf
fathimafancyjeweller
 
Goal- Your goal in this assignment is to write a Java program that sim.pdf
Goal- Your goal in this assignment is to write a Java program that sim.pdfGoal- Your goal in this assignment is to write a Java program that sim.pdf
Goal- Your goal in this assignment is to write a Java program that sim.pdf
aaicommunication34
 
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
Write a class (BasketballTeam) encapsulating the concept of a tea.pdfWrite a class (BasketballTeam) encapsulating the concept of a tea.pdf
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
rozakashif85
 
I really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdfI really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdf
aggarwalshoppe14
 
package com.tictactoe; public class Main {public void play() {.pdf
package com.tictactoe; public class Main {public void play() {.pdfpackage com.tictactoe; public class Main {public void play() {.pdf
package com.tictactoe; public class Main {public void play() {.pdf
info430661
 
I really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdfI really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdf
aggarwalshoppe14
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdf
aplolomedicalstoremr
 
Please use java to write the program that simulates the card game!!! T (1).pdf
Please use java to write the program that simulates the card game!!! T (1).pdfPlease use java to write the program that simulates the card game!!! T (1).pdf
Please use java to write the program that simulates the card game!!! T (1).pdf
admin463580
 
Creating a Facebook Clone - Part XX.pdf
Creating a Facebook Clone - Part XX.pdfCreating a Facebook Clone - Part XX.pdf
Creating a Facebook Clone - Part XX.pdf
ShaiAlmog1
 
public class Storm {   Attributes    private String stormName;.pdf
public class Storm {   Attributes    private String stormName;.pdfpublic class Storm {   Attributes    private String stormName;.pdf
public class Storm {   Attributes    private String stormName;.pdf
sharnapiyush773
 
CS117-S18-AlharbiMohammed-master.gitignore.class.ctxt..docx
CS117-S18-AlharbiMohammed-master.gitignore.class.ctxt..docxCS117-S18-AlharbiMohammed-master.gitignore.class.ctxt..docx
CS117-S18-AlharbiMohammed-master.gitignore.class.ctxt..docx
annettsparrow
 
Mocks introduction
Mocks introductionMocks introduction
Mocks introductionSperasoft
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
lakshmijewellery
 
TilePUzzle class Anderson, Franceschi public class TilePu.docx
 TilePUzzle class Anderson, Franceschi public class TilePu.docx TilePUzzle class Anderson, Franceschi public class TilePu.docx
TilePUzzle class Anderson, Franceschi public class TilePu.docx
Komlin1
 
import java.util.Scanner;public class Fraction {   instan.pdf
import java.util.Scanner;public class Fraction {    instan.pdfimport java.util.Scanner;public class Fraction {    instan.pdf
import java.util.Scanner;public class Fraction {   instan.pdf
apleathers
 

Similar to public class Team {Attributes private String teamId; private.pdf (20)

Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
 
question.(player, entity ,field and base.java codes are given)Stop.pdf
question.(player, entity ,field and base.java codes are given)Stop.pdfquestion.(player, entity ,field and base.java codes are given)Stop.pdf
question.(player, entity ,field and base.java codes are given)Stop.pdf
 
public interface Game Note interface in place of class { .pdf
public interface Game  Note interface in place of class { .pdfpublic interface Game  Note interface in place of class { .pdf
public interface Game Note interface in place of class { .pdf
 
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdfHere is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
 
Here are the instructions and then the code in a sec. Please R.pdf
Here are the instructions and then the code in a sec. Please R.pdfHere are the instructions and then the code in a sec. Please R.pdf
Here are the instructions and then the code in a sec. Please R.pdf
 
mainpublic class AssignmentThree {    public static void ma.pdf
mainpublic class AssignmentThree {    public static void ma.pdfmainpublic class AssignmentThree {    public static void ma.pdf
mainpublic class AssignmentThree {    public static void ma.pdf
 
Goal- Your goal in this assignment is to write a Java program that sim.pdf
Goal- Your goal in this assignment is to write a Java program that sim.pdfGoal- Your goal in this assignment is to write a Java program that sim.pdf
Goal- Your goal in this assignment is to write a Java program that sim.pdf
 
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
Write a class (BasketballTeam) encapsulating the concept of a tea.pdfWrite a class (BasketballTeam) encapsulating the concept of a tea.pdf
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
 
I really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdfI really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdf
 
package com.tictactoe; public class Main {public void play() {.pdf
package com.tictactoe; public class Main {public void play() {.pdfpackage com.tictactoe; public class Main {public void play() {.pdf
package com.tictactoe; public class Main {public void play() {.pdf
 
I really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdfI really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdf
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdf
 
Please use java to write the program that simulates the card game!!! T (1).pdf
Please use java to write the program that simulates the card game!!! T (1).pdfPlease use java to write the program that simulates the card game!!! T (1).pdf
Please use java to write the program that simulates the card game!!! T (1).pdf
 
Creating a Facebook Clone - Part XX.pdf
Creating a Facebook Clone - Part XX.pdfCreating a Facebook Clone - Part XX.pdf
Creating a Facebook Clone - Part XX.pdf
 
public class Storm {   Attributes    private String stormName;.pdf
public class Storm {   Attributes    private String stormName;.pdfpublic class Storm {   Attributes    private String stormName;.pdf
public class Storm {   Attributes    private String stormName;.pdf
 
CS117-S18-AlharbiMohammed-master.gitignore.class.ctxt..docx
CS117-S18-AlharbiMohammed-master.gitignore.class.ctxt..docxCS117-S18-AlharbiMohammed-master.gitignore.class.ctxt..docx
CS117-S18-AlharbiMohammed-master.gitignore.class.ctxt..docx
 
Mocks introduction
Mocks introductionMocks introduction
Mocks introduction
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
 
TilePUzzle class Anderson, Franceschi public class TilePu.docx
 TilePUzzle class Anderson, Franceschi public class TilePu.docx TilePUzzle class Anderson, Franceschi public class TilePu.docx
TilePUzzle class Anderson, Franceschi public class TilePu.docx
 
import java.util.Scanner;public class Fraction {   instan.pdf
import java.util.Scanner;public class Fraction {    instan.pdfimport java.util.Scanner;public class Fraction {    instan.pdf
import java.util.Scanner;public class Fraction {   instan.pdf
 

More from anushasarees

Properties of enantiomers Their NMR and IR spec.pdf
                     Properties of enantiomers Their NMR and IR spec.pdf                     Properties of enantiomers Their NMR and IR spec.pdf
Properties of enantiomers Their NMR and IR spec.pdf
anushasarees
 
O2 will be released as Na+ will not get reduce bu.pdf
                     O2 will be released as Na+ will not get reduce bu.pdf                     O2 will be released as Na+ will not get reduce bu.pdf
O2 will be released as Na+ will not get reduce bu.pdf
anushasarees
 
Huntingtons disease and other hereditary diseas.pdf
                     Huntingtons disease and other hereditary diseas.pdf                     Huntingtons disease and other hereditary diseas.pdf
Huntingtons disease and other hereditary diseas.pdf
anushasarees
 
ionic character BaF MgO FeO SO2 N2 .pdf
                     ionic character BaF  MgO  FeO  SO2  N2  .pdf                     ionic character BaF  MgO  FeO  SO2  N2  .pdf
ionic character BaF MgO FeO SO2 N2 .pdf
anushasarees
 
Nitrogen can hold up to 4 bonds. In sodium amide.pdf
                     Nitrogen can hold up to 4 bonds.  In sodium amide.pdf                     Nitrogen can hold up to 4 bonds.  In sodium amide.pdf
Nitrogen can hold up to 4 bonds. In sodium amide.pdf
anushasarees
 
C. hydrogen bonding. between N and H of differen.pdf
                     C. hydrogen bonding.  between N and H of differen.pdf                     C. hydrogen bonding.  between N and H of differen.pdf
C. hydrogen bonding. between N and H of differen.pdf
anushasarees
 
  import java.util.;import acm.program.;public class FlightPla.pdf
  import java.util.;import acm.program.;public class FlightPla.pdf  import java.util.;import acm.program.;public class FlightPla.pdf
  import java.util.;import acm.program.;public class FlightPla.pdf
anushasarees
 
We Know that    Amines are generally basic in naturebecause of th.pdf
We Know that    Amines are generally basic in naturebecause of th.pdfWe Know that    Amines are generally basic in naturebecause of th.pdf
We Know that    Amines are generally basic in naturebecause of th.pdf
anushasarees
 
There are so many java Input Output classes that are available in it.pdf
There are so many java Input Output classes that are available in it.pdfThere are so many java Input Output classes that are available in it.pdf
There are so many java Input Output classes that are available in it.pdf
anushasarees
 
Three are ways to protect unused switch ports Option B,D and E is.pdf
Three are ways to protect unused switch ports Option B,D and E is.pdfThree are ways to protect unused switch ports Option B,D and E is.pdf
Three are ways to protect unused switch ports Option B,D and E is.pdf
anushasarees
 
The water turns green because the copper(II)sulfate is breaking apar.pdf
The water turns green because the copper(II)sulfate is breaking apar.pdfThe water turns green because the copper(II)sulfate is breaking apar.pdf
The water turns green because the copper(II)sulfate is breaking apar.pdf
anushasarees
 
The mutation is known as inversion. In this a segment from one chrom.pdf
The mutation is known as inversion. In this a segment from one chrom.pdfThe mutation is known as inversion. In this a segment from one chrom.pdf
The mutation is known as inversion. In this a segment from one chrom.pdf
anushasarees
 
The main organelles in protein sorting and targeting are Rough endop.pdf
The main organelles in protein sorting and targeting are Rough endop.pdfThe main organelles in protein sorting and targeting are Rough endop.pdf
The main organelles in protein sorting and targeting are Rough endop.pdf
anushasarees
 
Successfully supporting managerial decision-making is critically dep.pdf
Successfully supporting managerial decision-making is critically dep.pdfSuccessfully supporting managerial decision-making is critically dep.pdf
Successfully supporting managerial decision-making is critically dep.pdf
anushasarees
 
SolutionTo know that the team has identified all of the significa.pdf
SolutionTo know that the team has identified all of the significa.pdfSolutionTo know that the team has identified all of the significa.pdf
SolutionTo know that the team has identified all of the significa.pdf
anushasarees
 
Solutiona) Maximum bus speed = bus driver delay + propagation del.pdf
Solutiona) Maximum bus speed = bus driver delay + propagation del.pdfSolutiona) Maximum bus speed = bus driver delay + propagation del.pdf
Solutiona) Maximum bus speed = bus driver delay + propagation del.pdf
anushasarees
 
Solution Polymerase chain reaction is process in which several co.pdf
Solution Polymerase chain reaction is process in which several co.pdfSolution Polymerase chain reaction is process in which several co.pdf
Solution Polymerase chain reaction is process in which several co.pdf
anushasarees
 
Doubling [NO] would quadruple the rate .pdf
                     Doubling [NO] would quadruple the rate           .pdf                     Doubling [NO] would quadruple the rate           .pdf
Doubling [NO] would quadruple the rate .pdf
anushasarees
 
Correct answer F)4.0 .pdf
                     Correct answer F)4.0                            .pdf                     Correct answer F)4.0                            .pdf
Correct answer F)4.0 .pdf
anushasarees
 
D.) The system is neither at steady state or equi.pdf
                     D.) The system is neither at steady state or equi.pdf                     D.) The system is neither at steady state or equi.pdf
D.) The system is neither at steady state or equi.pdf
anushasarees
 

More from anushasarees (20)

Properties of enantiomers Their NMR and IR spec.pdf
                     Properties of enantiomers Their NMR and IR spec.pdf                     Properties of enantiomers Their NMR and IR spec.pdf
Properties of enantiomers Their NMR and IR spec.pdf
 
O2 will be released as Na+ will not get reduce bu.pdf
                     O2 will be released as Na+ will not get reduce bu.pdf                     O2 will be released as Na+ will not get reduce bu.pdf
O2 will be released as Na+ will not get reduce bu.pdf
 
Huntingtons disease and other hereditary diseas.pdf
                     Huntingtons disease and other hereditary diseas.pdf                     Huntingtons disease and other hereditary diseas.pdf
Huntingtons disease and other hereditary diseas.pdf
 
ionic character BaF MgO FeO SO2 N2 .pdf
                     ionic character BaF  MgO  FeO  SO2  N2  .pdf                     ionic character BaF  MgO  FeO  SO2  N2  .pdf
ionic character BaF MgO FeO SO2 N2 .pdf
 
Nitrogen can hold up to 4 bonds. In sodium amide.pdf
                     Nitrogen can hold up to 4 bonds.  In sodium amide.pdf                     Nitrogen can hold up to 4 bonds.  In sodium amide.pdf
Nitrogen can hold up to 4 bonds. In sodium amide.pdf
 
C. hydrogen bonding. between N and H of differen.pdf
                     C. hydrogen bonding.  between N and H of differen.pdf                     C. hydrogen bonding.  between N and H of differen.pdf
C. hydrogen bonding. between N and H of differen.pdf
 
  import java.util.;import acm.program.;public class FlightPla.pdf
  import java.util.;import acm.program.;public class FlightPla.pdf  import java.util.;import acm.program.;public class FlightPla.pdf
  import java.util.;import acm.program.;public class FlightPla.pdf
 
We Know that    Amines are generally basic in naturebecause of th.pdf
We Know that    Amines are generally basic in naturebecause of th.pdfWe Know that    Amines are generally basic in naturebecause of th.pdf
We Know that    Amines are generally basic in naturebecause of th.pdf
 
There are so many java Input Output classes that are available in it.pdf
There are so many java Input Output classes that are available in it.pdfThere are so many java Input Output classes that are available in it.pdf
There are so many java Input Output classes that are available in it.pdf
 
Three are ways to protect unused switch ports Option B,D and E is.pdf
Three are ways to protect unused switch ports Option B,D and E is.pdfThree are ways to protect unused switch ports Option B,D and E is.pdf
Three are ways to protect unused switch ports Option B,D and E is.pdf
 
The water turns green because the copper(II)sulfate is breaking apar.pdf
The water turns green because the copper(II)sulfate is breaking apar.pdfThe water turns green because the copper(II)sulfate is breaking apar.pdf
The water turns green because the copper(II)sulfate is breaking apar.pdf
 
The mutation is known as inversion. In this a segment from one chrom.pdf
The mutation is known as inversion. In this a segment from one chrom.pdfThe mutation is known as inversion. In this a segment from one chrom.pdf
The mutation is known as inversion. In this a segment from one chrom.pdf
 
The main organelles in protein sorting and targeting are Rough endop.pdf
The main organelles in protein sorting and targeting are Rough endop.pdfThe main organelles in protein sorting and targeting are Rough endop.pdf
The main organelles in protein sorting and targeting are Rough endop.pdf
 
Successfully supporting managerial decision-making is critically dep.pdf
Successfully supporting managerial decision-making is critically dep.pdfSuccessfully supporting managerial decision-making is critically dep.pdf
Successfully supporting managerial decision-making is critically dep.pdf
 
SolutionTo know that the team has identified all of the significa.pdf
SolutionTo know that the team has identified all of the significa.pdfSolutionTo know that the team has identified all of the significa.pdf
SolutionTo know that the team has identified all of the significa.pdf
 
Solutiona) Maximum bus speed = bus driver delay + propagation del.pdf
Solutiona) Maximum bus speed = bus driver delay + propagation del.pdfSolutiona) Maximum bus speed = bus driver delay + propagation del.pdf
Solutiona) Maximum bus speed = bus driver delay + propagation del.pdf
 
Solution Polymerase chain reaction is process in which several co.pdf
Solution Polymerase chain reaction is process in which several co.pdfSolution Polymerase chain reaction is process in which several co.pdf
Solution Polymerase chain reaction is process in which several co.pdf
 
Doubling [NO] would quadruple the rate .pdf
                     Doubling [NO] would quadruple the rate           .pdf                     Doubling [NO] would quadruple the rate           .pdf
Doubling [NO] would quadruple the rate .pdf
 
Correct answer F)4.0 .pdf
                     Correct answer F)4.0                            .pdf                     Correct answer F)4.0                            .pdf
Correct answer F)4.0 .pdf
 
D.) The system is neither at steady state or equi.pdf
                     D.) The system is neither at steady state or equi.pdf                     D.) The system is neither at steady state or equi.pdf
D.) The system is neither at steady state or equi.pdf
 

Recently uploaded

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 

Recently uploaded (20)

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 

public class Team {Attributes private String teamId; private.pdf

  • 1. public class Team { //Attributes private String teamId; private String name; private String firstName; private String lastName; private String phone; private String email; /** * Constructor * param teamId * param name * param firstName * param lastName * param phone * param email */ public Team(String teamId, String name, String firstName, String lastName, String phone, String email) { this.teamId = teamId; this.name = name; this.firstName = firstName; this.lastName = lastName; this.phone = phone; this.email = email; } /** * return the teamId */ public String getTeamId() { return teamId; } /** * return the name */
  • 2. public String getName() { return name; } /** * return the firstName */ public String getFirstName() { return firstName; } /** * return the lastName */ public String getLastName() { return lastName; } /** * return the phone */ public String getPhone() { return phone; } /** * return the email */ public String getEmail() { return email; } Override public String toString() { return "Team {teamId=" + teamId + ", name=" + name + ", firstName=" + firstName + ", lastName=" + lastName + ", phone=" + phone + ", email=" + email + "}"; } Override public boolean equals(Object obj) {
  • 3. if(obj == null) return false; else { if(!(obj instanceof Team)) return false; else { Team other = (Team)obj; if(this.teamId.equalsIgnoreCase(other.teamId) && this.name.equalsIgnoreCase(other.name) && this.firstName.equalsIgnoreCase(other.firstName) && this.lastName.equalsIgnoreCase(other.lastName) && this.phone.equalsIgnoreCase(other.phone) && this.email.equalsIgnoreCase(other.email)) return true; else return false; } } } /** * Checks if the email id contains "(at sign)". * Is yes returns true else returns false */ public boolean isValidEmail() { return this.email.contains("(at sign)"); } } public class Game { //Attributes private String gameID; private String homeTeamId; private String guestTeamId; private String gameDate; private int homeTeamScore;
  • 4. private int guestTeamScore; /** * Constructor * param gameID * param homeTeamId * param guestTeamId * param gameDate * param homeTeamScore * param guestTeamScore */ public Game(String gameID, String homeTeamId, String guestTeamId, String gameDate, int homeTeamScore, int guestTeamScore) { this.gameID = gameID; this.homeTeamId = homeTeamId; this.guestTeamId = guestTeamId; this.gameDate = gameDate; this.homeTeamScore = homeTeamScore; this.guestTeamScore = guestTeamScore; } /** * return the gameID */ public String getGameID() { return gameID; } /** * return the homeTeamId */ public String getHomeTeamId() { return homeTeamId; } /** * return the guestTeamId */
  • 5. public String getGuestTeamId() { return guestTeamId; } /** * return the gameDate */ public String getGameDate() { return gameDate; } /** * return the homeTeamScore */ public int getHomeTeamScore() { return homeTeamScore; } /** * return the guestTeamScore */ public int getGuestTeamScore() { return guestTeamScore; } Override public String toString() { return "Game {gameID=" + gameID + ", homeTeamId=" + homeTeamId + ", guestTeamId=" + guestTeamId + ", gameDate=" + gameDate + ", homeTeamScore=" + homeTeamScore + ", guestTeamScore=" + guestTeamScore + "}"; } Override public boolean equals(Object obj) { if(obj == null) return false; else { if(!(obj instanceof Game)) return false; else {
  • 6. Game other = (Game)obj; if(this.gameID.equalsIgnoreCase(other.gameID) && this.homeTeamId.equalsIgnoreCase(other.homeTeamId) && this.guestTeamId.equalsIgnoreCase(other.guestTeamId) && this.gameDate.equalsIgnoreCase(other.gameDate) && (this.homeTeamScore == other.homeTeamScore) && (this.guestTeamScore == other.guestTeamScore)) return true; else return false; } } } /** * Checks if the game date is between 20160101 and 20160531 * If yes return true or return false */ public boolean isValidDate() { int date = Integer.parseInt(gameDate); return ((20160101 <= date) && (date <= 20160531)); } } import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Test { /** * Creates a Team object with the parameter passed and returns it * param teamId * param name * param firstName * param lastName * param phone
  • 7. * param email * return */ public static Team setTeamAttribute(String teamId, String name, String firstName, String lastName, String phone, String email) { return new Team(teamId, name, firstName, lastName, phone, email); } /** * Creates a Game object with the parameter passed and returns it * param gameID * param homeTeamId * param guestTeamId * param gameDate * param homeTeamScore * param guestTeamScore * return */ public static Game setGameAttribute(String gameID, String homeTeamId, String guestTeamId, String gameDate, int homeTeamScore, int guestTeamScore) { return new Game(gameID, homeTeamId, guestTeamId, gameDate, homeTeamScore, guestTeamScore); } public static void main(String[] args) { //Input file final String INPUT_FILENAME = "input/hw1input.txt"; //Test 1a System.out.println("RUNNING TEST 1a"); Team team1 = new Team("1", "Team1", "Ann", "Matt", "123456", "abcxyz.com"); System.out.println(team1); //Test 1b System.out.println();
  • 8. System.out.println("RUNNING TEST 1b"); Game game1 = new Game("101", "Home Team", "Guest Team", "20160303", 12, 18); System.out.println(game1); //Open input file Scanner input = null; Team team2 = null; Game game2 = null; try { input = new Scanner(new File(INPUT_FILENAME)); //Read first line String[] inputDtls = input.nextLine().split(","); //Test 2a if(inputDtls[0].equalsIgnoreCase("TEAM")) { System.out.println(); System.out.println("RUNNING TEST 2a"); team2 = setTeamAttribute(inputDtls[1], inputDtls[2], inputDtls[3], inputDtls[4], inputDtls[5], inputDtls[6]); if(!team2.isValidEmail()) System.err.println("ERROR: Invalid email address. Is missing (at sign): " + team2.getEmail()); //Display team1 attributes System.out.println(team2.getTeamId()); System.out.println(team2.getName()); System.out.println(team2.getFirstName()); System.out.println(team2.getLastName()); System.out.println(team2.getPhone()); System.out.println(team2.getEmail()); } //Read second line inputDtls = input.nextLine().split(","); //Test 2b
  • 9. if(inputDtls[0].equalsIgnoreCase("GAME")) { System.out.println(); System.out.println("RUNNING TEST 2b"); game2 = setGameAttribute(inputDtls[1], inputDtls[2], inputDtls[3], inputDtls[4], Integer.parseInt(inputDtls[5]), Integer.parseInt(inputDtls[6])); if(!game2.isValidDate()) System.err.println("ERROR: Invalid game date: " + game2.getGameDate()); //Display team attributes System.out.println(game2.getGameID()); System.out.println(game2.getHomeTeamId()); System.out.println(game2.getGuestTeamId()); System.out.println(game2.getGameDate()); System.out.println(game2.getHomeTeamScore()); System.out.println(game2.getGuestTeamScore()); } } catch(FileNotFoundException fnfe) { System.err.println("Data file not found"); } finally { //Close file if(input != null) input.close(); } //Test 3a System.out.println(); System.out.println("RUNNING TEST 3a"); System.out.println("TEAM 1 : " + team1); System.out.println("TEAM 2 : " + team2); if(team1.equals(team2)) System.out.println("The two teams are same"); else System.out.println("The two teams not are same");
  • 10. //Test 3b System.out.println(); System.out.println("RUNNING TEST 3b"); System.out.println("GAME 1 : " + game1); System.out.println("GAME 2 : " + game2); if(game1.equals(game2)) System.out.println("The two games are same"); else System.out.println("The two games not are same"); } } SAMPLE OUTPUT: RUNNING TEST 1a Team {teamId=1, name=Team1, firstName=Ann, lastName=Matt, phone=123456, email=abcxyz.com} RUNNING TEST 1b Game {gameID=101, homeTeamId=Home Team, guestTeamId=Guest Team, gameDate=20160303, homeTeamScore=12, guestTeamScore=18} RUNNING TEST 2a ERROR: Invalid email address. Is missing (at sign): roadrunner#gmail.com 1 Road Runner David Brown 303-123-4567 roadrunner#gmail.com RUNNING TEST 2b ERROR: Invalid game date: 20150105 101 1 2 20150105 4 3 RUNNING TEST 3a TEAM 1 : Team {teamId=1, name=Team1, firstName=Ann, lastName=Matt, phone=123456,
  • 11. email=abcxyz.com} TEAM 2 : Team {teamId=1, name=Road Runner, firstName=David, lastName=Brown, phone=303-123-4567, email=roadrunner#gmail.com} The two teams not are same RUNNING TEST 3b GAME 1 : Game {gameID=101, homeTeamId=Home Team, guestTeamId=Guest Team, gameDate=20160303, homeTeamScore=12, guestTeamScore=18} GAME 2 : Game {gameID=101, homeTeamId=1, guestTeamId=2, gameDate=20150105, homeTeamScore=4, guestTeamScore=3} The two games not are same Solution public class Team { //Attributes private String teamId; private String name; private String firstName; private String lastName; private String phone; private String email; /** * Constructor * param teamId * param name * param firstName * param lastName * param phone * param email */ public Team(String teamId, String name, String firstName, String lastName, String phone, String email) { this.teamId = teamId; this.name = name; this.firstName = firstName; this.lastName = lastName;
  • 12. this.phone = phone; this.email = email; } /** * return the teamId */ public String getTeamId() { return teamId; } /** * return the name */ public String getName() { return name; } /** * return the firstName */ public String getFirstName() { return firstName; } /** * return the lastName */ public String getLastName() { return lastName; } /** * return the phone */ public String getPhone() { return phone; } /** * return the email */
  • 13. public String getEmail() { return email; } Override public String toString() { return "Team {teamId=" + teamId + ", name=" + name + ", firstName=" + firstName + ", lastName=" + lastName + ", phone=" + phone + ", email=" + email + "}"; } Override public boolean equals(Object obj) { if(obj == null) return false; else { if(!(obj instanceof Team)) return false; else { Team other = (Team)obj; if(this.teamId.equalsIgnoreCase(other.teamId) && this.name.equalsIgnoreCase(other.name) && this.firstName.equalsIgnoreCase(other.firstName) && this.lastName.equalsIgnoreCase(other.lastName) && this.phone.equalsIgnoreCase(other.phone) && this.email.equalsIgnoreCase(other.email)) return true; else return false; } } } /** * Checks if the email id contains "(at sign)". * Is yes returns true else returns false
  • 14. */ public boolean isValidEmail() { return this.email.contains("(at sign)"); } } public class Game { //Attributes private String gameID; private String homeTeamId; private String guestTeamId; private String gameDate; private int homeTeamScore; private int guestTeamScore; /** * Constructor * param gameID * param homeTeamId * param guestTeamId * param gameDate * param homeTeamScore * param guestTeamScore */ public Game(String gameID, String homeTeamId, String guestTeamId, String gameDate, int homeTeamScore, int guestTeamScore) { this.gameID = gameID; this.homeTeamId = homeTeamId; this.guestTeamId = guestTeamId; this.gameDate = gameDate; this.homeTeamScore = homeTeamScore; this.guestTeamScore = guestTeamScore; } /** * return the gameID */
  • 15. public String getGameID() { return gameID; } /** * return the homeTeamId */ public String getHomeTeamId() { return homeTeamId; } /** * return the guestTeamId */ public String getGuestTeamId() { return guestTeamId; } /** * return the gameDate */ public String getGameDate() { return gameDate; } /** * return the homeTeamScore */ public int getHomeTeamScore() { return homeTeamScore; } /** * return the guestTeamScore */ public int getGuestTeamScore() { return guestTeamScore; } Override public String toString() { return "Game {gameID=" + gameID + ", homeTeamId=" + homeTeamId + ",
  • 16. guestTeamId=" + guestTeamId + ", gameDate=" + gameDate + ", homeTeamScore=" + homeTeamScore + ", guestTeamScore=" + guestTeamScore + "}"; } Override public boolean equals(Object obj) { if(obj == null) return false; else { if(!(obj instanceof Game)) return false; else { Game other = (Game)obj; if(this.gameID.equalsIgnoreCase(other.gameID) && this.homeTeamId.equalsIgnoreCase(other.homeTeamId) && this.guestTeamId.equalsIgnoreCase(other.guestTeamId) && this.gameDate.equalsIgnoreCase(other.gameDate) && (this.homeTeamScore == other.homeTeamScore) && (this.guestTeamScore == other.guestTeamScore)) return true; else return false; } } } /** * Checks if the game date is between 20160101 and 20160531 * If yes return true or return false */ public boolean isValidDate() { int date = Integer.parseInt(gameDate); return ((20160101 <= date) && (date <= 20160531)); }
  • 17. } import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Test { /** * Creates a Team object with the parameter passed and returns it * param teamId * param name * param firstName * param lastName * param phone * param email * return */ public static Team setTeamAttribute(String teamId, String name, String firstName, String lastName, String phone, String email) { return new Team(teamId, name, firstName, lastName, phone, email); } /** * Creates a Game object with the parameter passed and returns it * param gameID * param homeTeamId * param guestTeamId * param gameDate * param homeTeamScore * param guestTeamScore * return */ public static Game setGameAttribute(String gameID, String homeTeamId, String guestTeamId, String gameDate, int homeTeamScore, int guestTeamScore) { return new Game(gameID, homeTeamId, guestTeamId, gameDate, homeTeamScore, guestTeamScore); }
  • 18. public static void main(String[] args) { //Input file final String INPUT_FILENAME = "input/hw1input.txt"; //Test 1a System.out.println("RUNNING TEST 1a"); Team team1 = new Team("1", "Team1", "Ann", "Matt", "123456", "abcxyz.com"); System.out.println(team1); //Test 1b System.out.println(); System.out.println("RUNNING TEST 1b"); Game game1 = new Game("101", "Home Team", "Guest Team", "20160303", 12, 18); System.out.println(game1); //Open input file Scanner input = null; Team team2 = null; Game game2 = null; try { input = new Scanner(new File(INPUT_FILENAME)); //Read first line String[] inputDtls = input.nextLine().split(","); //Test 2a if(inputDtls[0].equalsIgnoreCase("TEAM")) { System.out.println(); System.out.println("RUNNING TEST 2a"); team2 = setTeamAttribute(inputDtls[1], inputDtls[2], inputDtls[3], inputDtls[4], inputDtls[5], inputDtls[6]); if(!team2.isValidEmail()) System.err.println("ERROR: Invalid email address. Is missing (at sign): " + team2.getEmail());
  • 19. //Display team1 attributes System.out.println(team2.getTeamId()); System.out.println(team2.getName()); System.out.println(team2.getFirstName()); System.out.println(team2.getLastName()); System.out.println(team2.getPhone()); System.out.println(team2.getEmail()); } //Read second line inputDtls = input.nextLine().split(","); //Test 2b if(inputDtls[0].equalsIgnoreCase("GAME")) { System.out.println(); System.out.println("RUNNING TEST 2b"); game2 = setGameAttribute(inputDtls[1], inputDtls[2], inputDtls[3], inputDtls[4], Integer.parseInt(inputDtls[5]), Integer.parseInt(inputDtls[6])); if(!game2.isValidDate()) System.err.println("ERROR: Invalid game date: " + game2.getGameDate()); //Display team attributes System.out.println(game2.getGameID()); System.out.println(game2.getHomeTeamId()); System.out.println(game2.getGuestTeamId()); System.out.println(game2.getGameDate()); System.out.println(game2.getHomeTeamScore()); System.out.println(game2.getGuestTeamScore()); } } catch(FileNotFoundException fnfe) { System.err.println("Data file not found"); } finally { //Close file if(input != null) input.close();
  • 20. } //Test 3a System.out.println(); System.out.println("RUNNING TEST 3a"); System.out.println("TEAM 1 : " + team1); System.out.println("TEAM 2 : " + team2); if(team1.equals(team2)) System.out.println("The two teams are same"); else System.out.println("The two teams not are same"); //Test 3b System.out.println(); System.out.println("RUNNING TEST 3b"); System.out.println("GAME 1 : " + game1); System.out.println("GAME 2 : " + game2); if(game1.equals(game2)) System.out.println("The two games are same"); else System.out.println("The two games not are same"); } } SAMPLE OUTPUT: RUNNING TEST 1a Team {teamId=1, name=Team1, firstName=Ann, lastName=Matt, phone=123456, email=abcxyz.com} RUNNING TEST 1b Game {gameID=101, homeTeamId=Home Team, guestTeamId=Guest Team, gameDate=20160303, homeTeamScore=12, guestTeamScore=18} RUNNING TEST 2a ERROR: Invalid email address. Is missing (at sign): roadrunner#gmail.com 1 Road Runner David Brown
  • 21. 303-123-4567 roadrunner#gmail.com RUNNING TEST 2b ERROR: Invalid game date: 20150105 101 1 2 20150105 4 3 RUNNING TEST 3a TEAM 1 : Team {teamId=1, name=Team1, firstName=Ann, lastName=Matt, phone=123456, email=abcxyz.com} TEAM 2 : Team {teamId=1, name=Road Runner, firstName=David, lastName=Brown, phone=303-123-4567, email=roadrunner#gmail.com} The two teams not are same RUNNING TEST 3b GAME 1 : Game {gameID=101, homeTeamId=Home Team, guestTeamId=Guest Team, gameDate=20160303, homeTeamScore=12, guestTeamScore=18} GAME 2 : Game {gameID=101, homeTeamId=1, guestTeamId=2, gameDate=20150105, homeTeamScore=4, guestTeamScore=3} The two games not are same