EE1PSC Coursework 22 23

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

EE1PSC 2022/23

Coursework

due on Monday 6th February 2023 at 12pm (noon)

Introduction

This coursework problem set is to assess you on the skills of writing and debugging small

program; ability to take a description of a problem and map it into something computational;

and demonstrate an understanding of the basics of programming and the concepts central

to computation and computational problem-solving techniques.

This coursework is worth 60% of the final mark, but it will be followed by a short interview

after it has been marked. To pass the coursework, you must pass the interview.

You will have to design and write Python programs, test them, and submit them on

Blackboard. Be sure to read this problem thoroughly, especially the sections of Collaboration

and the Submission Procedure.

Collaboration

You may work with other students to assist in learning. However, each student must develop

and submit their assignment separately. For further detail, please review the collaboration

policy as stated on Blackboard.

Submission Procedure

1. Save your codes in the files names as specified in the problems’ description (e.g.

Voting.py, Rhombus.py …).

2. Submit a single zip file with all programs. Name of zip file should contain your

name and student number, e.g. ‘212356267_Smith.zip’ (2 marks will be

automatically deducted for not following the submission procedure)

Grading criteria:

The marking criteria and % of maximum mark that can be awarded are as follows.

Criteria /5

Fully Correct Solution implemented idiomatically (efficiently and easy


5

to read with lots of comments)

Fully Correct Solution implemented non-idiomatically 4

Main features working (e.g. functions implemented as required, but


3

with some minor errors)

Some features working (e.g. some correctly implemented pieces of

2
code but the whole task has major errors)

Syntactically correct with a major logic error (the implementation

1
algorithm is wrong)

Both syntactically and logically incorrect (nothing works). 0

Make sure your programs are well designed with plenty of comments. (2 marks will be

deducted if no comments provided)

Tasks

Task 1. Circuit. [10 marks] For a given circuit, the base current IB

is related to the base-emitter voltage VBE by the equation

where IB is a characteristic of the transistor and m is a constant,

dependent on the operating temperature. The results of the

Proteus simulations are presented in the file ‘IB_VBE.txt’.

 Implement a program to plot graphs of IB versus VBE in both linear and

logarithmic scale (ln(IB) versus VBE). You will need to read data from the file as

part of your implemented code. Don’t forget to add labels to the axes.

[5 marks]

 Find and display the corresponding values of m and IBS rounded to 2 d.p.

(Hint: you can use the formula from EE1EMA tutorial question for week 3).

[5 marks]

Task 2. Voting [10 marks]. A board of directors consists of three members, each of

which has a two-way switch marked ‘yes’/’no’. When votes are taken, a lamp comes

on if the ‘yes’ votes are in the majority. The circuit that implements the turning on of

the lamp is represented by the boolean function

L = a & (b | c) | b & c

Write a program, which writes to a file (‘Voting.txt’), a

table of all alternate yes/no values for a, b and c.

Following this, write a function that calculates the value

of L, also as a boolean value.

Possible outcome (‘Voting.txt‘ file) looks like:

Task 3. CarNumberPlate [15 marks].

“The current number plate system in Great Britain has been around since September

2001.i Current British number plates are arranged in the

format of two letters, followed by two numbers, followed by

a space and then three letters (eg – XX22 XXX) as shown

here.

The two numbers are called the ‘age identifier’, which tells

you in which year’s six-month period (spring or autumn) the car was first registered.

The spring codes are easy to remember as they follow the year of registration (e.g

registered in spring 2022 will correspond to 22, in spring 2005 will correspond to 05).

For cars registered in autumn, the numeric code equals the year plus 50. (e.g. a car

registered in autumn 2021 has the number 71 = (21+50)).”

https://www.thecarexpert.co.uk/how-does-the-uk-number-plate-system-work/

EE1PSC 2022/23

Write a program that

 Asks the user to enter a car number plate

 Performs an initial number plate check by implementing and calling a function

check_plate that returns False if any of the following isn’t true: the number

contains two first letters followed by two digits, a space character and by three

letters in the end. Otherwise, it returns True. [5 marks]

(Hint: you might use string methods isdigit()and isnumeric()).

 If the number plate fails the initial check, an error message is displayed (as

below). Otherwise, the program finds out and displays the season and the

year the car was manufactured/registered (for the cars with the age identifier

number between 02 and 72 inclusive). [10 marks]

Possible outcome of the tested program looks like this:

Task 4. Rhombus [5 marks] Write a program that asks the user to provide an

integer number and then displays a rhombus made of numbers starting from 1 like in

examples below:

You might also like