0% found this document useful (0 votes)
118 views7 pages

KT 14503 Mathematics For Computing Group Assignment 20 Marks

Group Project 2021 Mathematics Group Project 2021 Mathematics Group Project 2021 Mathematics Group Project 2021 Mathematics Group Project 2021 Mathematics

Uploaded by

Annie Leonhart
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views7 pages

KT 14503 Mathematics For Computing Group Assignment 20 Marks

Group Project 2021 Mathematics Group Project 2021 Mathematics Group Project 2021 Mathematics Group Project 2021 Mathematics Group Project 2021 Mathematics

Uploaded by

Annie Leonhart
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

KT 14503 Mathematics for Computing

Group Assignment
20 Marks

This group project will test your application skills involving the general topics in this course
(Differentiation, Integration and Linear Algebra)
The project will be divided into 2 parts

Part Topic Marks allocation


1 Differentiation & Integration 10
2 Linear Algebra 10

Total 20

Form a group consisting of 5 – 6 members.


Submission dateline of this assignment is by Week 13 (Friday).
You will present your project on Week 14.
Submit your compiled answers into a report in PDF form which should be uploaded to
Smartv3.
Include in your report:
- Names, Matrix numbers and tasks allocation of your group members
- Code printout and screenshots of test cases for possible scenario.
Part 1: Application of Differentiation and Integration (10 Marks)
You are required to develop a piece of C++ program to perform the Differentiation and
Integration of a polynomial equation with 2 expressions.

For Example : 4𝑡 2 − 𝑡

Using the application on Motion as basis, your program should be able to calculate the
Displacement, Velocity and Acceleration as requested by users based on the value of t supplied.

Equation: 4𝑡 2 − 𝑡 If Find Displacement (Integration):


4𝑡 3 𝑡 2
If Type of equation: Velocity 𝐷 (𝑡) = −
3 2
9 63
𝐷(3) = 36 − =
Coefficient of expression 1: 4 2 2
Power of expression 1: 2
Coefficient of expression 2: -1 If Find Velocity:
Power of expression 2: 1 𝑉(𝑡) = 4𝑡 2 − 𝑡
𝑉(3) = 108 − 3 = 105
Value of t = 3
If Find Acceleration:
𝐴(𝑡) = 8𝑡 − 1
𝐴(𝑡) = 24 − 1 = 23

As a general guideline,

1. You ask your users for the equation and type of equation (Displacement, Velocity or
Acceleration).
2. Ask your users for the value of t
3. Ask your users what they want to find: Displacement, Velocity or Acceleration
4. If user just want to know the value of the type of equation they input, then just calculate
based on t.
If they want to know value of other operations, then you need to perform differentiation or
integration based on the value of t.
For example:
User input displacement equation.
If they want to find displacement, then just calculate based on t.
If they want to find Velocity you need to perform differentiation on t then calculate t.

Appendix 1 : Sample algorithm to guide your program

Ask user for the type of equation


1 Displacement
2 Velocity
3 Acceleration
Accept user input
Prompt user for input expression
Coefficient t_1:
Power t_1:

Coefficient t_2:
Power t_2:

Prompt user for the value of t


t:

Prompt user for the choice of operation


1 Displacement
2 Velocity
3 Acceleration
Accept user input

if(choice == Displacement)
{
if(type_of_equation == displacement)
calculate t;

else if (type_of_equation == velocity)


integrate and calculate t;

else if (type_of_equation == acceleration)


integrate twice and calculate t;

else if (choice == Velocity)


{
if(type_of_equation == displacement)
integrate and calculate t;

else if (type_of_equation == velocity)


calculate t;

else if (type_of_equation == acceleration)


differentiate and calculate t;

else if (choice==Acceleration)
{
if(type_of_equation == displacement)
integrate twice and calculate t;

else if (type_of_equation == velocity)


integrate and calculate t;

else if (type_of_equation == acceleration)


calculate t;

}
Sample Output for Part 1

𝑉(𝑡) = 4𝑡 2 − 𝑡 𝐷(𝑡) = 4𝑡 2 − 𝑡

4𝑡 3 𝑡 2 𝑉(𝑡) = 8𝑡 − 1
𝐷 (𝑡) = − 𝐴(𝑡) = 8
3 2
9 63 𝐴(3) = 8
𝐷(3) = 36 − =
2 2
Part 2 Application of Linear Algebra (10 Marks)
You are required to develop a piece of C++ program to perform the Matrix algebra as stated
below:

1. Addition & Subtraction


2. Multiplication

You program should prompt user to select the Matrix algebra they wish to perform and input the
corresponding Matrices to calculate.

As a general guideline,

1. You should use a double array to represent the Matrix if possible, if you are not using array
make sure to display results as Matrix.
2. Check the conditions before performing the algebra, especially matrix dimension
compatibility.
3. You need to show test cases that demonstrate your program works to perform the algebra
and also capture any exceptions.
4. You can limit the size of the matrix to maximum 5x5 dimension

For some example of test cases, use your program to solve some real-life problems involving
matrix algebra as shown below:

Case

Given the individual assessment results of 3 students and the allocation percentage of each
assessment for the course, calculate the total marks of each students for the course.

Student Quiz Assignment Project Exam


A 80 89 100 92
B 75 80 85 72
C 92 85 78 88

Assessment Allocation Percentage


Quiz 10 %
Assignment 10 %
Project 20 %
Exam 60 %
Appendix 1 : Sample algorithm to guide your program

Prompt user for the choice of matrix algebra


1 for Addition and Subtraction
2 for Multiplication
Accept user input

if(choice == 1)
{
Ask user to input Matrix A; Display Matrix A;
Ask user to input Matrix B; Display Matrix B;
Check whether both matrices are compatible in dimension;

if (compatible)
Ask user to choose whether to perform addition or subtraction;
Perform Addition or subtraction based on user choice;
Display Results;
}

else if (choice ==2)


{
Ask user to input Matrix A; Display Matrix A;
Ask user to input Matrix B; Display Matrix B;
Check whether both matrices are compatible in dimension;

if (compatible)
Perform multiplication;
Display Results;
}
Appendix 2: Sample Printout of Program Output/ Test Case

Success case Error case

You might also like