Driver
.docx
keyboard_arrow_up
School
Southern New Hampshire University *
*We aren’t endorsed by this school
Course
145
Subject
Computer Science
Date
Dec 6, 2023
Type
docx
Pages
8
Uploaded by AmbassadorDove3627
Stanley Artis
IT-145
Professor Daff Kalulu
26 November 2023
Package Grazioso
import
java
.
util
.
ArrayList
;
import
java
.
util
.
Scanner
;
public class
Driver
{
private static
ArrayList
<
Dog
>
dogList
=
new
ArrayList
<
Dog
>();
// Instance variables (if needed)
private static
ArrayList
<
Monkey
>
monkeyList
=
new
ArrayList
<>();
public static
void
main
(
String
[]
args
) {
initializeDogList
();
initializeMonkeyList
();
// Add a loop that displays the menu, accepts the users input
// and takes the appropriate action.
// For the project submission you must also include input validation
// and appropriate feedback to the user.
// Hint: create a Scanner and pass it to the necessary
// methods
// Hint: Menu options 4, 5, and 6 should all connect to the
printAnimals() method.
char
input
=
0
;
int
input1
=
Character
.
getNumericValue
(
input
);
boolean
isValidSelection
=
true
;
displayMenu
();
//Starts Menu//
do
{
isValidSelection
=
true
;
try
{
input
=
scnr
.
nextLine
().
charAt
(
0
);
if
(
input
==
'q'
) {
//Quits Menu
System
.
out
.
print
(
"Good Bye!"
);
System
.
exit
(
0
);
}
else
{
input1
=
Character
.
getNumericValue
(
input
);
}
if
(
input1
<
1
||
input1
>
6
)
throw new
Exception
(
"Invalid Entry. Please try again"
);
}
catch
(
Exception
excpt
) {
System
.
out
.
println
(
excpt
.
getMessage
());
isValidSelection
=
false
;
}
}
while
(
!
isValidSelection
);
switch
(
input1
) {
case
1
->
intakeNewDog
(scnr);
case
2
->
intakeNewMonkey
(scnr);
case
3
->
reserveAnimal
(scnr);
case
4
->
printDogs
();
case
5
->
printMonkey
();
case
6
->
printAnimals
();
}
}
// This method prints the menu options
public static
void
displayMenu
() {
System
.
out
.
println
(
"
\n\n
"
);
System
.
out
.
println
(
"
\t\t\t\t
Rescue Animal System Menu"
);
System
.
out
.
println
(
"[1] Intake a new dog"
);
System
.
out
.
println
(
"[2] Intake a new monkey"
);
System
.
out
.
println
(
"[3] Reserve an animal"
);
System
.
out
.
println
(
"[4] Print a list of all dogs"
);
System
.
out
.
println
(
"[5] Print a list of all monkeys"
);
System
.
out
.
println
(
"[6] Print a list of all animals that are not
reserved"
);
System
.
out
.
println
(
"[q] Quit application"
);
System
.
out
.
println
();
System
.
out
.
println
(
"Enter a menu selection"
);
}
// Adds dogs to a list for testing
public static
void
initializeDogList
() {
Dog
dog1
=
new
Dog
(
"Spot"
,
"German Shepherd"
,
"male"
,
"1"
,
"25.6"
,
"05-12-2019"
,
"United States"
,
"intake"
,
false
,
"United States"
);
Dog
dog2
=
new
Dog
(
"Rex"
,
"Great Dane"
,
"male"
,
"3"
,
"35.2"
,
"02-
03-2020"
,
"United States"
,
"Phase I"
,
false
,
"United States"
);
Dog
dog3
=
new
Dog
(
"Bella"
,
"Chihuahua"
,
"female"
,
"4"
,
"25.6"
,
"12-12-2019"
,
"Canada"
,
"in service"
,
true
,
"Canada"
);
dogList
.
add
(
dog1
);
dogList
.
add
(
dog2
);
dogList
.
add
(
dog3
);
}
// Adds monkeys to a list for testing
//Optional for testing
public static
void
initializeMonkeyList
() {
Monkey
monkey1
=
new
Monkey
(
"Johnny"
,
"Macaque"
,
"5.9"
,
"8.9"
,
"20.6"
,
"male"
,
"1"
,
"16.3"
,
"08-10-2019"
,
"Canada"
,
"Phase I"
,
true
,
"Canada"
);
Monkey
monkey2
=
new
Monkey
(
"Breck"
,
"Capuchin"
,
"5.1"
,
"11.2"
,
"21.7"
,
"female"
,
"1"
,
"17.1"
,
"06-04-2020"
,
"Mexico"
,
"in service"
,
false
,
"Mexico"
);
Monkey
monkey3
=
new
Monkey
(
"Earl"
,
"Tamarin"
,
"5.7"
,
"7.7"
,
"19.3"
,
"male"
,
"3"
,
"17.2"
,
"12-05-2021"
,
"United States"
,
"intake"
,
false
,
"United States"
);
monkeyList
.
add
(
monkey1
);
monkeyList
.
add
(
monkey2
);
monkeyList
.
add
(
monkey3
);
}
// Complete the intakeNewDog method
// The input validation to check that the dog is not already in the
list
// is done for you
public static
void
intakeNewDog
(
Scanner
scanner
) {
System
.
out
.
println
(
"What is the dog's name?"
);
String
name
=
scanner
.
nextLine
();
for
(
Dog
dog
:
dogList
) {
if
(
dog
.
getName
().
equalsIgnoreCase
(
name
)) {
System
.
out
.
println
(
"
\n\n
This dog is already in our
system
\n\n
"
);
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
JAVA Language
Caesar Shift
Question:
Modify the Caesar class so that it will allow various sized shifts to be used, instead of just a shift of size 3. (Hint: Use an instance variable in the Caesar class to represent the shift, add a constructor to set it, and change the encode method to use it.)
import java.util.*;
public class TestCipher { public static void main(String[] args) { int shift = 7; Caesar caesar = new Caesar(); String text = "hello world"; String encryptTxt = caesar.encrypt(text); System.out.println(text + " encrypted with shift " + shift + " is " + encryptTxt); } }
abstract class Cipher { public String encrypt(String s) { StringBuffer result = new StringBuffer(""); // Use a StringBuffer StringTokenizer words = new StringTokenizer(s); // Break s into its words while (words.hasMoreTokens()) { // For each word in s…
arrow_forward
For the following four classes, choose the correct relationship between each pair.
public class Room (
private String m type;
private double m area;
// "Bedroom", "Dining room", etc.
// in square feet
public Room (String type, double area)
m type
type;
m area
= area;
public class Person {
private String m name;
private int m age;
public Person (String name, int age)
m name
= name;
m age = age;
public class LivingSSpace (
private String m address;
private Room[] m rooms;
private Person[] m occupants;
private int m countRooms;
private int m countoccupants;
public LivingSpace (String address, int numRooms, int
numoccupants)
m address =
address;
new int [numRooms];
= new int [numOceupants];
m rooms
%3D
D occupants
m countRooms = m countOccupants = 0;
public void addRoom (String type, double area)
arrow_forward
class implementation file --
Rectangle.cpp
class Rectangle
{
#include
#include "Rectangle.h"
using namespace std;
private:
double width;
double length;
public:
void setWidth (double);
void setLength (double) ;
double getWidth() const;
double getLength() const;
double getArea () const;
} ;
// set the width of the rectangle
void Rectangle::setWidth (double w)
{
width = w;
}
// set the length of the rectangle
void Rectangle::setLength (double l)
{
length
l;
//get the width of the rectangle
double Rectangle::getWidth() const
{
return width;
//
more member functions here
arrow_forward
X2, Y2------1.
arrow_forward
Software Requirements:
• Latest version of NetBeans IDE
• Java Development Kit (JDK) 8
Procedure:
1. our progras from
rhFactor non-static and private. Remove the constructor with two (2) parameters.
2o upply uncapsutation Make bloodType and
2. The names of the public setter and getter methods should be:
• setBloodType()
• setRhFactor()
getBlood Type()
getRhFactor()
3. Use the setter methods to accept user input.
4. Display the values by calling the getter methods.
Sample Output:
Enter blood type of patient:
Enter the Rhesus factor (+ or -):
O+ is added to the blood bank.
Enter blood type of patient: B
Enter the Rhesus factor (+ or -):
B- is added to the blood bank.
arrow_forward
Data structure & Algrothium java program
Create the following classes:
1. Name.java object class containing two strings attributes first name and last name (and appropriate constructors, setters/getters)2. NicePerson.java object class containing the name object and an ArrayList of string to store the list gifts ( and appropriate constructors, setters/getters). This class would extend the attached NicePersonInterface.java3. Santa.java object class containing one ArrayList of Names to store the naughty names. Another ArrayList of NicePerson to store the nice names and gifts. Add atleast 4 names in each list and display all information.
arrow_forward
Data Structures
arrow_forward
interface StudentsADT{void admissions();void discharge();void transfers(); }public class Course{String cname;int cno;int credits;public Course(){System.out.println("\nDEFAULT constructor called");}public Course(String c){System.out.println("\noverloaded constructor called");cname=c;}public Course(Course ch){System.out.println("\nCopy constructor called");cname=ch;}void setCourseName(String ch){cname=ch;System.out.println("\n"+cname);}void setSelectionNumber(int cno1){cno=cno1;System.out.println("\n"+cno);}void setNumberOfCredits(int cdit){credits=cdit;System.out.println("\n"+credits);}void setLink(){System.out.println("\nset link");}String getCourseName(){System.out.println("\n"+cname);}int getSelectionNumber(){System.out.println("\n"+cno);}int getNumberOfCredits(){System.out.println("\n"+credits); }void getLink(){System.out.println("\ninside get link");}}
public class Students{String sname;int cno;int credits;int maxno;public Students(){System.out.println("\nDEFAULT constructor…
arrow_forward
public class MyGenClass {
private T1 name;
private T2 stulD;
private T3 CGPA;
public void setStuData(
){ I/ parameters
name = n;
stulD = d:
CGPA = g;
}
public void printAsString() {
System.out.println(
}
); I/ print all information as string
public static void main(String args||) {
Il Create an object stu by parameters String, Integer, Double
Il Call setStuData() with any values you like
/l Call printAsString()
}
}
arrow_forward
Java prgm based
arrow_forward
Course Title: Modern Programming Language
Please Java Language Code
Question :
Design an abstract class GeometricObject. GeometricObject must ensure that its children must implement calcArea() method.
Design Rectangle18-ARID-2891 and CircleM.JibranAkram Classes as children of GeometricObject class with overridden toString() method to return “Rectangle with w Width and h Height is drawn” OR “Circle with r Radius is drawn”. The attributes of Rectangle are length, width. The attribute of Circle is radius
Hint: Area of circle=πr2 , Area of rectangle= width*length
arrow_forward
Computer Science
hand.javapackage poker;
import com.google.gson.Gson;import com.google.gson.GsonBuilder;import poker.Card;
public class Hand{//private transient int i=10;// marked transient they will not serialized / deserialized
public Card[] cards;
public Hand(){}
public boolean is_better_than(Hand H){return false;} public boolean is_equal(Hand H){return false;}}
card.javapackage poker;
public class Card{public enum Suite{HEARTS,CLUBS,DIAMONDS,SPADES}
public enum Value{ACE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN,JACK,QUEEN,KING}
public Suite suite;public Value value;
public Card(){
}}
// main.java
import com.google.gson.Gson;import com.google.gson.GsonBuilder;import poker.Hand;import poker.Card;
public class Main{
public static void main(String[] args){// this function is provided as a convenient way to// run the code from the command line.//// it will not be graded, but it needs to compile and// execute without a failure.
System.out.println("Start");
// Demonstrate…
arrow_forward
Assume Student and GradeBook classes are defined as follows:
public class Student {
int id;
double testsMarks[];
public double getAverage(){
double sum = 0;
for(double marks : testsMarks) {
sum+=marks;
}
return sum/testsMarks.length;
}
}
import java.util.ArrayList;
public class GradeBook {
String subject;
ArrayList<Student> students;
public Student getStudentWithMinAverage(){ }
}
Define the body of getStudentWithMinAverage method that shall return the student object from students ArrayList who got minimum average marks in the class. (Please write minimum code and make use of provided code, making no change in classes' structure)
arrow_forward
Java prgm based
arrow_forward
Course Title: Modern Programming Language
Please Java Language Code and Correct Code Please
Question :
Design an abstract class GeometricObject. GeometricObject must ensure that its children must implement calcArea() method.
Design Rectangle18ARID2891 and CircleMJibranAkram Classes as children of GeometricObject class with overridden toString() method to return “Rectangle18ARID2891 with w Width and h Height is drawn” OR “CircleMJibranAkram with r Radius is drawn”. The attributes of Rectangle18ARID2891 are length, width. The attribute of CircleMJibranAkram is radius
Hint: Area of circle=πr2 , Area of rectangle= width*length
arrow_forward
Main Class
Implement a main class that implements our ParkingOffice.java class.
Parkingoffice.java
public class ParkingOffice {String name;String address;String phone;String parkingOfficeName;List<Customer> customers;List<Car> cars;List<ParkingLot> lots;List<ParkingCharge> charges;
public ParkingOffice(){customers = new ArrayList<>();cars = new ArrayList<>();lots = new ArrayList<>();charges = new ArrayList<>();}
public String getParkingOfficeName(){return this.parkingOfficeName;}
/* to implement the desired park function */
public String park(Date date,String ParkingPermit,ParkingLot pl){
/* to have the amount paid during the transaction forthe specified parking lot */double amount=pl.amount;/* to have the date on which the parking lot is booked */String onDate=date.toString();/* to know the permit id */String permitId=ParkingPermit;/* to print the transaction receipt */String s="Amount paid on date: ";s=s+onDate;s=s+" is…
arrow_forward
java programming
arrow_forward
public class Cat extends Pet { private String breed;
public void setBreed(String userBreed) { breed = userBreed; }
public String getBreed() { return breed; }}
public class Pet {
protected String name; protected int age;
public void setName(String userName) { name = userName; }
public String getName() { return name; }
public void setAge(int userAge) { age = userAge; }
public int getAge() { return age; }
public void printInfo() { System.out.println("Pet Information: "); System.out.println(" Name: " + name); System.out.println(" Age: " + age); }
}
import java.util.Scanner;
public class PetInformation { public static void main(String[] args) { Scanner scnr = new Scanner(System.in);
// create a generic Pet and a Cat Pet myPet = new Pet(); Cat myCat = new Cat();
// declare variables for pet and cat info String petName, catName, catBreed; int petAge,…
arrow_forward
public class LabProgram {
public static void main(String args[]) {
Course course = new Course();
String first; // first name
String last; // last name
double gpa; // grade point average
first = "Henry";
last = "Cabot";
gpa = 3.5;
course.addStudent(new Student(first, last, gpa)); // Add 1st student
first = "Brenda";
last = "Stern";
gpa = 2.0;
course.addStudent(new Student(first, last, gpa)); // Add 2nd student
first = "Jane";
last = "Flynn";
gpa = 3.9;
course.addStudent(new Student(first, last, gpa)); // Add 3rd student
first = "Lynda";
last = "Robison";
gpa = 3.2;
course.addStudent(new Student(first, last, gpa)); // Add 4th student
course.printRoster();
}
}
// Class representing a student
public class Student {
private String first; // first name
private String last; // last name
private double gpa; // grade point average…
arrow_forward
class displayClass{public:void print();...private:int listLength;int *list;double salary;string name;}
Write the definition of the copy constructor for the class displayClass.
arrow_forward
Fill in the blanks
arrow_forward
toString() and equals() Methods
This lab will demonstrate how the toString() and equals() methods work when they are
not overridden. Type up the code and submit the BOTH results.
CODE
public class ObjectToString(
public static void main(String[] args) {
ClassOne co new ClassOne();
ClassTwo ct = new ClassTwo();
}
}
public class Classone {
System.out.println(co);
System.out.println(ct);
System.out.println(co.equals(ct));
public void printfle() {
System.out.println("I am from ClassOne");
}
public class ClassTwo (
public void printMe() {
}
System.out.println("I am from ClassTwo");
Run the program and notice the output.
arrow_forward
Intermediate Java
The Class class has six methods that yield a string representation of the type represented by the Class object. How do they differ when applied to arrays, generic types, inner classes, and primitive types?
arrow_forward
class displayClass{public:void print();...private:int listLength;int *list;double salary;string name;}
Write the definition of the function to overload the assignment operator for the class displayClass.
arrow_forward
26. Assume the declaration of Exercise 24.
A. Write the statements that derive
the class dummyClass from class base as a private inheritance. (2
lines are { and }.)
"A1 is {
"A2 is
"A3 is ))
B. Determine which members of class base are private, protected,
and public in class dummyClass.
"B1 is dummyClass is a de
arrow_forward
Code:
import java.util.*;
//Bicycle interface
interface Bicycle
{
abstract void changeCadence(int newValue); //will change value of candence to new value
abstract void changeGear (int newValue); //changes gear of car
abstract void speedUp(int increment); //increments speed of car by adding new Value to existing speed
abstract void applyBrakes(int decrement);
}
//ACMEBicycle class definition
class ACMEBicycle implements Bicycle
{
int cadence = 0; Â Â
int speed = 0; Â Â
int gear = 1;
//methods of interface
public void changeCadence(int newValue)
{
this.cadence=newValue;
}
public void changeGear (int newValue)
{
this.gear=newValue;
}
public void speedUp(int increment)
{
this.speed+=increment;
}
public void applyBrakes(int decrement)
{
this.speed-=decrement;
}
//display method
void display()
{
System.out.println("Cadence: "+this.cadence);
System.out.println("Gear: "+this.gear);
System.out.println("Speed: "+this.speed);
}
}
//KEYOBicycle class definition
class KEYOBicycle implements…
arrow_forward
Draw a UML class diagram for the following code:
public class ArrayQueue<T> {
private Object[] array;
private int front;
private int rear;
private int size;
public ArrayQueue(int capacity) {
array = new Object[capacity];
front = 0;
rear = -1;
size = 0;
}
public boolean isEmpty() {
return size == 0;
}
public void enqueue(T item) {
if (size == array.length) {
throw new IllegalStateException("Queue is full");
}
rear = (rear + 1) % array.length;
array[rear] = item;
size++;
}
public T dequeue() {
if (isEmpty()) {
throw new IllegalStateException("Queue is empty");
}
T item = (T) array[front];
array[front] = null;
front = (front + 1) % array.length;
size--;
return item;
}
public void dequeueAll() {
while (!isEmpty()) {
dequeue();
}
}…
arrow_forward
Computer Science
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- JAVA Language Caesar Shift Question: Modify the Caesar class so that it will allow various sized shifts to be used, instead of just a shift of size 3. (Hint: Use an instance variable in the Caesar class to represent the shift, add a constructor to set it, and change the encode method to use it.) import java.util.*; public class TestCipher { public static void main(String[] args) { int shift = 7; Caesar caesar = new Caesar(); String text = "hello world"; String encryptTxt = caesar.encrypt(text); System.out.println(text + " encrypted with shift " + shift + " is " + encryptTxt); } } abstract class Cipher { public String encrypt(String s) { StringBuffer result = new StringBuffer(""); // Use a StringBuffer StringTokenizer words = new StringTokenizer(s); // Break s into its words while (words.hasMoreTokens()) { // For each word in s…arrow_forwardFor the following four classes, choose the correct relationship between each pair. public class Room ( private String m type; private double m area; // "Bedroom", "Dining room", etc. // in square feet public Room (String type, double area) m type type; m area = area; public class Person { private String m name; private int m age; public Person (String name, int age) m name = name; m age = age; public class LivingSSpace ( private String m address; private Room[] m rooms; private Person[] m occupants; private int m countRooms; private int m countoccupants; public LivingSpace (String address, int numRooms, int numoccupants) m address = address; new int [numRooms]; = new int [numOceupants]; m rooms %3D D occupants m countRooms = m countOccupants = 0; public void addRoom (String type, double area)arrow_forwardclass implementation file -- Rectangle.cpp class Rectangle { #include #include "Rectangle.h" using namespace std; private: double width; double length; public: void setWidth (double); void setLength (double) ; double getWidth() const; double getLength() const; double getArea () const; } ; // set the width of the rectangle void Rectangle::setWidth (double w) { width = w; } // set the length of the rectangle void Rectangle::setLength (double l) { length l; //get the width of the rectangle double Rectangle::getWidth() const { return width; // more member functions herearrow_forward
- X2, Y2------1.arrow_forwardSoftware Requirements: • Latest version of NetBeans IDE • Java Development Kit (JDK) 8 Procedure: 1. our progras from rhFactor non-static and private. Remove the constructor with two (2) parameters. 2o upply uncapsutation Make bloodType and 2. The names of the public setter and getter methods should be: • setBloodType() • setRhFactor() getBlood Type() getRhFactor() 3. Use the setter methods to accept user input. 4. Display the values by calling the getter methods. Sample Output: Enter blood type of patient: Enter the Rhesus factor (+ or -): O+ is added to the blood bank. Enter blood type of patient: B Enter the Rhesus factor (+ or -): B- is added to the blood bank.arrow_forwardData structure & Algrothium java program Create the following classes: 1. Name.java object class containing two strings attributes first name and last name (and appropriate constructors, setters/getters)2. NicePerson.java object class containing the name object and an ArrayList of string to store the list gifts ( and appropriate constructors, setters/getters). This class would extend the attached NicePersonInterface.java3. Santa.java object class containing one ArrayList of Names to store the naughty names. Another ArrayList of NicePerson to store the nice names and gifts. Add atleast 4 names in each list and display all information.arrow_forward
- Data Structuresarrow_forwardinterface StudentsADT{void admissions();void discharge();void transfers(); }public class Course{String cname;int cno;int credits;public Course(){System.out.println("\nDEFAULT constructor called");}public Course(String c){System.out.println("\noverloaded constructor called");cname=c;}public Course(Course ch){System.out.println("\nCopy constructor called");cname=ch;}void setCourseName(String ch){cname=ch;System.out.println("\n"+cname);}void setSelectionNumber(int cno1){cno=cno1;System.out.println("\n"+cno);}void setNumberOfCredits(int cdit){credits=cdit;System.out.println("\n"+credits);}void setLink(){System.out.println("\nset link");}String getCourseName(){System.out.println("\n"+cname);}int getSelectionNumber(){System.out.println("\n"+cno);}int getNumberOfCredits(){System.out.println("\n"+credits); }void getLink(){System.out.println("\ninside get link");}} public class Students{String sname;int cno;int credits;int maxno;public Students(){System.out.println("\nDEFAULT constructor…arrow_forwardpublic class MyGenClass { private T1 name; private T2 stulD; private T3 CGPA; public void setStuData( ){ I/ parameters name = n; stulD = d: CGPA = g; } public void printAsString() { System.out.println( } ); I/ print all information as string public static void main(String args||) { Il Create an object stu by parameters String, Integer, Double Il Call setStuData() with any values you like /l Call printAsString() } }arrow_forward
- Java prgm basedarrow_forwardCourse Title: Modern Programming Language Please Java Language Code Question : Design an abstract class GeometricObject. GeometricObject must ensure that its children must implement calcArea() method. Design Rectangle18-ARID-2891 and CircleM.JibranAkram Classes as children of GeometricObject class with overridden toString() method to return “Rectangle with w Width and h Height is drawn” OR “Circle with r Radius is drawn”. The attributes of Rectangle are length, width. The attribute of Circle is radius Hint: Area of circle=πr2 , Area of rectangle= width*lengtharrow_forwardComputer Science hand.javapackage poker; import com.google.gson.Gson;import com.google.gson.GsonBuilder;import poker.Card; public class Hand{//private transient int i=10;// marked transient they will not serialized / deserialized public Card[] cards; public Hand(){} public boolean is_better_than(Hand H){return false;} public boolean is_equal(Hand H){return false;}} card.javapackage poker; public class Card{public enum Suite{HEARTS,CLUBS,DIAMONDS,SPADES} public enum Value{ACE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN,JACK,QUEEN,KING} public Suite suite;public Value value; public Card(){ }} // main.java import com.google.gson.Gson;import com.google.gson.GsonBuilder;import poker.Hand;import poker.Card; public class Main{ public static void main(String[] args){// this function is provided as a convenient way to// run the code from the command line.//// it will not be graded, but it needs to compile and// execute without a failure. System.out.println("Start"); // Demonstrate…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education