SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
HW#3 – Spring 2018
1. Giulia is traveling from Italy to China. The plane briefly
lands in Thailand to refuel and pick up new passengers. In the
process of landing in Thailand, the overhead storage bin across
the aisle flies open and a carry-on bag whacks Giulia in the
head causing a concussion. Does the Montreal Convention
govern this incident? Explain in detail why or why not. (4)
2. Following up on #1, Giulia’s husband, Kevin, is on board and
is deeply disturbed by the incident to the point that he files a
claim for mental anguish. What are his chances of success?
Explain. (3)
3. How many U.S. dollars would someone get if they sustained
100 kilograms worth of cargo losses under the Montreal
convention on February 1st, 2018? (3)
4. Lucas is flying from Houston, TX to Ixtapa, Mexico for a
fishing vacation when a 3 hour delay in Houston forces him to
miss his connecting flight, resulting in a loss of $500 in pre-
paid expenses. If the delay was due to weather would the airline
be liable under the Montreal Convention? What about a
mechanical issue? Explain the likelihood of his success in
recovery in each case. (4)
4. Answer #4 page 179.
(4)Fishman shipper a container of boys’ pants on a ship owner
by Tropical. The container was lost at sea due to improper
storage. The pants were attacked into bundles of 12 each and
placed into what is known in the industry as a “big pack.” A
“big pack” is similar to a 4’x4’ pallet, partially enclosed in
corrugated cardboard, with a base and cover made of plastic.
The bill of lading stated, “1 x 40 ft. [container] STC [said to
contain] 39 Big Pack Containing 27,908 unit’s boy’s pants.”
Fishman maintains that Tropical is liable for an amount up to
$500 for each of the 2,325 bundles. If the carrier is liable for up
to $500 per “package,” what is the limit of the carrier’s
liability? Fishman & Tobin, Inc. v. Tropical Shipping & Const.
Co., Ltd., 240 F.3d 956 (11th Cir. 2001).
5. I’m the process of shipping goods that are damaged while
sitting on the dock in California waiting for loading. Absent
contractual language about choice of law, which law will govern
my claim? (2)
6. My goods are going to be shipped from Florida to South
Africa. During the voyage, the ship’s captain makes a
navigational error and runs aground 50 miles off course,
destroying my cargo. Will the carrier be liable under COGSA?
Explain why/why not? (4)
7. Watch the video and review in detail the following website:
https://www.youtube.com/watch?v=8fGrS0kU2h0,
http://worldjusticeproject.org/. What is the rule of law? Why is
this concept a concern for International business? Do you think
the United States lives by the Rule of Law? This has actually
been a hot topic of late in our political discussions. (8 points)
8. What does it mean to have “normal trade relations” with a
country and why is this a big deal? (3)
9. An Italian company believes that its products have been
unfairly treated in terms of tariffs by the U.S. government. In
what court would they bring their claim? (2)
10. Explain two ways the president can get around the full
treaty process. (4)
11. Answer #2 pg. 233. (4)
TheTrade Expansion Act of 1962 as amended by the Trade Act
of 1974 states that if the secretary of the treasury finds that an
“article is being imported into the United States in such
quantities or under such circumstances as to threaten to impair
the national security,” the president is authorized to “take such
action . . . as he deems necessary to adjust the imports of the
article . . . so that [it] will not threaten to impair the national
security.” Does this grant of power by Congress allow the
president to establish quotas? If importation of foreign oil is
deemed “a threat to national security,” can the president
implement a $3–$4-per-barrel license fee? See Federal Energy
Administration v. Algonquin SNG, Inc., 426 U.S. 548 (1976).
[IFT 102]
Introduction to Java Technologies
Lab 4: OO Design and Interfaces
Score: 50 pts
I. Student GPA’s
This exercise is based on the requirement analysis and solution
design that was discussed in class. The full analysis can be
found under the Week 7 -> Materials folder on BlackBoard. You
are required to take this design and convert it into Java code.
This includes writing the Student class along with its variables
and methods. Make sure that you use the proper accessibility
modifiers (private & public) such that encapsulation is properly
enforced.
After writing the Student class, write another class named
StudentData, and add your main function in that class. In the
main function, create two objects of the Student class, add four
courses for the first student object, and three courses for the
second student object. Each added course is associated with a
letter grade and a number of credits. Then call the
compute_gpa() function to compute the GPA for each student,
and print out the GPA for each student, along with his list of
courses, grades and credits.
II. Using the Comparable Interface
1. Write a class Compare3 that provides a static method largest.
Method largest should take three Comparable parameters and
return the largest of the three (so its return type will also be
Comparable). Recall that method compareTo is part of the
Comparable interface, so largest can use the compareTo method
of its parameters to compare them.
2. Write a class Comparisons whose main method tests your
largest method above.
· First prompt the user for and read in three strings, use your
largest method to find the largest of the three strings, and print
it out. (It’s easiest to put the call to largest directly in the call
to println.) Note that since largest is a static method, you will
call it through its class name, e.g., Compare3.largest(val1, val2,
val3).
· Add code to also prompt the user for three integers and try to
use your largest method to find the largest of the three integers.
Does this work? If it does, it’s thanks to autoboxing, which is
Java 1.5’s automatic conversion of ints to Integers. You may
have to use the -source 1.5 compiler option for this to work.
III. A Flexible Account Class
File Account.java contains a definition for a simple bank
account class with methods to withdraw, deposit, get the
balance and account number, and return a String representation.
Note that the constructor for this class creates a random account
number. Save this class to your directory and study it to see
how it works. Then modify it as follows:
1. Overload the constructor as follows:
· public Account (double initBal, String owner, long number) -
initializes the balance, owner, and account number as specified
· public Account (double initBal, String owner) - initializes the
balance and owner as specified; randomly generates the account
number.
· public Account (String owner) - initializes the owner as
specified; sets the initial balance to 0 and randomly generates
the account number.
2. Overload the withdraw method with one that also takes a fee
and deducts that fee from the account.
File TestAccount.java contains a simple program that exercises
these methods. Save it to your directory, study it to see what it
does, and use it to test your modified Account class.
//***************************************************
*********
// Account.java
//
// A bank account class with methods to deposit to, withdraw
from,
// change the name on, and get a String representation
// of the account.
//***************************************************
*********
public class Account
{
private double balance;
private String name;
private long acctNum;
//-------------------------------------------------
//Constructor -- initializes balance, owner, and account number
//-------------------------------------------------
public Account(double initBal, String owner, long number)
{
balance = initBal;
name = owner;
acctNum = number;
}
//-------------------------------------------------
// Checks to see if balance is sufficient for withdrawal.
// If so, decrements balance by amount; if not, prints message.
//-------------------------------------------------
public void withdraw(double amount)
{
if (balance >= amount)
balance -= amount;
else
System.out.println("Insufficient funds");
}
//-------------------------------------------------
// Adds deposit amount to balance.
//-------------------------------------------------
public void deposit(double amount)
{
balance += amount;
}
//-------------------------------------------------
// Returns balance.
//-------------------------------------------------
public double getBalance()
{
return balance;
}
//-------------------------------------------------
// Returns a string containing the name, account number, and
balance.
//-------------------------------------------------
public String toString()
{
return "Name:" + name +
"nAccount Number: " + acctNum +
"nBalance: " + balance;
}
}
//***************************************************
*********
// TestAccount.java
//
// A simple driver to test the overloaded methods of
// the Account class.
//***************************************************
*********
import java.util.Scanner;
public class TestAccount
{
public static void main(String[] args)
{
String name;
double balance;
long acctNum;
Account acct;
Scanner scan = new Scanner(System.in);
System.out.println("Enter account holder's first name");
name = scan.next();
acct = new Account(name);
System.out.println("Account for " + name + ":");
System.out.println(acct);
System.out.println("nEnter initial balance");
balance = scan.nextDouble();
acct = new Account(balance,name);
System.out.println("Account for " + name + ":");
System.out.println(acct);
System.out.println("nEnter account number");
acctNum = scan.nextLong();
acct = new Account(balance,name,acctNum);
System.out.println("Account for " + name + ":");
System.out.println(acct);
System.out.print("nDepositing 100 into account, balance is now
");
acct.deposit(100);
System.out.println(acct.getBalance());
System.out.print("nWithdrawing $25, balance is now ");
acct.withdraw(25);
System.out.println(acct.getBalance());
System.out.print("nWithdrawing $25 with $2 fee, balance is
now ");
acct.withdraw(25,2);
System.out.println(acct.getBalance());
System.out.println("nBye!");
}
}
IV. Opening and Closing Accounts
File Account.java (see previous exercise) contains a definition
for a simple bank account class with methods to withdraw,
deposit, get the balance and account number, and return a String
representation. Note that the constructor for this class creates a
random account number. Save this class to your directory and
study it to see how it works. Then write the following additional
code:
1. Suppose the bank wants to keep track of how many accounts
exist.
a. Declare a private static integer variable numAccounts to hold
this value. Like all instance and static variables, it will be
initialized (to 0, since it’s an int) automatically.
b. Add code to the constructor to increment this variable every
time an account is created.
c. Add a static method getNumAccounts that returns the total
number of accounts. Think about why this method should be
static - its information is not related to any particular account.
d. File TestAccounts1.java contains a simple program that
creates the specified number of bank accounts then uses the
getNumAccounts method to find how many accounts were
created. Save it to your directory, then use it to test your
modified Account class.
2. Add a method void close() to your Account class. This
method should close the current account by appending
“CLOSED” to the account name and setting the balance to 0.
(The account number should remain unchanged.) Also
decrement the total number of accounts.
3. Add a static method Account consolidate(Account acct1,
Account acct2) to your Account class that creates a new account
whose balance is the sum of the balances in acct1 and acct2 and
closes acct1 and acct2. The new account should be returned.
Two important rules of consolidation:
· Only accounts with the same name can be consolidated. The
new account gets the name on the old accounts but a new
account number.
· Two accounts with the same number cannot be consolidated.
Otherwise this would be an easy way to double your money!
Check these conditions before creating the new account. If
either condition fails, do not create the new account or close the
old ones; print a useful message and return null.
4. Write a test program that prompts for and reads in three
names and creates an account with an initial balance of $ 100
for each. Print the three accounts, then close the first account
and try to consolidate the second and third into a new account.
Now print the accounts again, including the consolidated one if
it was created.
//***************************************************
*********
// TestAccounts1
// A simple program to test the numAccts method of the
// Account class.
//***************************************************
*********
import java.util.Scanner;
public class TestAccounts1
{
public static void main(String[] args)
{
Account testAcct;
Scanner scan = new Scanner(System.in);
System.out.println("How many accounts would you like to
create?");
int num = scan.nextInt();
for (int i=1; i<=num; i++)
{
testAcct = new Account(100, "Name" + i);
System.out.println("nCreated account " + testAcct);
System.out.println("Now there are " + Account.numAccounts ()
+
" accounts");
}
}
}
V. Transfering Funds
File Account.java (see A Flexible Account Class exercise)
contains a definition for a simple bank account class with
methods to withdraw, deposit, get the balance and account
number, and print a summary. Save it to your directory and
study it to see how it works. Then write the following additional
code:
1. Add a method public void transfer(Account acct, double
amount) to the Account class that allows the user to transfer
funds from one bank account to another. If acct1 and acct2 are
Account objects, then the call acct1.transfer(acct2,957.80)
should transfer $957.80 from acct1 to acct2. Be sure to clearly
document which way the transfer goes!
2. Write a class TransferTest with a main method that creates
two bank account objects and enters a loop that does the
following:
· Asks if the user would like to transfer from account1 to
account2, transfer from account2 to account1, or quit.
· If a transfer is chosen, asks the amount of the transfer, carries
out the operation, and prints the new balance for each account.
· Repeats until the user asks to quit, then prints a summary for
each account.
3. Add a static method to the Account class that lets the user
transfer money between two accounts without going through
either account. You can (and should) call the method transfer
just like the other one - you are overloading this method.
Your new method should take two Account objects and an
amount and transfer the amount from the first account to the
second account. The signature will look like this:
public static void transfer(Account acct1, Account acct2, double
amount)
Modify your TransferTest class to use the static transfer instead
of the instance version.
Deliverables
1. Complete all the activities in this lab; then zip all your Java
SOURCE CODE FILES for submission.
2. Write a lab report in Word or PDF document. The report
should be named lab4.docx or lab4.pdf and must contain the
following:
a. The first page should be a cover page that includes the Class
Number, Lab Activity Number, Date, and Instructor’s name.
b. A description of the lab activities, the concepts learned and
applied. Be sure to elaborate on all the concepts applied. A
minimum of 2-page description is expected.
c. A 1-paragraph conclusion about your experience; how long
you spent completing the lab, the challenges you faced.
3. Upload your lab report and the zip file of your source code to
Blackboard. DO NOT SUBMIT separate source files. If you do,
they will be ignored.

Mais conteúdo relacionado

Semelhante a HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docx

40 Cause And Effect Essay Topics For Students - Write
40 Cause And Effect Essay Topics For Students - Write40 Cause And Effect Essay Topics For Students - Write
40 Cause And Effect Essay Topics For Students - WriteWhitney Turner
 
Writing Prompts For College Essays. Online assignment writing service.
Writing Prompts For College Essays. Online assignment writing service.Writing Prompts For College Essays. Online assignment writing service.
Writing Prompts For College Essays. Online assignment writing service.Rebecca Harris
 
Writing A Response Paper
Writing A Response PaperWriting A Response Paper
Writing A Response PaperLeslie Daniels
 
Notebook Paper Template For Word DocTemplates
Notebook Paper Template For Word DocTemplatesNotebook Paper Template For Word DocTemplates
Notebook Paper Template For Word DocTemplatesKatie Williams
 
Eine Buchkritik Schreiben Unterricht Telegraph
Eine Buchkritik Schreiben Unterricht TelegraphEine Buchkritik Schreiben Unterricht Telegraph
Eine Buchkritik Schreiben Unterricht TelegraphWendy Boyd
 
Dialogue Personal Essay 005 Example Dialogue Essay Pe
Dialogue Personal Essay 005 Example Dialogue Essay PeDialogue Personal Essay 005 Example Dialogue Essay Pe
Dialogue Personal Essay 005 Example Dialogue Essay PeKimberly Berger
 
C A R E S Peer Review Feedback Form Perhaps the most helpfu.docx
C A R E S  Peer Review Feedback Form Perhaps the most helpfu.docxC A R E S  Peer Review Feedback Form Perhaps the most helpfu.docx
C A R E S Peer Review Feedback Form Perhaps the most helpfu.docxclairbycraft
 
Sample Compare And Contrast Essays For High School
Sample Compare And Contrast Essays For High SchoolSample Compare And Contrast Essays For High School
Sample Compare And Contrast Essays For High SchoolBrenda Gutierrez
 
Leg 565 Education Specialist -snaptutorial.com
Leg 565    Education Specialist -snaptutorial.comLeg 565    Education Specialist -snaptutorial.com
Leg 565 Education Specialist -snaptutorial.comDavisMurphyC61
 
College Essay Transition To Adulthood
College Essay Transition To AdulthoodCollege Essay Transition To Adulthood
College Essay Transition To AdulthoodViviana Principe
 
Good Conclusion Examples For Essays.pdf
Good Conclusion Examples For Essays.pdfGood Conclusion Examples For Essays.pdf
Good Conclusion Examples For Essays.pdfDana French
 
Essay Outline - Introduction A. You DonT Take A Photo
Essay Outline - Introduction A. You DonT Take A PhotoEssay Outline - Introduction A. You DonT Take A Photo
Essay Outline - Introduction A. You DonT Take A PhotoVeronica Perez
 
Leg 565 Success Begins / snaptutorial.com
Leg 565  Success Begins / snaptutorial.comLeg 565  Success Begins / snaptutorial.com
Leg 565 Success Begins / snaptutorial.comWilliamsTaylor17
 
How To Write A Good Compare And Contrast Essay Identif
How To Write A Good Compare And Contrast Essay IdentifHow To Write A Good Compare And Contrast Essay Identif
How To Write A Good Compare And Contrast Essay IdentifAvis Malave
 
Each Kindness Exemplar Essay Writi. Online assignment writing service.
Each Kindness Exemplar Essay Writi. Online assignment writing service.Each Kindness Exemplar Essay Writi. Online assignment writing service.
Each Kindness Exemplar Essay Writi. Online assignment writing service.Claudia Brown
 

Semelhante a HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docx (17)

Police Explorer Essay
Police Explorer EssayPolice Explorer Essay
Police Explorer Essay
 
40 Cause And Effect Essay Topics For Students - Write
40 Cause And Effect Essay Topics For Students - Write40 Cause And Effect Essay Topics For Students - Write
40 Cause And Effect Essay Topics For Students - Write
 
Writing Prompts For College Essays. Online assignment writing service.
Writing Prompts For College Essays. Online assignment writing service.Writing Prompts For College Essays. Online assignment writing service.
Writing Prompts For College Essays. Online assignment writing service.
 
Writing A Response Paper
Writing A Response PaperWriting A Response Paper
Writing A Response Paper
 
Notebook Paper Template For Word DocTemplates
Notebook Paper Template For Word DocTemplatesNotebook Paper Template For Word DocTemplates
Notebook Paper Template For Word DocTemplates
 
Eine Buchkritik Schreiben Unterricht Telegraph
Eine Buchkritik Schreiben Unterricht TelegraphEine Buchkritik Schreiben Unterricht Telegraph
Eine Buchkritik Schreiben Unterricht Telegraph
 
Dialogue Personal Essay 005 Example Dialogue Essay Pe
Dialogue Personal Essay 005 Example Dialogue Essay PeDialogue Personal Essay 005 Example Dialogue Essay Pe
Dialogue Personal Essay 005 Example Dialogue Essay Pe
 
C A R E S Peer Review Feedback Form Perhaps the most helpfu.docx
C A R E S  Peer Review Feedback Form Perhaps the most helpfu.docxC A R E S  Peer Review Feedback Form Perhaps the most helpfu.docx
C A R E S Peer Review Feedback Form Perhaps the most helpfu.docx
 
Sample Compare And Contrast Essays For High School
Sample Compare And Contrast Essays For High SchoolSample Compare And Contrast Essays For High School
Sample Compare And Contrast Essays For High School
 
Leg 565 Education Specialist -snaptutorial.com
Leg 565    Education Specialist -snaptutorial.comLeg 565    Education Specialist -snaptutorial.com
Leg 565 Education Specialist -snaptutorial.com
 
College Essay Transition To Adulthood
College Essay Transition To AdulthoodCollege Essay Transition To Adulthood
College Essay Transition To Adulthood
 
Good Conclusion Examples For Essays.pdf
Good Conclusion Examples For Essays.pdfGood Conclusion Examples For Essays.pdf
Good Conclusion Examples For Essays.pdf
 
Essay Outline - Introduction A. You DonT Take A Photo
Essay Outline - Introduction A. You DonT Take A PhotoEssay Outline - Introduction A. You DonT Take A Photo
Essay Outline - Introduction A. You DonT Take A Photo
 
Leg 565 Success Begins / snaptutorial.com
Leg 565  Success Begins / snaptutorial.comLeg 565  Success Begins / snaptutorial.com
Leg 565 Success Begins / snaptutorial.com
 
How To Write A Good Compare And Contrast Essay Identif
How To Write A Good Compare And Contrast Essay IdentifHow To Write A Good Compare And Contrast Essay Identif
How To Write A Good Compare And Contrast Essay Identif
 
TGP 2.docx
TGP 2.docxTGP 2.docx
TGP 2.docx
 
Each Kindness Exemplar Essay Writi. Online assignment writing service.
Each Kindness Exemplar Essay Writi. Online assignment writing service.Each Kindness Exemplar Essay Writi. Online assignment writing service.
Each Kindness Exemplar Essay Writi. Online assignment writing service.
 

Mais de wellesleyterresa

Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docxHw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docxwellesleyterresa
 
HW in teams of 3 studentsAn oil remanufacturing company uses c.docx
HW in teams of 3 studentsAn oil remanufacturing company uses c.docxHW in teams of 3 studentsAn oil remanufacturing company uses c.docx
HW in teams of 3 studentsAn oil remanufacturing company uses c.docxwellesleyterresa
 
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docxHW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docxwellesleyterresa
 
HW 2Due July 1 by 500 PM.docx
HW 2Due July 1 by 500 PM.docxHW 2Due July 1 by 500 PM.docx
HW 2Due July 1 by 500 PM.docxwellesleyterresa
 
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docxHW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docxwellesleyterresa
 
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docxHW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docxwellesleyterresa
 
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docx
HW 5-RSAascii2str.mfunction str = ascii2str(ascii)        .docxHW 5-RSAascii2str.mfunction str = ascii2str(ascii)        .docx
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docxwellesleyterresa
 
HW 3 Project Control• Status meeting agenda – shows time, date .docx
HW 3 Project Control• Status meeting agenda – shows time, date .docxHW 3 Project Control• Status meeting agenda – shows time, date .docx
HW 3 Project Control• Status meeting agenda – shows time, date .docxwellesleyterresa
 
HW 1January 19 2017Due back Jan 26, in class.1. (T.docx
HW 1January 19 2017Due back Jan 26, in class.1. (T.docxHW 1January 19 2017Due back Jan 26, in class.1. (T.docx
HW 1January 19 2017Due back Jan 26, in class.1. (T.docxwellesleyterresa
 
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docxHussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docxwellesleyterresa
 
hw1.docxCS 211 Homework #1Please complete the homework problem.docx
hw1.docxCS 211 Homework #1Please complete the homework problem.docxhw1.docxCS 211 Homework #1Please complete the homework problem.docx
hw1.docxCS 211 Homework #1Please complete the homework problem.docxwellesleyterresa
 
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docxHUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docxwellesleyterresa
 
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docxHW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docxwellesleyterresa
 
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docxHW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docxwellesleyterresa
 
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docxHunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docxwellesleyterresa
 
HW 2 - SQL The database you will use for this assignme.docx
HW 2 - SQL   The database you will use for this assignme.docxHW 2 - SQL   The database you will use for this assignme.docx
HW 2 - SQL The database you will use for this assignme.docxwellesleyterresa
 
Humanities Commons Learning Goals1. Write about primary and seco.docx
Humanities Commons Learning Goals1. Write about primary and seco.docxHumanities Commons Learning Goals1. Write about primary and seco.docx
Humanities Commons Learning Goals1. Write about primary and seco.docxwellesleyterresa
 
HURRICANE KATRINA A NATION STILL UNPREPARED .docx
HURRICANE KATRINA  A NATION STILL UNPREPARED   .docxHURRICANE KATRINA  A NATION STILL UNPREPARED   .docx
HURRICANE KATRINA A NATION STILL UNPREPARED .docxwellesleyterresa
 
Humanities 115Short Essay Grading CriteriaExcellentPassing.docx
Humanities 115Short Essay Grading CriteriaExcellentPassing.docxHumanities 115Short Essay Grading CriteriaExcellentPassing.docx
Humanities 115Short Essay Grading CriteriaExcellentPassing.docxwellesleyterresa
 
HUMAN RESOURCES’ ROLE IN SUCCESSION PLANNING Succession planni.docx
HUMAN RESOURCES’ ROLE IN SUCCESSION PLANNING Succession planni.docxHUMAN RESOURCES’ ROLE IN SUCCESSION PLANNING Succession planni.docx
HUMAN RESOURCES’ ROLE IN SUCCESSION PLANNING Succession planni.docxwellesleyterresa
 

Mais de wellesleyterresa (20)

Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docxHw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
Hw059f6dbf-250a-4d74-8f5e-f28f14227edc.jpg__MACOSXHw._059.docx
 
HW in teams of 3 studentsAn oil remanufacturing company uses c.docx
HW in teams of 3 studentsAn oil remanufacturing company uses c.docxHW in teams of 3 studentsAn oil remanufacturing company uses c.docx
HW in teams of 3 studentsAn oil remanufacturing company uses c.docx
 
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docxHW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
HW 5.docxAssignment 5 – Currency riskYou may do this assig.docx
 
HW 2Due July 1 by 500 PM.docx
HW 2Due July 1 by 500 PM.docxHW 2Due July 1 by 500 PM.docx
HW 2Due July 1 by 500 PM.docx
 
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docxHW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
HW 4 Gung Ho Commentary DUE Thursday, April 20 at 505 PM on.docx
 
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docxHW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
HW 5 Math 405. Due beginning of class – Monday, 10 Oct 2016.docx
 
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docx
HW 5-RSAascii2str.mfunction str = ascii2str(ascii)        .docxHW 5-RSAascii2str.mfunction str = ascii2str(ascii)        .docx
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docx
 
HW 3 Project Control• Status meeting agenda – shows time, date .docx
HW 3 Project Control• Status meeting agenda – shows time, date .docxHW 3 Project Control• Status meeting agenda – shows time, date .docx
HW 3 Project Control• Status meeting agenda – shows time, date .docx
 
HW 1January 19 2017Due back Jan 26, in class.1. (T.docx
HW 1January 19 2017Due back Jan 26, in class.1. (T.docxHW 1January 19 2017Due back Jan 26, in class.1. (T.docx
HW 1January 19 2017Due back Jan 26, in class.1. (T.docx
 
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docxHussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
Hussam Malibari Heckman MAT 242 Spring 2017Assignment Chapte.docx
 
hw1.docxCS 211 Homework #1Please complete the homework problem.docx
hw1.docxCS 211 Homework #1Please complete the homework problem.docxhw1.docxCS 211 Homework #1Please complete the homework problem.docx
hw1.docxCS 211 Homework #1Please complete the homework problem.docx
 
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docxHUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
HUS 335 Interpersonal Helping SkillsCase Assessment FormatT.docx
 
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docxHW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
HW #1Tech Alert on IT & Strategy (Ch 3-5Ch 3 -5 IT Strategy opt.docx
 
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docxHW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
HW 2 (1) Visit Monsanto (httpwww.monsanto.com) again and Goog.docx
 
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docxHunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
Hunters Son Dialogue Activity1. Please write 1-2 sentences for e.docx
 
HW 2 - SQL The database you will use for this assignme.docx
HW 2 - SQL   The database you will use for this assignme.docxHW 2 - SQL   The database you will use for this assignme.docx
HW 2 - SQL The database you will use for this assignme.docx
 
Humanities Commons Learning Goals1. Write about primary and seco.docx
Humanities Commons Learning Goals1. Write about primary and seco.docxHumanities Commons Learning Goals1. Write about primary and seco.docx
Humanities Commons Learning Goals1. Write about primary and seco.docx
 
HURRICANE KATRINA A NATION STILL UNPREPARED .docx
HURRICANE KATRINA  A NATION STILL UNPREPARED   .docxHURRICANE KATRINA  A NATION STILL UNPREPARED   .docx
HURRICANE KATRINA A NATION STILL UNPREPARED .docx
 
Humanities 115Short Essay Grading CriteriaExcellentPassing.docx
Humanities 115Short Essay Grading CriteriaExcellentPassing.docxHumanities 115Short Essay Grading CriteriaExcellentPassing.docx
Humanities 115Short Essay Grading CriteriaExcellentPassing.docx
 
HUMAN RESOURCES’ ROLE IN SUCCESSION PLANNING Succession planni.docx
HUMAN RESOURCES’ ROLE IN SUCCESSION PLANNING Succession planni.docxHUMAN RESOURCES’ ROLE IN SUCCESSION PLANNING Succession planni.docx
HUMAN RESOURCES’ ROLE IN SUCCESSION PLANNING Succession planni.docx
 

Último

Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptxmary850239
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptxmary850239
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...Nguyen Thanh Tu Collection
 
An Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPAn Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPCeline George
 
Comparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxComparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxAvaniJani1
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...Nguyen Thanh Tu Collection
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 

Último (20)

Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
 
An Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPAn Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERP
 
Comparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptxComparative Literature in India by Amiya dev.pptx
Comparative Literature in India by Amiya dev.pptx
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
 
Spearman's correlation,Formula,Advantages,
Spearman's correlation,Formula,Advantages,Spearman's correlation,Formula,Advantages,
Spearman's correlation,Formula,Advantages,
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 

HW#3 – Spring 20181. Giulia is traveling from Italy to China. .docx

  • 1. HW#3 – Spring 2018 1. Giulia is traveling from Italy to China. The plane briefly lands in Thailand to refuel and pick up new passengers. In the process of landing in Thailand, the overhead storage bin across the aisle flies open and a carry-on bag whacks Giulia in the head causing a concussion. Does the Montreal Convention govern this incident? Explain in detail why or why not. (4) 2. Following up on #1, Giulia’s husband, Kevin, is on board and is deeply disturbed by the incident to the point that he files a claim for mental anguish. What are his chances of success? Explain. (3) 3. How many U.S. dollars would someone get if they sustained 100 kilograms worth of cargo losses under the Montreal convention on February 1st, 2018? (3) 4. Lucas is flying from Houston, TX to Ixtapa, Mexico for a fishing vacation when a 3 hour delay in Houston forces him to miss his connecting flight, resulting in a loss of $500 in pre- paid expenses. If the delay was due to weather would the airline be liable under the Montreal Convention? What about a mechanical issue? Explain the likelihood of his success in recovery in each case. (4) 4. Answer #4 page 179. (4)Fishman shipper a container of boys’ pants on a ship owner by Tropical. The container was lost at sea due to improper storage. The pants were attacked into bundles of 12 each and placed into what is known in the industry as a “big pack.” A “big pack” is similar to a 4’x4’ pallet, partially enclosed in corrugated cardboard, with a base and cover made of plastic. The bill of lading stated, “1 x 40 ft. [container] STC [said to
  • 2. contain] 39 Big Pack Containing 27,908 unit’s boy’s pants.” Fishman maintains that Tropical is liable for an amount up to $500 for each of the 2,325 bundles. If the carrier is liable for up to $500 per “package,” what is the limit of the carrier’s liability? Fishman & Tobin, Inc. v. Tropical Shipping & Const. Co., Ltd., 240 F.3d 956 (11th Cir. 2001). 5. I’m the process of shipping goods that are damaged while sitting on the dock in California waiting for loading. Absent contractual language about choice of law, which law will govern my claim? (2) 6. My goods are going to be shipped from Florida to South Africa. During the voyage, the ship’s captain makes a navigational error and runs aground 50 miles off course, destroying my cargo. Will the carrier be liable under COGSA? Explain why/why not? (4) 7. Watch the video and review in detail the following website: https://www.youtube.com/watch?v=8fGrS0kU2h0, http://worldjusticeproject.org/. What is the rule of law? Why is this concept a concern for International business? Do you think the United States lives by the Rule of Law? This has actually been a hot topic of late in our political discussions. (8 points) 8. What does it mean to have “normal trade relations” with a country and why is this a big deal? (3) 9. An Italian company believes that its products have been unfairly treated in terms of tariffs by the U.S. government. In what court would they bring their claim? (2) 10. Explain two ways the president can get around the full treaty process. (4) 11. Answer #2 pg. 233. (4)
  • 3. TheTrade Expansion Act of 1962 as amended by the Trade Act of 1974 states that if the secretary of the treasury finds that an “article is being imported into the United States in such quantities or under such circumstances as to threaten to impair the national security,” the president is authorized to “take such action . . . as he deems necessary to adjust the imports of the article . . . so that [it] will not threaten to impair the national security.” Does this grant of power by Congress allow the president to establish quotas? If importation of foreign oil is deemed “a threat to national security,” can the president implement a $3–$4-per-barrel license fee? See Federal Energy Administration v. Algonquin SNG, Inc., 426 U.S. 548 (1976). [IFT 102] Introduction to Java Technologies Lab 4: OO Design and Interfaces Score: 50 pts I. Student GPA’s This exercise is based on the requirement analysis and solution design that was discussed in class. The full analysis can be found under the Week 7 -> Materials folder on BlackBoard. You are required to take this design and convert it into Java code. This includes writing the Student class along with its variables and methods. Make sure that you use the proper accessibility modifiers (private & public) such that encapsulation is properly enforced. After writing the Student class, write another class named StudentData, and add your main function in that class. In the main function, create two objects of the Student class, add four courses for the first student object, and three courses for the second student object. Each added course is associated with a letter grade and a number of credits. Then call the compute_gpa() function to compute the GPA for each student, and print out the GPA for each student, along with his list of courses, grades and credits.
  • 4. II. Using the Comparable Interface 1. Write a class Compare3 that provides a static method largest. Method largest should take three Comparable parameters and return the largest of the three (so its return type will also be Comparable). Recall that method compareTo is part of the Comparable interface, so largest can use the compareTo method of its parameters to compare them. 2. Write a class Comparisons whose main method tests your largest method above. · First prompt the user for and read in three strings, use your largest method to find the largest of the three strings, and print it out. (It’s easiest to put the call to largest directly in the call to println.) Note that since largest is a static method, you will call it through its class name, e.g., Compare3.largest(val1, val2, val3). · Add code to also prompt the user for three integers and try to use your largest method to find the largest of the three integers. Does this work? If it does, it’s thanks to autoboxing, which is Java 1.5’s automatic conversion of ints to Integers. You may have to use the -source 1.5 compiler option for this to work. III. A Flexible Account Class File Account.java contains a definition for a simple bank account class with methods to withdraw, deposit, get the
  • 5. balance and account number, and return a String representation. Note that the constructor for this class creates a random account number. Save this class to your directory and study it to see how it works. Then modify it as follows: 1. Overload the constructor as follows: · public Account (double initBal, String owner, long number) - initializes the balance, owner, and account number as specified · public Account (double initBal, String owner) - initializes the balance and owner as specified; randomly generates the account number. · public Account (String owner) - initializes the owner as specified; sets the initial balance to 0 and randomly generates the account number. 2. Overload the withdraw method with one that also takes a fee and deducts that fee from the account. File TestAccount.java contains a simple program that exercises these methods. Save it to your directory, study it to see what it does, and use it to test your modified Account class. //*************************************************** ********* // Account.java // // A bank account class with methods to deposit to, withdraw from, // change the name on, and get a String representation // of the account. //*************************************************** ********* public class Account
  • 6. { private double balance; private String name; private long acctNum; //------------------------------------------------- //Constructor -- initializes balance, owner, and account number //------------------------------------------------- public Account(double initBal, String owner, long number) { balance = initBal; name = owner; acctNum = number; } //------------------------------------------------- // Checks to see if balance is sufficient for withdrawal. // If so, decrements balance by amount; if not, prints message. //------------------------------------------------- public void withdraw(double amount) { if (balance >= amount) balance -= amount; else System.out.println("Insufficient funds"); } //------------------------------------------------- // Adds deposit amount to balance. //------------------------------------------------- public void deposit(double amount) { balance += amount; } //-------------------------------------------------
  • 7. // Returns balance. //------------------------------------------------- public double getBalance() { return balance; } //------------------------------------------------- // Returns a string containing the name, account number, and balance. //------------------------------------------------- public String toString() { return "Name:" + name + "nAccount Number: " + acctNum + "nBalance: " + balance; } } //*************************************************** ********* // TestAccount.java // // A simple driver to test the overloaded methods of // the Account class. //*************************************************** ********* import java.util.Scanner; public class TestAccount { public static void main(String[] args) { String name;
  • 8. double balance; long acctNum; Account acct; Scanner scan = new Scanner(System.in); System.out.println("Enter account holder's first name"); name = scan.next(); acct = new Account(name); System.out.println("Account for " + name + ":"); System.out.println(acct); System.out.println("nEnter initial balance"); balance = scan.nextDouble(); acct = new Account(balance,name); System.out.println("Account for " + name + ":"); System.out.println(acct); System.out.println("nEnter account number"); acctNum = scan.nextLong(); acct = new Account(balance,name,acctNum); System.out.println("Account for " + name + ":"); System.out.println(acct); System.out.print("nDepositing 100 into account, balance is now "); acct.deposit(100); System.out.println(acct.getBalance()); System.out.print("nWithdrawing $25, balance is now "); acct.withdraw(25); System.out.println(acct.getBalance()); System.out.print("nWithdrawing $25 with $2 fee, balance is now "); acct.withdraw(25,2); System.out.println(acct.getBalance());
  • 9. System.out.println("nBye!"); } } IV. Opening and Closing Accounts File Account.java (see previous exercise) contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and return a String representation. Note that the constructor for this class creates a random account number. Save this class to your directory and study it to see how it works. Then write the following additional code: 1. Suppose the bank wants to keep track of how many accounts exist. a. Declare a private static integer variable numAccounts to hold this value. Like all instance and static variables, it will be initialized (to 0, since it’s an int) automatically. b. Add code to the constructor to increment this variable every time an account is created. c. Add a static method getNumAccounts that returns the total number of accounts. Think about why this method should be static - its information is not related to any particular account. d. File TestAccounts1.java contains a simple program that creates the specified number of bank accounts then uses the getNumAccounts method to find how many accounts were created. Save it to your directory, then use it to test your modified Account class. 2. Add a method void close() to your Account class. This method should close the current account by appending “CLOSED” to the account name and setting the balance to 0.
  • 10. (The account number should remain unchanged.) Also decrement the total number of accounts. 3. Add a static method Account consolidate(Account acct1, Account acct2) to your Account class that creates a new account whose balance is the sum of the balances in acct1 and acct2 and closes acct1 and acct2. The new account should be returned. Two important rules of consolidation: · Only accounts with the same name can be consolidated. The new account gets the name on the old accounts but a new account number. · Two accounts with the same number cannot be consolidated. Otherwise this would be an easy way to double your money! Check these conditions before creating the new account. If either condition fails, do not create the new account or close the old ones; print a useful message and return null. 4. Write a test program that prompts for and reads in three names and creates an account with an initial balance of $ 100 for each. Print the three accounts, then close the first account and try to consolidate the second and third into a new account. Now print the accounts again, including the consolidated one if it was created. //*************************************************** ********* // TestAccounts1 // A simple program to test the numAccts method of the // Account class. //*************************************************** ********* import java.util.Scanner; public class TestAccounts1 {
  • 11. public static void main(String[] args) { Account testAcct; Scanner scan = new Scanner(System.in); System.out.println("How many accounts would you like to create?"); int num = scan.nextInt(); for (int i=1; i<=num; i++) { testAcct = new Account(100, "Name" + i); System.out.println("nCreated account " + testAcct); System.out.println("Now there are " + Account.numAccounts () + " accounts"); } } } V. Transfering Funds File Account.java (see A Flexible Account Class exercise) contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and print a summary. Save it to your directory and study it to see how it works. Then write the following additional code: 1. Add a method public void transfer(Account acct, double amount) to the Account class that allows the user to transfer
  • 12. funds from one bank account to another. If acct1 and acct2 are Account objects, then the call acct1.transfer(acct2,957.80) should transfer $957.80 from acct1 to acct2. Be sure to clearly document which way the transfer goes! 2. Write a class TransferTest with a main method that creates two bank account objects and enters a loop that does the following: · Asks if the user would like to transfer from account1 to account2, transfer from account2 to account1, or quit. · If a transfer is chosen, asks the amount of the transfer, carries out the operation, and prints the new balance for each account. · Repeats until the user asks to quit, then prints a summary for each account. 3. Add a static method to the Account class that lets the user transfer money between two accounts without going through either account. You can (and should) call the method transfer just like the other one - you are overloading this method. Your new method should take two Account objects and an amount and transfer the amount from the first account to the second account. The signature will look like this: public static void transfer(Account acct1, Account acct2, double amount) Modify your TransferTest class to use the static transfer instead of the instance version.
  • 13. Deliverables 1. Complete all the activities in this lab; then zip all your Java SOURCE CODE FILES for submission. 2. Write a lab report in Word or PDF document. The report should be named lab4.docx or lab4.pdf and must contain the following: a. The first page should be a cover page that includes the Class Number, Lab Activity Number, Date, and Instructor’s name. b. A description of the lab activities, the concepts learned and applied. Be sure to elaborate on all the concepts applied. A minimum of 2-page description is expected. c. A 1-paragraph conclusion about your experience; how long you spent completing the lab, the challenges you faced. 3. Upload your lab report and the zip file of your source code to Blackboard. DO NOT SUBMIT separate source files. If you do, they will be ignored.