EEEE1040: 2023/24 – Resit Coursework 1


Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due


EEEE1040: 2023/24 – Resit Coursework 1

This document contains both

· An overview of the task

· A suggested template for the written exercise

Submission:

To be uploaded to Moodle by 3pm on Wednesday 16th October 2024. Please submit as a ‘zip’ archive if uploading multiple files (e.g. if your flowcharts and/or testing data are outside the main document).

Note: You must NOT submit work as links to your OneDrive etc.

If using non-Microsoft applications (e.g. if using https://app.diagrams.net for the flowcharts) please upload PDF versions of such documents – files in any other format (e.g. ‘.drawio’) will not be marked.

1. Overview of task

This task is designed to show you how to produce the material required for the successful development of a small piece of software (the coding of which may be done by a third party). You will NOT (for this assignment) be writing code.

As such, instructions (both written and associated diagrams such as flowcharts) need to be unambiguous. In addition, sufficient test data must be supplied to allow the code to be tested at function level (the individual parts) and at system level.

When designing (and writing) code you should remember a few key points –which you must consider even though code is not be developed for this assignment.

· The code should be written using ‘best practice’ e.g.

o Remembering to use comments

o Good indenting

o Sensible variable/function names 

· Where input is required from the user you should validate this to ensure it is ‘fit for purpose’ e.g.

o If the user is required to enter a length/resistance check it is ≥ zero

o If a range is specified, ensure the value entered is within this. 

· Error checking should be used e.g.

o If a file is required to be opened, was this successful? If not – what should be done?

o If memory is to be allocated dynamically, was this successful? – what happens if not?

2. The Task

Consider the op-amp circuit as shown in Figure 1

Figure 1: Op-amp circuit

 

The gain of the circuit is given by 

Av  = 1 + ( R2 /R1 )

2.1 Requirements (to be reflected in your flowchart & other material)

Documentation (primarily a flowchart & test data) are to be created to ensure the tasks listed below are performed.  Note that in some cases you will need to specify the exact message to be displayed (e.g. for an invalid input) which should then be validated through test cases.

(a) The application should prompt the user to enter values for R1 and R2 using variables of an appropriate type 

It is a requirement of the application that invalid input values for R1 and R2 are rejected.

In the case of invalid input(s), the user is to be prompted until such time as valid inputs have been provided.

(b) It is a specific requirement of the application that gain is calculated using a function external to main(). The value calculated is to be displayed in main() to a precision of two decimal places.

Hint: For this, draw a ‘mini’ flowchart alongside your ‘main’ flowchart – this smaller flowchart takes the input value, does the calculation and passes the result back to the ‘main’ flowchart (we will have discussed this in the lecture – see also note below).

(c) Once the calculation has completed the user should be prompted to repeat the task with ‘Y’ or ‘N’ (without the quote marks) being the only accepted response.

In the case of an invalid input, the user should be prompted until such time as Y or N is the response.

Based on the response the program should repeat from (a) or terminate.

You may wish to use sub processes (mini flowcharts) for the functions – these indeed would be ideal as part of a larger project as then individual developers/programmes could work on these – bringing the parts together to form the finished application.

3. Suggested Template for the coursework

Analysis

A very short explanation of the work the flow chart & data presents (this need be only a few sentences, there is no need to repeat in full the information provided for the assessment).

Flow Chart(s)

You are required to provide a flow chart (using mini flowchart, where appropriate for sub processes) from which the programmer could develop the code.

There must be one start, it is your choice to have a single ‘stop’ or multiple (whichever you think makes the diagram easier to follow).

For the function, you can use a box for ‘parameters received’ which is how the various values a passed in – for the values returned it is sufficient that in your flowchart the relevant variable is shown as being assigned the relevant value.

Coding

No coding is required for this exercise.

Testing

Testing data should be provided that ‘tests’ each path through the code – with both ‘pass’ and ‘fail’ cases. You should be careful to provide enough examples to fully validate each case – consider too what ‘odd’ types of input a user might give!

You may find it easier to put the testing data in to a separate excel spreadsheet – indeed, this makes it very easy to create the test data for the calculations as you can use excel to generate these based on values in cells (hint: create a line that has cells for the various inputs and one that contains the calculated value – you can then copy this row many times & change the ‘input values’ and Excell will do the calculations for you.

Maintenance

Here you should provide details of when code might need to be modified and what steps would then need to be followed; consider too other cases where revalidation of the developed application might be needed.

Marking

Marking of the work will be based on the rubric provided.

发表评论

电子邮件地址不会被公开。 必填项已用*标注