• +1-617-874-1011 (US)
• +44-117-230-1145 (UK)

# Computational Mathematics and Computer Architecture

Assessment Criteria – Computational Mathematics and Computer Architecture: Individual Assignment

ASSESSMENT SUMMARY

Question 1

1. Convert 1100 10012 to the following formats. Show your working clearly:

1. Decimal
2. Octal

(6 marks)

2. Evaluate the following expressions. Show your working clearly:

1. 11002 * 10112
2. 7478 + 3508
3. 0xACE + 0xCAFE

(6 marks)

3. Binary Converter Program - Write a program to accept a single binary number of up to 8 bits and display the equivalent in decimal.

(4 marks)

Question 2

1. Given the following matrices

-2 1              2              1              0              2

π΄π΄  =  (             ) , π΅π΅  = (             ) , πΆπΆ   =  (                    )

-5 -2            7              -3            4              8

Evaluate the following, showing your steps clearly.

1. A + B
2. 3 (A – B)
3. 2A * C
4. Show that A * I = A where I is the identity matrix
5. Prove that A * B is not equal to B * A

(12 marks)

2. Matrix Processing Program - Write a program to accept a 2 x 4 matrix from user input and find the following:

1. Maximum element in the 2 x 4 matrix
2. Minimum element in the 2 x 4 matrix
3. Average of all elements in 2 x 4 matrix
4. Sorted in a single array of elements

(8 marks)

Question 3

Given an expression

ππ(ππ + ππ) + (ππ + ππ. ππ)(ππ + ππ) + ππ + ππ. ππ

1. Draw the Boolean logic circuitry

(8 marks)

2. Construct the truth table for the above expression

(8 marks)

3. Simplify the Boolean expression.

(8. marks)

Question 4

Complete the following programs:

a. Driving Academy App - Write a program that ask for your age to determine the eligibility to learn theory or driving in the driving academy.

1. If your age is below 18, output is “You can only learn theory from age 18 onwards”.
2. If age is between 18 and 21, output is “You can only learn theory at this time”.
3. If the age is above 21, output is “You can learn driving provided you have passed your theory."

(6 marks)

2. Children Incentive Program - Write a program to determine the incentive from government X depending on the person’s number of children.

1. If the person has 1 child, bonus is \$100.
2. If the person has 2 children, bonus is \$300.
3. If the person has 3 or 4 children, the bonus is \$500.
4. If the person has more than 4 children, the bonus is \$1000. Print the bonus the person should receive.

Request for input again until the user chooses to quit with a negative input for the children.

(6 marks)

3. Lucky Draw Game - Write a program that randomly generates a set of 7 winning numbers ranging from 1 to 30. The user will then be asked to key in 3 numbers.

1. If all the 3 numbers are part of the winning numbers, display “Congratulations, you win!”
2. If the entries are not part of 7 winning numbers, display the “missed” numbers. For example if the user keys in 1, 2, 3 and the winning numbers contain 1, 5, 6, 7, 8, 9, 10. The message displayed will be “Sorry, you missed on numbers: 2 3”
3. If the user does not win the game, the game is restarted and a new set of random numbers is generated again.

(8 marks)

Question 5

Smart Plotter Program - Design an application that displays a menu to ask the user to choose whether to:

1. Plot a graph from inputting values for both x and y axes or to
2. Load a file to plot the graph.
3. Quit the Smart Plotter

The user can choose then proceed to plot a simple 2D line, a scatter plot or a pie chart. The program will continue displaying the menu to allow the user to choose until the user chooses to quit the application.

(20 marks)

COMPUTATIONAL MATHEMATICS & COMPUTER ARCHITECTURE