A modern ship
A large container ship is traversing the Atlantic Ocean. It needs to deliver a l...
Computers and Technology, 25.03.2020 00:34 alkaline27
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 (-).
(
,
)
(
,
)
(
,
)
Answers: 2
Computers and Technology, 22.06.2019 03:00
Data is processed, stored, and transmitted as a series of 1s and 0s. each 1 or 0 is called a(n) . a series of eight 0s and 1s, called a(n) , represents one character—a letter, number, or punctuation mark. data becomes when it is presented in a format that people can understand and use. digital signals are represented by two different , such as +5 volts and +.2 volts. digital data can also take the form of light and dark spots etched onto the surface of a cd or the positive and negative orientation of particles on the surface of a hard disk. data consists of numbers that might be used in arithmetic operations. it can be represented digitally using the number system. data is composed of letters, symbols, and numerals that are not used in arithmetic operations. computers represent this type of data using , ebcdic, unicode, or utf-8. data is quantified using terms such as or kibibyte (1024 bytes), and prefixes such as or mebi (1,048,576), and giga or (1,073,741,824). to reduce file size and transmission times, digital data can be compressed. compression provides the means to compress data and reconstitute it into its original state. compression throws away some of the original data during the compression process. compressed files usually have at the end of the file name and are represented with special icons. these files have to be or unzipped before you can view the data they contain.
Answers: 1
Computers and Technology, 22.06.2019 17:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
Computers and Technology, 23.06.2019 02:00
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
Answers: 2
History, 08.10.2019 15:10
Mathematics, 08.10.2019 15:10
Biology, 08.10.2019 15:10
Chemistry, 08.10.2019 15:10
Mathematics, 08.10.2019 15:10
Mathematics, 08.10.2019 15:10
Biology, 08.10.2019 15:10
Chemistry, 08.10.2019 15:10
History, 08.10.2019 15:10
Mathematics, 08.10.2019 15:10
Computers and Technology, 08.10.2019 15:10