Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prepare a design for the Baby Block Robot. The design should be in flow diagram form. This diagram should help you identify the sequence of

Prepare a design for the Baby Block Robot. The design should be in flow diagram form. This diagram should help you identify the sequence of steps needed to solve specific situations that the robot will encounter. Be specific. Break down the actions into small steps. Test you design by using example block sequences. Think it through. I would expect the diagram to require multiple pages. If you have a program that supports flow diagrams, like PowerPoint, then use that. Hand drawn diagrams are acceptable - make sure that they are neat and are easy to read. You can take a picture of them and paste into a Word (or other ) doc to upload.

The baby block program instructions are:

Thank you for your purchase of the Baby Block 270 Robot (BB270). In order to use the BB270 you must write a program using the basic robot operations stated below:

  1. get_block Removes and holds one block from the chute. The user must type in each block by hand. (There are six functions that can be used to test the robot described below.)
  2. put_block Inserts the block currently held by the robot into an empty slot.
  3. remove_block Removes a block from a given slot. The slot is then set to a space.
  4. switch_blocks Removes a block currently in a slot and replaces it with the block being held by the robot. When finished the robot is holding the block it just removed from the slot.
  5. robot_ltoreq_slot Compares the value of the block (letter) being held by the robot to that of a block in a slot. (If the block held by the robot is less than or equal to the block in the slot the result of the compare is TRUE. If the block held by the robot is greater than the block in the slot the result of the compare is FALSE)
  6. shift_left Shift the robotic arm one slot to the left. (Cannot go to the left of slot 1)
  7. shift_right Shift the robotic arm one slot to the right. (Cannot go to the right of slot 20)
  8. test_empty Determines if a slot is empty. The array of slots must be initialize to all spaces or to NULL. (Returns True if empty or False if the slot contains a block.)
  9. print_slots Prints the contents of the 20 slots to the screen. You need to submit the output from each of the five test cases when you are finished. Print the slots after each block is placed.

Included with the robot are functions for each of the above operations coded in the C++ Programming Language. The code may be downloaded from the assignments tab in Canvas.

To test your robot write a program that will place a series of blocks into 20 slots in alphabetic order. Specifically the robot must be able to accomplish this task according to the following requirements:

  1. To begin with all slots must be empty: Set the array of slots to all blanks or to all NULL
  2. The robot must be able to start at any of the 20 slots. (Specified at program start.)
  3. Blocks will enter the chute in random order.
  4. Blocks entering the chute will have a value from A through Z . (Uppercase alphabetic characters.)
  5. Blocks may repeat. (e.g. there may be two or more blocks with the same letter value.)
  6. The robot can take only one block from the chute at a time.
  7. The robot can switch the block it is holding with a block in a given slot.
  8. The robot can only shift (left or right) one slot at a time. (If you want to shift more than one position you will need to use a loop.)
  9. As blocks are placed into the slots they must be in alphabetic order. (You are not allowed to randomly place all the blocks and then sort them.)
  10. The robot cannot go to the left of slot 1 or to the right of slot 20. (This means that you will have to allow for movement of multiple blocks to the left or right in order to stay within the 20 slots.)
  11. You must use the functions provided. However, if you have a better implementation for any of the functions then you may use yours after approval from the instructor.
  12. You may ( and you will need to ) write additional functions which are composed of calls to the provided functions. For example, to shuffle multiple blocks left or right to open a slot for a new block.

Failure to comply with the above requirements will result in a 10% deduction for each requirement that is not met.

The Robot Challenge: Your robot will be judged by the fewest number of swapped blocks. To keep up with that number you will need to maintain a count of the number of times the Switch Blocks function is called.

Robot Test Cases

There are five test cases that your robot must pass. They are:

TEST CASE 1: "AXFIUTRPQVWSEYJINYTB"

TEST CASE 2: "ABFGHIJKMOPRSTUVWXYZ"

TEST CASE 3: "ZYXWVUTSRPOKJIIHGFBA"

TEST CASE 4: "AAAAAYYYYYQQQQQXXXXX"

TEST CASE 5: "XXXAAAZZZAAYYVVVVQQQ"

Six functions are provided to assist you with these test cases. By using these functions you do not have to enter each block one at time as required by the get_block function. There is one function for each individual test case plus another that can be used for any of the five individual test cases. All six functions return one block at a time.

Your output should show the configuration of the blocks in the slots after each block is placed. You may call the print_slots function to generate that output. You will also need to print out the number of times the robot switched blocks. (Number of times the switch_blocks function is called.

I really only need help with the design document.

Thank you!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago