Assignment 2, part 1
Using one of the following development environments:
Microsoft Visual Basic 2005/2008/2010
Microsoft Visual C++ Console Application
Netbeans C++ Console Application
Task (50% of the grade for this assignment – up to C8)
Write a program to solve a pair of simultaneous equations for 2 unknowns: x and y. Where the coefficients of x and y may be represented as a 2x2 matrix.
Where possible, efficient use should be made of appropriate programming and data structures (e.g. loops and arrays).
If a solution is not possible, an appropriate message should be displayed to the user.
Note:
Part 2 of this assignment will be held in-class on 12th May and will also contribute the remaining 50% of the grade for this assignment.
Part 2 of this assignment will be based on the identification of appropriate test data and expected results for the program submitted in Part 1
VB – A possible interface:
C++ – A possible interface:
VB – Submission:
C++ - Submission:
Zipped project folder .cpp file
Grading Criteria:
Programs should be well-structured using an appropriate interface. However, no credit will be given for unnecessary use of colours, fonts etc. in VB projects.
Programs should be well-structured using appropriate
Here is the 2D Array for C++ VB will be posted at a later date.
Code:
#include <iostream>
using namespace std;
void main()
{ /* declare variables */
int numbers[3][4];
int row, col;
/* inputs */
for (row=1; !(row>3); row++)
{ cout<<"Data for row: "<<row<<endl;
for (col=1; !(col>4); col++)
{ cout<<"Type a number: ";
cin>>numbers[row][col];
}
cout<<endl;
}
/* outputs */
for (row=1; !(row>3); row++)
{
for (col=1; !(col>4); col++)
{ cout<<numbers[row][col]<<" ";
}
cout<<"End"<<endl;
}
}