Ense504 introduction to computing assignments write a


Introduction to Computing Assignments

Assignment 1 - Pololu Robot Line Sensors

1. Administration

Requirements  - Design and implement a C++ program for the following specification. The program is to be written using the online mbed compiler for the Pololu robot.

2. Program Overview -

Requirements

  • Write a program to operate the Pololu robot so it follows a black line on the floor.
  • Use the design in the given structure diagrams.
  • The robot should stop if it goes off the line.
  • If the line is a loop, the robot should run until you stop it by turning off its power. Suitable lines will be provided (straight line, circle and ellipse).

Program Design

A program design is provided in the given structure diagrams. Write your program from these diagrams. The diagrams only show operational program statements. You also need to write include statements, function prototypes, variable and constant definitions, etc, even though these are not shown on the diagrams.

Assessment

The assessment of your program for this assignment will be based mainly on (but may not be limited to) the following points:

  • Source code compiles and links ("builds") without any errors or (significant) warnings.
  • The program runs according to the requirements.
  • Uses the design on the given structure diagrams.
  • Source code is correctly formatted (good layout).
  • Source code is appropriately commented.
  • Uses function prototypes.
  • Uses appropriate named constants and variable names.
  • Uses local variables whenever appropriate.
  • Displays appropriate information on the PC (time, line position, sensor values).
  • The display on the PC is well formatted.

The program will be tested on a straight line, a circle and an ellipse, as available in the lab.

Assignment 2 - Voltage Divider Design

1. Administration

Requirements - Write a C++ program for the following specification and structure diagarms, using Visual Studio.

2. Program Specification

Overview

You are required to design a program to calculate the best possible standard resistors to use for a voltage divider circuit to get the required circuit gain. The circuit will contain 2 to 4 resistors as in the following circuit diagram.

429_figure.png

Requirements

  • Write a program to calculate the optimum resistor values for a voltage divider circuit.
  • Use the design in the given structure diagrams.

In this assignment, you need to demonstrate that you can:

  • write your own functions and call them correctly,
  • use arrays, including passing an array as a function parameter,
  • use reference parameters.

Some aspects of the assignment specification are designed to ensure that you meet these requirements.

Program Design

A program design is provided in the given structure diagrams. Write your program from these diagrams. The diagrams only show operational program statements. You also need to write include statements, function prototypes, variable and constant definitions, etc, even though these are not shown on the diagrams.

Sustainability Requirement

It is possible to quarter the run time of the program with a simple optimisation. If R1 and R2 have different values, it does not matter which resistor has which value, because the resistors are in series. The same applies to R3 and R4. The R1 loop should step through all the resistor array values from 1.0 to 100 k inclusive, excluding the zero value. But it is only necessary for the R2 loop to step through values from R1 (inclusive) to 100k, plus the zero value. This avoids calculating the same combination twice, with the values of R1 and R2 swapped. The same applies to R3 and R4.

4. Assessment

The assessment of your program for this assignment will be based mainly on (but may not be limited to) the following points, worth one mark each.

This scheme may change slightly, depending on the programs submitted.

1. Compiles without errors or warnings

2. Layout is appropriate (indenting, etc)

3. Commented appropriately

4. Constant definitions used appropriately

5. Variable names/types are appropriate

6. Function prototypes all correct

7. Main title is displayed

8. Function calls all correct

9. Checks for valid input

10. Input uses cin.fail to check input

11. Checks for invalid gain value

12. Loops correctly

13. Calculate loops correctly

14. Looping is optimised

15. Finds the best gain correctly

16. Sustainability implemented

17. Returns results correctly

18. Output displays entered values

19. Displays results

20. Display format is correct

Additional marks will be deducted for the use of global variables, not writing the required functions and using techniques not already taught on this course.

Attachment:- Assignment Files.rar

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Ense504 introduction to computing assignments write a
Reference No:- TGS02465324

Expected delivery within 24 Hours