Prepare a program for finch robot to draw a shape

Assignment Help Computer Engineering
Reference no: EM132317393

This assignment is used to assess your problem-solving skills and your ability to implement a solution for a given problem In Java that would control your finch robot.

Description of the Assessment

Each member of the group will be expected to produce a program in Java for just one of the problems from the list of options provided below. Please note that each member of your group should choose a different problem. In other words, two members of a group CANNOT submit programs addressing the same problem.

Option 1: Following a Light
The purpose of this program is to make your finch robot follow a light source, such as a flashlight To make your finch robot start you should direct a light beam at the finch. This makes the finch to first turn its LED colour into light blue (your choice of shade of blue) and then to start moving towards the light making a pleasant not too loud sound as long as it is moving; we can call it 'on-the-move' sound. You should experiment with the sounds to find the sound you find suitable for this task.

The finch should stop moving if
1. The light is switched off or
2 It has encountered an obstacle.
Every time the finch stops moving It should change its colour to red and should stop making 'on-the move sound. The program should stop if the light remains switched off for longer than 5 seconds or, in the case of an obstacle, if the light beam does not move away from the obstacle within 5 seconds. However, once there are right conditions again (I.e., the light is on and/or it is no longer pointing at the obstacle) the finch will change its colour back to light blue, resume moving and making its 'on-the move sound.

The program should store the sequence of actions (including stops) executed by the robot in order to follow the light. Before the program ends, it should display the sequence of actions and the total count for the most frequent action. One can consider 5 basic actions/primitives: forward, left, right, stop (with speed, angle, time, etc. just being parameters associated to these actions). For example, if the 'executed robot sequence was:
'forward (speed1), stop 0, forward (speed2), left (anglel), right (angle2), forward (speed3),
stop 0 "
Then the most frequent action in the above example was forward.

Option 2: Drawing
The purpose of this program is to make your finch robot draw a shape. It should be able to draw rectangles and triangles. The finch should be placed on a large piece of paper on a flat surface with a pencil inserted in its tail. When the program starts the user is asked to enter a shape for the finch to draw or to quit the program using one of the following commands:
R (for a rectangle)
T (for a triangle)
Q (to stop)
If R is entered the user will be asked to enter the rectangle size determined by its width and height. The rectangle width and height should be Integer numbers (min value 30cm and max value 90cm). If the entered values are outside the range the program should inform the user about the type of the error and asked them to reenter the values.

If T is entered the user will be asked to enter the length of its three sides. The side values should be integers where no side is smaller than 30cm and no side Is longer than 90cm. If the entered values are outside the range the program should inform the user about the type of the error and ask them to re-enter the values. Once the valid values are entered the program should check whether the entered numbers could form a triangle, I.e. the sum of two shorter sides should be greater than the longest side (obviously, if all three sides are of equal length no check is necessary). Please note that before attempting to draw the triangle your program should determine triangle angles.

Once the valid values are entered the finch should start moving so that its tail draws the desired shape. When the drawing of a shape is completed the robots should stop and beep once. The program should carry on prompting the user to select a shape to draw until the user enters Q. When Q is entered the robot should beep twice, display all drawn shapes and the dimension (e.g., Triangle 35, 50, 60) in the order they were drawn and then stop all activity.

Option 3: Remote Navigation
The purpose of this program is to navigate the finch robot using commands entered from the keyboard. The finch should be able to move on a flat surface clear of any obstacles. The available navigation commands are:
F (for forward movement)
R (for right turn)
L (for left turn)
B (for backtracking the movement)
S (stop the program)

Each of the issued commands should be entered in a separate line. The format of the commands differs depending on what is controlled by the command. If an invalid command is entered the program should issue an appropriate message and ask the user to enter a valid command. When command S is issued the finch should stop.

The command F is followed by two integer values separated by a single space. The first values determine the duration of the move in seconds and the second value sets the speed of the finch. No forward movement should last more than 6 seconds. The valid speed values are from -100 (full speed backwards) to 100 (full speed forward). For example, F 4 100 should be interpreted as a command to move the finch forward for 4 seconds at the speed of 100.

Commands R and L are followed by three integer values separated by single spaces. The first value sets the duration of the move in seconds, the second value sets the speed of the right wheel, and the third value sets the speed of the left wheel. No right or left movement should last more than 6 seconds.

Your program should make appropriate checks ensuring that the input is within the valid range. You should work out the valid ranges for speed of each of the wheels for the command to have an effect on right or left turn. Assume that the right/left turn is always orthogonal to the current course. Command B is followed by an integer value that determines how many commands the finch needs to retrace. Of course, the number of backtrack moves cannot exceed the number of the move commands the finch has completed so far.

Option 4: Zigzag Path
The purpose of this program is to make your finch robot move in a regular zigzag fashion. In this problem we will assume that a zigzag path consists of lines of equal length that are orthogonal to each other. At the beginning of the program the user will be asked to enter the length of a zigzag section in centimetres and the number of zigzag sections (all sections are of the same length). For example, the zigzag in the illustration below consists of 9 sections. The length of a zigzag section should be at least 40 centimetres and no more than 70 centimetres. The number of zigzag sections should not exceed 8. Your program should check that valid values are entered and should generate appropriate error messages when this is not the case and ask the user to re-enter the values within the valid range. The finch robot should move at a constant speed of 50. To test the program you can insert a pencil in the finch tail and let the finch travel on the piece of paper. Make sure to keep the length of the zigzag short unless you have very large piece of paper.

Once the length and the number of zigzag sections are provided the finch should turn its LED colour into pink (your choice of pink shade) and start moving forwards at speed 50 until it moves for the given zigzag section length. As long it is moving it should be making a pleasant and not too loud sound (call it tunel). The finch should then briefly stop, turn orthogonally to the path travelled and start moving in the new direction for the length of zigzag line. As it is traversing the second section, its LED colour should change to light green (again, your choice of green shade) and will be producing a different sound (call it tune2). At the third section it should reverse its LED colour back to pink and the sound to tunel, used in the first section of the zigzag. In the fourth section the finch will go back to light green and tune2, and so on. Once the finch completes traversing the set number of zigzag sections it should turn and re-trace its movement until it reaches the original starting position (including the accompanying LED colour and the sound first time it traversed that section). When the finch robot reaches the initial starting position it should stop and tum off the LED light and the sound. Before program stops, it should display the length of the traversed path (start to the end position of the zigzag, but not including travelling back) and the distance travelled (air distance) from start to end of zigzag.

Option 5: Following an Object

The purpose of this program is to make your finch robot follow an object. To make your finch robot start, you should place an object in front of it and then tap the finch once encouraging it to start following the object. As long as the object does not move the finch will have its beak in red colour. Once the object starts moving the finch will turn the LED colour to green and start moving behind the object. As long as the finch is moving it should be making not too loud buzzing sound. Every time the object stops moving the finch should also stop and it should turn the LED colour from green to red and stop making the buzzing noise. Every time the object starts moving again, the finch should change the LED colour back to green and resume the buzzing noise and start following the object again. The program stops once the object stops and the finch is tapped twice. The program should store the sequence of actions (including stops) executed by the robot in order to follow the object. Before the program ends, it should display the sequence of actions and the total count for the most frequent action. One can consider 5 basic actions/primitives: forward, left, right, stop (with speed, angle, time, etc. just being parameters associated to these actions).

For example, if the 'executed' robot sequence was:
"forward (speedl), stop (), forward (speed2), left (anglel ), right (angle2), forward (speed3), stop O" then the most frequent action in the above example was forward.

Option 6: Dancing Finch
The purpose of this program is to make your finch robot perform a funny dance routine in which steps consist of only forward and backwards moves. The dance is determined by the user input. However, we will make this problem slightly more interesting by using different number systems. So your program will also need to serve as a number convertor. We will be using binary, decimal and hexadecimal number systems. See below.

When the program starts it asks the user to enter a hexadecimal number of lengths 2 (e.g., 1F). The smallest number the user should enter is 90 (decimal equivalent 144) and the largest is FF (decimal equivalent 255). The program then converts this hexadecimal number into the decimal and the binary equivalents. For example, if the user enters Al the decimal equivalent is 161 and the binary equivalent is 10100001. Once the conversion is complete these numbers will be used for directing the dance. The speed of the finch will be determined by the decimal equivalent of the given number and the finch moves by the binary equivalent of the hexadecimal number. The speed of the finch robot will be set to the remainder of the division of the decimal number with 80. However, if the remainder is smaller than 40 then the speed should be set to reminder + 30. Before it starts moving the program should display the hexadecimal value given, the decimal and the binary equivalents and the speed at which the finch robot will be moving (e.g., Al, 161, 10100001, speed = 31) . The finch LED colour should be set to the colour of your choice and once it starts moving the finch should produce a pleasant noise. The moving will be as follows: reading the binary number equivalent from right to left one digit at a time the finch will move forward for 6 seconds when the digit is equal to 1 and backwards for 5 seconds when the digit is equal to zero. When the string of digits ends and the finch completes its last move it should switch off the noise and the LED light.

Note: Error checks and appropriate exception handling should be put in place to ensure that the entered number represented as a string of digits and characters is a valid for the hexadecimal system and is within the valid range. Invalid input should be rejected and the program should display appropriate error messages if this is the case and ask the user for new input.

Learning Outcomes

In order to get a pass grade (D- or above) in NC1600, you must meet the learning outcomes below, that is, you must demonstrate ability to:
L1: Plan, manage and track a non-trivial activity.
L4: Create and use technical documentation.
L5: Produce a working computer program as a solution to a given non-trivial problem.
L6: Develop skills in the use of high-level object-oriented languages.

Reference no: EM132317393

Questions Cloud

Prepare a pitch that presents a compelling business case : Prepare a pitch that presents a compelling business case to secure financial backing - This facilitates an appreciation of what potential investors
Compute the equation of the regression line : Victorian Institute of Technology - MITS6002 Business Analytics. Compute the equation of the regression line. Draw a scatterplot based on data
Does segment m meet operating segment level revenue test : Does Segment "M" meet the operating-segment-level Revenue Test? To receive any credit, you must answer "yes" or no in the box?
What are the implications if you dont tell the president : What are the implications if you do tell the President of your error immediately? Who are the stakeholders in this situation?
Prepare a program for finch robot to draw a shape : Robot Coding - NC1600 - This assignment is used to assess your problem-solving skills and your ability to implement a solution for a given problem In Java
What is the correct make-or-buy decision : If Sunland's Manufacturing Company can purchase the component externally for $200000 and only $2000 of the fixed costs can be avoided.
Develop an electronic work portfolio for yourself : ISY10209 Web Development Assignment - Develop an electronic Web portfolio, using a plain text editor (Notepad++), Southern Cross University, Australia
How many units should sheridan produce during june : The company keeps 15% of the next month's sales as ending inventory. How many units should Sheridan produce during June?
Calculate this companys gross profit : A company reported the following information for the month of July-Sales $50,475. Calculate this company's gross profit.

Reviews

len2317393

6/6/2019 2:01:22 AM

The program runs and has all required functionality and mostly works as specified in the Assignment 3 Brief (perhaps some very small imperfections). Code is of an excellent quality in terms of structure and layout, the efficiency of the algorithm, documentation, the elegance of the solution, use of naming conventions, and, where appropriate, error handling and user interface. An excellent use of object-oriented features such as classes and methods. The program has an appropriate number of classes and at least two methods (excluding the main method). A very good attempt at class definitions that capture the main characteristics of objects. The methods make an appropriate use of input parameters and, when appropriate, return values. The report fully complies with the requirements and is of excellent quality in terms of coherence, clarity, presentation standards, structure and standard of English. The flowchart/ pseudo-code is of excellent quality and a true representation of the Robot code. There is a good explanation how the program was tested so that errors and failures of the program to handle unanticipated data are identified and fixed.

len2317393

6/6/2019 2:01:08 AM

Grade Grade Descriptors The program runs and has all required functionality and works as specified In the Assignment 3 Brief. Code is of an outstanding quality in terms of structure and layout, the efficiency of the algorithm, documentation, the elegance of the solution, use of naming conventions, and, where appropriate, error handling and user interface. An outstanding use of object-oriented features such as classes and methods. The program has an appropriate number of classes and at least two methods (excluding the main method). Class definitions that capture the main characteristics of objects are appropriate and well thought through. The methods make an appropriate use of input parameters and, when appropriate, return values. The report fully complies with the requirements and is of exceptional quality in terms of coherence, clarity, presentation standards, structure and standard of English. The flowchart/ pseudo-code is of outstanding quality and a true representation of the

len2317393

6/6/2019 2:00:54 AM

Please note that this piece of work should be YOUR WORK and your work only. You should not use or copy anyone else's code. If you do not manage to complete all of the required functionality, then you should state that in your documentation. Marking will cover the following aspects of your coursework submission: 1. Java Implementation (80%) a. The program has all the required functionalities and everything works as specified b. Code quality (efficiency, appropriate structures, error handling, and documentation) c. Appropriate use of object oriented features — use of classes, methods, and objects d. Appropriate use of methods (at least two methods excluding the main method) e. User interface quality 2. Report (20%) a. Compliance to the requirements b. Flowchart or pseudo-code I. Algorithm correctness, completeness and clarity ii. Use of standard flowchart shapes OR consistent use of appropriate pseudo-code statements iii. Decision points logic iv. Presentation

len2317393

6/6/2019 2:00:45 AM

Marking Criteria You are expected to produce a program in Java for just one of the problems from the list of options listed in Description of the Assessment section. Your grade will very much depend on how good the implementation of your algorithm in Java is. That means that you should demonstrate using the appropriate constructs/concepts of object-oriented programming. You are expected to define an appropriate number of classes and create objects from these classes. Your program should have at least two methods, in addition to the main method, that implement the behaviour of objects, i.e. carry out tasks on objects. When creating a method you should consider whether it is appropriate to use input parameters and whether the method would return a value.

len2317393

6/6/2019 2:00:12 AM

2. The pseudo-code OR flowchart for the problem of your choice, but not both. 3. Your source code (included as text in the report). 4. A simple explanation on how you conducted the testing your program (input data you have used to test whether your program delivers expected outputs, results, or finch behaviour), any errors you have identified during the testing and whether you fixed them. 5. A short statement (maximum 250 words) providing a list of the functionalities that your program does NOT cover. In other words, you should specify parts of the specification that you were not able to implement, if any.

len2317393

6/6/2019 2:00:01 AM

You must submit a single zip file consisting of TWO files (JAVA file of your Finch Robot program and your Report which should be either a pdf or an MS Word document file). Your submission must be uploaded via Moodie by 23:55GMT, Friday 27th July 2018 as a single zip file. Your student ID number must be used for the file name (e.g. 0123456.zip). Your Report should not exceed 10 pages and should contain the following. 1. A cover sheet which includes your name (name followed by surname) and your student id followed by the name of your project group and your tutor's name. This is compulsory. Number the pages of your report and also include your name and ID in the footer of each page

len2317393

6/6/2019 1:59:27 AM

Assignment 3 is associated with the NC1600 Level 1 Group Project. It Is one of the two coursework assignments set In the NC1600 assessment block. Assignment 3 is summative assessment (used to evaluate student learning) and contributes 50% to the grade in NC1600. This assignment is used to assess your problem-solving skills and your ability to implement a solution for a given problem In Java that would control your finch robot. Even though this assignment is assessed individually you may still discuss your work with the other members in your L1 project group. The assessment will be done during a whole day event called Robot Olympics during which you will be asked to demonstrate your Java finch program that will take place in week 11.

Write a Review

Computer Engineering Questions & Answers

  What is the average mips rate of the program

If the clock period is 0.2 its, calculate the average CPI for the program. What is the average MIPS rate of the program?

  Plot a graph where the horizontal axis presents the number

Plot a graph where the horizontal axis presents the number m, and the vertical axis presents the number of iterations it takes to end up with 1.

  Design and demonstrate the finite state machine

Cpr E 281 FINAL PROJECT - Design and demonstrate the finite state machine for the control circuit. Show that it produces the correct output

  Find the probability that a given user is transmitting

Find the probability that a given user is transmitting. Suppose now there are three users.

  Questionwalk through of how to compute any of these would

questionwalk through of how to compute any of these would be greatly appreciated.a what is dft of a pure cosine wave

  Which pairs of statements are equivalent

Which of the following is a proper use of naming convention for a control? Which of the following pairs of statements are equivalent?

  What happens with increasing amounts of random noise

What is returned when the new column is perfectly correlated with the original? What happens with increasing amounts of random noise?

  How would this open technology benefit

The XML related technologies are growing rapidly, and it seems a definite commitment to the XML standard from many large corporations, still XML is an open standard, and promotes a culture of open source and sharing. Discuss this in relation to the..

  Calculate statistical information on list of integer number

Return the double average and standard deviation via call by reference parameters. The function itself does not return anything.

  Demonstrate the functionality of all elements of assignment

Demonstrate the functionality of all elements of this assignment. As you go, take instructional notes and screen shots that will help to reproduce your process.

  Prompt the user to see if they want to do more calculations

Prompt the user to see if they want to do more calculations. Allow the user to do more calculations until they enter either an ‘N'or an ‘n' for no.

  What are the samples runtime dependencies

CTEC5807 Malware Analysis - De montfort university - Perform a basic static analysis of the sample and document your findings. Is it packed

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd