https://www.homeworkmarket.com/content/write-java-program-0

ATMbankAmerica.java
ATMbankAmerica.java

package
 KW
.
CH01
;

/**

 * The class ATMbankAmerica

 */

public
 
class
 
ATMbankAmerica
 
implements
 ATM 
{

// Insert solution to programming exercise 4, section 1, chapter 1 here

    
// The following are all dummy methods

    
/**

     * Allows the user to select an account.

     * 
@return
 a String representing the account selected

     */

    @
Override

    
public
 
String
 selectAccount
()
 
{

        
return
 
null
;

    
}

    
/**

     * Withdraws a specified amount of money

     * 
@param
 account The account from which the money comes

     * 
@param
 amount The amount of money withdrawn

     * 
@return
 Whether or not the operation is successful

     */

    @
Override

    
public
 
boolean
 withdraw
(
String
 account
,
 
double
 amount
)
 
{

        
return
 
false
;

    
}

    
/**

     * Displays the result of an operation

     * 
@param
 account The account for the operation

     * 
@param
 amount The amount of money

     * 
@param
 success Whether or not the operation was successful

     */

    @
Override

    
public
 
void
 display
(
String
 account
,
 
double
 amount
,
 
boolean
 success
)
 
{

    
}

    
/**

     * Displays the result of a PIN verification

     * 
@param
 pin The user’s pin

     * 
@param
 success Whether or not the PIN was valid

     */

    @
Override

    
public
 
void
 display
(
String
 pin
,
 
boolean
 success
)
 
{

    
}

    
/**

     * Displays an account balance

     * 
@param
 account The account selected

     */

    @
Override

    
public
 
void
 showBalance
(
String
 account
)
 
{

    
}

}

Circle.java
Circle.java

// Insert solution to programming exercise 1, section 8, chapter 1 here

Computer.java
Computer.java

/**/

/**

 * Listing 1.2

 * 
@author
 Koffman & Wolfgang

 */

package
 KW
.
CH01
;

/**

 * Class that represents a computer.

 */

public
 
class
 
Computer
 
{

    
// Data Fields

    
private
 
String
 manufacturer
;

    
private
 
String
 processor
;

    
private
 
double
 ramSize
;

    
private
 
int
 diskSize
;

    
private
 
double
 processorSpeed
;

    
// Methods

    
/**

     * Initializes a Computer object with all properties specified.

     * 
@param
 man The computer manufacturer

     * 
@param
 processor The processor type

     * 
@param
 ram The RAM size

     * 
@param
 disk The disk size

     * 
@param
 procSpeed The processor speed

     */

    
public
 
Computer
(
String
 man
,
 
String
 processor
,
 
double
 ram
,

            
int
 disk
,
 
double
 procSpeed
)
 
{

        manufacturer 
=
 man
;

        
this
.
processor 
=
 processor
;

        ramSize 
=
 ram
;

        diskSize 
=
 disk
;

        processorSpeed 
=
 procSpeed
;

    
}

// Insert solution to programming exercise 1, section 3, chapter 1 here

    
public
 
double
 computePower
()
 
{

        
return
 ramSize 
*
 processorSpeed
;

    
}

    
public
 
double
 getRamSize
()
 
{

        
return
 ramSize
;

    
}

    
public
 
double
 getProcessorSpeed
()
 
{

        
return
 processorSpeed
;

    
}

    
public
 
int
 getDiskSize
()
 
{

        
return
 diskSize
;

    
}

    
// Insert other accessor and modifier methods here.

// Insert solution to programming exercise 1, section 2, chapter 1 here

// Insert solution to programming exercise 2, section 3, chapter 1 here

// Inset solution to self-check exercise 2, section 3, chapter 1 here

    
public
 
String
 toString
()
 
{

        
String
 result 
=
 
“Manufacturer: ”
 
+
 manufacturer 
+
 
“nCPU: ”

                
+
 processor 
+
 
“nRAM: ”
 
+
 ramSize 
+
 
” gigabytes”

                
+
 
“nDisk: ”
 
+
 diskSize 
+
 
” gigabytes”

                
+
 
“nProcessor speed: ”
 
+
 processorSpeed 
+
 
” gigahertz”
;

        
return
 result
;

    
}

    
/**/

    
/**

     * Compares power of this computer and it argument

     * computer

     *

     * 
@param
 aComputer The computer being compared to this computer

     *

     * 
@return
 -1 if this computer has less power, 0 if the same, and

     *         +1 if this computer has more power.

     */

    
public
 
int
 comparePower
(
Computer
 aComputer
)
 
{

        
if
 
(
this
.
computePower
()
 
<  aComputer . computePower ())   {              return   - 1 ;          }   else   if   ( this . computePower ()   ==  aComputer . computePower ())   {              return   0 ;          }   else   {              return   1 ;          }      }      /**/

// Insert solution to programming exercise 1, section 5, chapter 1 here

}

/**/

Notebook.java
Notebook.java

/**/

/**

 * Listing 1.3

 * 
@author
 Koffman and Wolfgang

 */

package
 KW
.
CH01
;

/**

 * Class that represents a notebook computer.

 */

public
 
class
 
Notebook
 
extends
 
Computer
 
{

    
// Data Fields

    
private
 
double
 screenSize
;

    
private
 
double
 weight
;

    
// Methods

    
/**

     * Initializes a Notebook object with all properties specified.

     * 
@param
 man The computer manufacturer

     * 
@param
 proc The processor type

     * 
@param
 ram The RAM size

     * 
@param
 disk The disk size

     * 
@param
 procSpeed The processor speed

     * 
@param
 screen The screen size

     * 
@param
 wei The weight

     */

    
public
 
Notebook
(
String
 man
,
 
String
 proc
,
 
double
 ram
,
 
int
 disk
,

            
double
 procSpeed
,
 
double
 screen
,
 
double
 wei
)
 
{

        
super
(
man
,
 proc
,
 ram
,
 disk
,
 procSpeed
);

        screenSize 
=
 screen
;

        weight 
=
 wei
;

    
}

// Insert solution to programming exercise 1, section 3, chapter 1 here

// Insert solution to programming exercise 2, section 2, chapter 1 here

// Insert solution to programming exercise 3, section 3, chapter 1 here

// Insert solution to programming exercise 2, section 5, chapter 1 here

}

/**/

Notebook2.java
Notebook2.java

/**/

/**

 * Listing 1.4

 * 
@author
 Koffman and Wolfgang

 */

package
 KW
.
CH01
;

/**

 * Class that represents a notebook computer.

 */

public
 
class
 
Notebook2
 
extends
 
Computer
 
{

    
// Data Fields

    
private
 
static
 
final
 
String
 DEFAULT_NB_MAN 
=
 
“MyBrand”
;

    
private
 
double
 screenSize
;

    
private
 
double
 weight
;

    
// Methods

    
/**

     * Initializes a Notebook object with all properties specified.

     * 
@param
 man The computer manufacturer

     * 
@param
 proc The processor type

     * 
@param
 ram The RAM size

     * 
@param
 disk The disk size

     * 
@param
 procSpeed The processor speed

     * 
@param
 screen The screen size

     * 
@param
 wei The weight

     */

    
public
 
Notebook2
(
String
 man
,
 
String
 proc
,
 
double
 ram
,
 
int
 disk
,

            
double
 procSpeed
,
 
double
 screen
,
 
double
 wei
)
 
{

        
super
(
man
,
 proc
,
 ram
,
 disk
,
 procSpeed
);

        screenSize 
=
 screen
;

        weight 
=
 wei
;

    
}

    
/** Initializes a Notebook object with 6 properties specified. */

    
public
 
Notebook2
(
String
 proc
,
 
int
 ram
,
 
int
 disk
,

            
double
 procSpeed
,
 
double
 screen
,
 
double
 wei
)
 
{

        
this
(
DEFAULT_NB_MAN
,
 proc
,
 ram
,
 disk
,
 procSpeed
,
 screen
,
 wei
);

    
}

    @
Override

    
public
 
String
 toString
()
 
{

        
String
 result 
=
 
super
.
toString
()
 
+
 
“nScreen size: ”

                
+
 screenSize 
+
 
” inches”
 
+
 
“nWeight: ”
 
+
 weight

                
+
 
” pounds”
;

        
return
 result
;

    
}

// Insert solution to programming exercise 2, section 2, chapter 1 here

}

/**/

Person.java
Person.java

package
 KW
.
CH01
;

/**

 * Person is a class that represents a human being.

 *

 * 
@author
 Koffman and Wolfgang

 */

public
 
class
 
Person
 
{

    
// Constants

    
/**

     * The age at which a person can vote

     */

    
private
 
static
 
final
 
int
 VOTE_AGE 
=
 
18
;

    
/**

     * The age at which a person is considered a senior citizen

     */

    
private
 
static
 
final
 
int
 SENIOR_AGE 
=
 
65
;

    
// Data Fields

    
/**

     * The given name

     */

    
private
 
String
 givenName
;

    
/**

     * The family name

     */

    
private
 
String
 familyName
;

    
/**

     * The ID number

     */

    
private
 
final
 
String
 
IDNumber
;

    
/**

     * The birth year

     */

    
private
 
int
 birthYear 
=
 
1900
;

    
// Constructors

    
/**

     * Construct a person with given values

     *

     * 
@param
 given The given name

     * 
@param
 family The family name

     * 
@param
 ID The ID number

     * 
@param
 birth The birth year

     */

    
public
 
Person
(
String
 given
,
 
String
 family
,
 
String
 ID
,
 
int
 birth
)
 
{

        givenName 
=
 given
;

        familyName 
=
 family
;

        
IDNumber
 
=
 ID
;

        birthYear 
=
 birth
;

    
}

    
/**

     * Construct a person with only an IDNumber specified.

     *

     * 
@param
 ID The ID number

     */

    
public
 
Person
(
String
 ID
)
 
{

        
IDNumber
 
=
 ID
;

    
}

    
// Modifier Methods

    
/**

     * Sets the givenName field.

     *

     * 
@param
 given The given name

     */

    
public
 
void
 setFirstName
(
String
 given
)
 
{

        givenName 
=
 given
;

    
}

    
/**

     * Sets the familyName field.

     *

     * 
@param
 family The family name

     */

    
public
 
void
 setLastName
(
String
 family
)
 
{

        familyName 
=
 family
;

    
}

    
/**

     * Sets the birthYear field.

     *

     * 
@param
 birthYear The year of birth

     */

    
public
 
void
 setBirthYear
(
int
 birthYear
)
 
{

        
this
.
birthYear 
=
 birthYear
;

    
}

    
// Accessor Methods

    
/**

     * Gets the person’s given name.

     *

     * 
@return
 the given name as a String

     */

    
public
 
String
 getGivenName
()
 
{

        
return
 givenName
;

    
}

    
/**

     * Gets the person’s family name.

     *

     * 
@return
 the family name as a String

     */

    
public
 
String
 getFamilyName
()
 
{

        
return
 familyName
;

    
}

    
/**

     * Gets the person’s ID number.

     *

     * 
@return
 the ID number as a String

     */

    
public
 
String
 getIDNumber
()
 
{

        
return
 
IDNumber
;

    
}

    
/**

     * Gets the person’s year of birth.

     *

     * 
@return
 the year of birth as an int value

     */

    
public
 
int
 getBirthYear
()
 
{

        
return
 birthYear
;

    
}

    
// Other Methods

    
/**

     * Calculates a person’s age at this year’s birthday.

     *

     * 
@param
 year The current year

     *

     * 
@return
 the year minus the birth year

     */

    
public
 
int
 age
(
int
 year
)
 
{

        
return
 year 

 birthYear
;

    
}

    
/**

     * Determines whether a person can vote.

     *

     * 
@param
 year The current year

     *

     * 
@return
 true if the person’s age is greater than or equal to the voting

     * age

     */

    
public
 
boolean
 canVote
(
int
 year
)
 
{

        
int
 theAge 
=
 age
(
year
);

        
return
 theAge 
>=
 VOTE_AGE
;

    
}

    
/**

     * Determines whether a person is a senior citizen.

     *

     * 
@param
 year the current year

     *

     * 
@return
 true if person’s age is greater than or equal to the age at which

     * a person is considered to be a senior citizen

     */

    
public
 
boolean
 isSenior
(
int
 year
)
 
{

        
return
 age
(
year
)
 
>=
 SENIOR_AGE
;

    
}

    
/**

     * Retrieves the information in a Person object.

     *

     * 
@return
 the object state as a string

     */

    @
Override

    
public
 
String
 toString
()
 
{

        
return
 
“First name: ”
 
+
 givenName 
+
 
“n”
 
+
 
“Last name: ”

                
+
 familyName 
+
 
“n”
 
+
 
“ID number: ”
 
+
 
IDNumber
 
+
 
“n”

                
+
 
“Year of birth: ”
 
+
 birthYear 
+
 
“n”
;

    
}

    
/**

     * Compares two Person objects for equality.

     *

     * 
@param
 per The second Person object

     *

     * 
@return
 true if the Person objects have same ID number; false if they

     * don’t

     */

    
public
 
boolean
 equals
(
Person
 per
)
 
{

        
if
 
(
per 
==
 
null
)
 
{

            
return
 
false
;

        
}
 
else
 
{

            
return
 
IDNumber
.
equals
(
per
.
IDNumber
);

        
}

    
}

// Insert solution to programming exercise 2, section 1, chapter 1 here

    
public
 
int
 compareTo
(
Person
 per
)
 
{

        
if
 
(
familyName
.
compareTo
(
per
.
familyName
)
 
==
 
0
)
 
{

            
return
 givenName
.
compareTo
(
per
.
givenName
);

        
}
 
else
 
{

            
return
 familyName
.
compareTo
(
per
.
familyName
);

        
}

    
}

// Insert solution to programming exercise 3, section 1, chapter 1 here

    
public
 
void
 changeFamilyName
(
boolean
 justMarried
,
 
String
 newFamily
)
 
{

        
if
 
(
justMarried
)
 
{

            familyName 
=
 newFamily
;

        
}

    
}

}

Question1_3_3.java
Question1_3_3.java

// Inset solution to self-check exercise 3, section 3, chapter 1 here

Resizable.java
Resizable.java

// Insert solution to programming exercise 1, section 1, chapter 1 here

RtTriangle.java
RtTriangle.java

Order a unique copy of this paper
(550 words)

Approximate price: $22

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

We value our customers and so we ensure that what we do is 100% original..
With us you are guaranteed of quality work done by our qualified experts.Your information and everything that you do with us is kept completely confidential.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

The Product ordered is guaranteed to be original. Orders are checked by the most advanced anti-plagiarism software in the market to assure that the Product is 100% original. The Company has a zero tolerance policy for plagiarism.

Read more

Free-revision policy

The Free Revision policy is a courtesy service that the Company provides to help ensure Customer’s total satisfaction with the completed Order. To receive free revision the Company requires that the Customer provide the request within fourteen (14) days from the first completion date and within a period of thirty (30) days for dissertations.

Read more

Privacy policy

The Company is committed to protect the privacy of the Customer and it will never resell or share any of Customer’s personal information, including credit card data, with any third party. All the online transactions are processed through the secure and reliable online payment systems.

Read more

Fair-cooperation guarantee

By placing an order with us, you agree to the service we provide. We will endear to do all that it takes to deliver a comprehensive paper as per your requirements. We also count on your cooperation to ensure that we deliver on this mandate.

Read more

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency

Order your paper today and save 15% with the discount code HAPPY

X
error: Content is protected !!
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 323 412 5597

Feel free to ask questions, clarifications, or discounts available when placing an order.