subject
Computers and Technology, 20.02.2020 23:55 jwbri

In a package named "execution", implement the following classes: • class Valuable • • Constructor takes one variable as a parameter named "item" of type Valuable (use var) • This class represents someone with a valuable item they are wiling to trade. Each trader can only own 1 item at a time which is stored in the "item" state variable • class TradeAgreement • Constructor takes 2 objects of type Trader • One method named "executeTrade" that take no parameters and returns Unit • When this method is called, swap the items belonging to the 2 traders from the constructor (ie. When a TradeAgreement is created, 2 people are agreeing to a trade. When executeTrade is called, they physically trade those items) • The agreement can only be executed once. If this method is called more than once for a single agreement, additional trades are not made (ie. The people do not trade back to their original items if this method is called twice)

Testing: In a package named "tests" create a Scala class named "TestTrading" as a test suite that tests all the functionality listed above

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:30, jaueuxsn
Which component acts as a platform on which application software runs
Answers: 2
image
Computers and Technology, 23.06.2019 07:30, devnnn44
What is the original authority for copyright laws
Answers: 1
image
Computers and Technology, 23.06.2019 11:00, jolleyrancher78
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, petergriffin6772
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
You know the right answer?
In a package named "execution", implement the following classes: • class Valuable • • Constructor ta...

Questions in other subjects:

Konu
Mathematics, 30.03.2020 21:19
Konu
Mathematics, 30.03.2020 21:19