subject

A modern ship
A large container ship is traversing the Atlantic Ocean. It needs to deliver a large number of containers to a port in the United States. The ship in question has recently been upgraded with some new technologies.
The most notable of this is a new robot that is being used to perform a number of tasks on the ship.
In order to do so, the robot needs to be given a set of instructions for each task that it needs to perform.
The robot's main function is to check the contents of containers.
Robot Instructions
In order to provide a better definition of the instructions, we use the capital letters X and Y.
X and Y can be any container.

The robot can perform the following instructions:

- move(X, Y)
Moves the contents of container X into container Y.

- isGreater(X, Y)
If the weight of container X is greater than the weight of container Y, execute the next instruction.
Otherwise skip the next instruction.

- isEqual(X, Y)
If the weight of container X is equal to the weight of container Y, execute the next instruction.
Otherwise skip the next instruction.

However, one needs to be very careful with these instructions. The move(X, Y) instruction requires container Y to be empty. If this is not the case, the robot will dump the contents of container Y into the water. Note that the instructions concern the contents of the container.

Unfortunately, the robot cannot read these types of text instructions, because it can only read machine instructions.
In order to execute the above instructions, it first needs to convert these instructions to this machine code.
This process is called compilation.
Containers
The ship contains a lot of stacked containers.

The next two questions will concern four containers: A, B, C and D that have been stacked on top of eachother.

In order to make the ship as stable as possible in heavy seas, the heaviest containers are put at the bottom of the stack, while the lightest are put at the top:

Container D

Empty

Container C

Second Lightest

Container B

Second Heaviest

Container A

Heaviest

We call this the default order.
The top container of this stack, container D, is empty.
If two containers X and Y weigh equally heavy, the order of X and Y does not matter.

Exercise
The containers have accidentally been improperly loaded.
The contents of container C weigh heavier than the contents of container B:

Container D
Empty
Container C
Second Heaviest
Container B
Second Lightest
Container A
HeaviestWrite a set of instructions for the robot that swaps the contents of container B and C.

You are allowed to use at most three instructions.
If less instructions are needed, you should fill the boxes with a dash (-).
(
,
)
(
,
)
(
,
)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:40
Which is a benefit of getting information from a government website? a. the information will be easy to understand. ob. the information will be the most current. oc. the information can be trusted.
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Hassan is writing his master’s thesis, which is a thirty-page document. he received some feedback from his professor in the form of comments, but does not see where the comments are. what is the fastest way for hassan to find the feedback?
Answers: 3
question
Computers and Technology, 22.06.2019 14:20
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
question
Computers and Technology, 23.06.2019 04:10
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
You know the right answer?
A modern ship
A large container ship is traversing the Atlantic Ocean. It needs to deliver a l...
Questions
question
Mathematics, 02.04.2020 02:32
question
Mathematics, 02.04.2020 02:32