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, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
Answers: 3
question
Computers and Technology, 24.06.2019 20:30
Drums installed, you would apply clicks of the parking brake to obtain a slight drag on both rear wheels
Answers: 1
question
Computers and Technology, 25.06.2019 00:00
What function key is used to enable the spelling and grammar function
Answers: 1
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, 19.08.2019 19:00
question
Mathematics, 19.08.2019 19:00
question
Mathematics, 19.08.2019 19:00
question
Mathematics, 19.08.2019 19:00
Questions on the website: 13722367