0% found this document useful (0 votes)
40 views1 page

The Same Instructions As For Assignment 1 Is Applied Here. Please Submit To Your Lecturer Anytime Between 3 To6 May 2016

The document provides instructions for Assignment 3 of the computer programming course ECE 431. It consists of 3 questions that require writing C++ programs. The first question involves using Cramer's Rule to solve a system of equations. The second requires generating random numbers, sorting them with bubble sort, and printing the original and sorted arrays. The third involves reading numbers from the user, storing them in an array, printing numbers divisible by 3 or 4 using a function, and modifying the program to pass the function by reference instead of value. Students are to submit their work between May 3rd and 6th, 2016.

Uploaded by

Azeem Aiman
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)
40 views1 page

The Same Instructions As For Assignment 1 Is Applied Here. Please Submit To Your Lecturer Anytime Between 3 To6 May 2016

The document provides instructions for Assignment 3 of the computer programming course ECE 431. It consists of 3 questions that require writing C++ programs. The first question involves using Cramer's Rule to solve a system of equations. The second requires generating random numbers, sorting them with bubble sort, and printing the original and sorted arrays. The third involves reading numbers from the user, storing them in an array, printing numbers divisible by 3 or 4 using a function, and modifying the program to pass the function by reference instead of value. Students are to submit their work between May 3rd and 6th, 2016.

Uploaded by

Azeem Aiman
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/ 1

ECE 431 Computer Programming Assignment 3

Group EE2413B, EE2413C, EE2413H, EE2422B


Instructions:
The same instructions as for Assignment 1 is applied here.
Please submit to your lecturer anytime between 3rd to 6th May 2016.

1. The easiest way to solve simultaneous equations is to use Cramers Rule. Using arrays
to store the coefficients of the equations, write a complete C++ program that uses
Cramers Rule to solve the following equations:-
7x + 5y -3z = 16
3x 5y + 2z = -8
5x + 3y -7z =0
Hint:- http://www.purplemath.com/modules/cramers.htm

2. Write a complete C++ program that generates 20 random numbers in the range of 50 to
250 and store these numbers in an array called number. Then the program sort the
numbers into ascending order using the bubble sort method and store it in an array
called sort. The array number must not be altered during the process. The program
then print both arrays side by side.
Hint:- http://mathbits.com/MathBits/CompSci/Arrays/Bubble.htm

3. Write a complete C++ program that read a maximum of 30 numbers from the user, and
store the numbers into an array called value. The program then print all the numbers
in the array that is divisible by 3 or 4. The program uses a function called divisible( )
to determine whether the number is divisible by 3 or 4. Write the program using pass
by value method when calling the function. Then modify the program by changing the
function call method to pass by reference method.
*There will be two programs for this question.

ECE 431 Mohd Uzir Kamaluddin / April 2016

You might also like