Ideas Solution 2:
#include<iostream> #include<fstream> #include<stdio.h> using namespace std; class Employee{ private: int code; char name[20]; float salary; public: void read(); void display(); int getEmpCode() { return code;} int getSalary() { return salary;} void updateSalary(float s) { salary=s;} }; void Employee::read(){ cout<<"Enter employee code: "; cin>>code; cout<<"Enter name: "; cin.ignore(1); cin.getline(name,20); cout<<"Enter salary: "; cin>>salary; } void Employee::display() { cout<<code<<" "<<name<<"\t"<<salary<<endl; } fstream file; void deleteExistingFile(){ remove("EMPLOYEE.DAT"); } void appendToFille(){ Employee x; x.read(); file.open("EMPLOYEE.DAT",ios::binaryios::app); if(!file){ cout<<"ERROR IN CREATING FILE\n"; return; } file.write((char*)&x,sizeof(x)); file.close(); cout<<"Record added sucessfully.\n"; } void displayAll(){ Employee x; file.open("EMPLOYEE.DAT",ios::binaryios::in); if(!file){ cout<<"ERROR IN OPENING FILE \n"; return; } while(file){ if(file.read((char*)&x,sizeof(x))) if(x.getSalary()>=10000 && x.getSalary()<=20000) x.display(); } file.close(); } void searchForRecord(){ Employee x; int c; int isFound=0; cout<<"Enter employee code: "; cin>>c; file.open("EMPLOYEE.DAT",ios::binaryios::in); if(!file){ cout<<"ERROR IN OPENING FILE \n"; return; } while(file){ if(file.read((char*)&x,sizeof(x))){ if(x.getEmpCode()==c){ cout<<"RECORD FOUND\n"; x.display(); isFound=1; break; } } } if(isFound==0){ cout<<"Record not found!!!\n"; } file.close(); } void increaseSalary(){ Employee x; int c; int isFound=0; float sal; cout<<"enter employee code \n"; cin>>c; file.open("EMPLOYEE.DAT",ios::binaryios::in); if(!file){ cout<<"ERROR IN OPENING FILE \n"; return; } while(file){ if(file.read((char*)&x,sizeof(x))){ if(x.getEmpCode()==c){ cout<<"Salary hike? "; cin>>sal; x.updateSalary(x.getSalary()+sal); isFound=1; break; } } } if(isFound==0){ cout<<"Record not found!!!\n"; } file.close(); cout<<"Salary updated successfully."<<endl; } void insertRecord(){ Employee x; Employee newEmp; newEmp.read(); fstream fin; file.open("EMPLOYEE.DAT",ios::binaryios::in); fin.open("TEMP.DAT",ios::binaryios::out); if(!file){ cout<<"Error in opening EMPLOYEE.DAT file!!!\n"; return; } if(!fin){ cout<<"Error in opening TEMP.DAT file!!!\n"; return; } while(file){ if(file.read((char*)&x,sizeof(x))){ if(x.getEmpCode()>newEmp.getEmpCode()){ fin.write((char*)&newEmp, sizeof(newEmp)); } fin.write((char*)&x, sizeof(x)); } } fin.close(); file.close(); rename("TEMP.DAT","EMPLOYEE.DAT"); remove("TEMP.DAT"); cout<<"Record inserted successfully."<<endl; } int main() { char ch; deleteExistingFile(); do{ int n; cout<<"ENTER CHOICE\n"<<"1.ADD AN EMPLOYEE\n"<<"2.DISPLAY\n"<<"3.SEARCH\n"<<"4.INCREASE SALARY\n"<<"5.INSERT RECORD\n"; cout<<"Make a choice: "; cin>>n; switch(n){ case 1: appendToFille(); break; case 2 : displayAll(); break; case 3: searchForRecord(); break; case 4: increaseSalary(); break; case 5: insertRecord(); break; default : cout<<"Invalid Choice\n"; } cout<<"Do you want to continue ? : "; cin>>ch; }while(ch=='Y'ch=='y'); return 0; }MTH603 Quiz 1 Solution and Discussion

@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
The first row of the augmented matrix of the system of linear equations is: 2x+z=4 xy+z=3 y+z=5

The first row of the augmented matrix of the system of linear equations is: 2x+z=4 xy+z=3 y+z=5


@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
If there are three equations in two variables, then which of the following is true?
Dependent Systems of Equations with Three Variables
We know from working with systems of equations in two variables that a dependent system of equations has an infinite number of solutions. The same is true for dependent systems of equations in three variables. An infinite number of solutions can result from several situations. The three planes could be the same, so that a solution to one equation will be the solution to the other two equations. All three equations could be different but they intersect on a line, which has infinite solutions (see below for a graphical representation). Or two of the equations could be the same and intersect the third on a line (see the example problem for a graphical representation).
read more

@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
If there are three equations in two variables, then which of the following is true?
A system of equations in three variables involves two or more equations, each of … Plug in these values to each of the equations to see that the solution satisfies all … when graphing each equation in the system and then finding the intersection point of … A three dimensional box with three slanted planes crossing through it.
Explanation:
The simple answer is yes.If you have two consistent equations and they are linearly independent, then you will have to assign arbitrary values to one of the variables. If you have two consistent equations and they are linearly dependent, then you will have to assign arbitrary values to two of the variables, both cases lead to an infinite number of solutions. If they inconsistent, then obviously there is no solution.
Graphically two consistent linearly independent equations will form 2 planes in
R
3
that intersect and all solutions will lie on the line of intersection leading to an infinite number of solutions.Two consistent linearly dependent equations will just be a single line in
R
3
and all solutions will lie on this line, leading to an infinite number of solutions.If the two equations are inconsistent then you will have 2 parallel lines in
R
3
, and no point of intersection, hence no solutions. 
@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
If there are three equations in two variables, then which of the following is true?
A system of equations in three variables involves two or more equations, each of … Plug in these values to each of the equations to see that the solution satisfies all … when graphing each equation in the system and then finding the intersection point of … A three dimensional box with three slanted planes crossing through it.

If there are three equations in two variables, then which of the following is true?

@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
The statement, 7265 instead of 7269 lies in the category of:
With regard to the dangers from lead opinion , if you removed the loose paint off the hands poisoning , it is pretty hard on … Do you not think your statement is rather a 7269. … That 7265. Of course they will not need soap if they can is where sand  papering comes in . rub the paint off dry from their hands P  I said you 7293.

The statement, 7265 instead of 7269 lies in the category of:

@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
Gaussian elimination and ……………methods.
In mathematics, Gaussian elimination, also known as row reduction, is an algorithm for solving systems of linear equations. It consists of a sequence of operations performed on the corresponding matrix of coefficients.

Gaussian elimination and ……………methods.

@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
Which of the following method is not an iterative method?
 Which of the following is not an iterative method?
Explanation: Jacobi’s method, Gauss Seidal method and Relaxation method are the iterative methods and Gauss Jordan method is not as it does not involves repetition of a particular set of steps followed by some sequence which is known as iteration.
 Which of the following is not an iterative method?

Which of the following method is not an iterative method?

The 3rd row of the augmented matrix of the system of linear equations is: 2x+z=4 xy+z=3 y+z=5

@zaasmi said in MTH603 Quiz 1 Solution and Discussion:
The number system that is used in our daily life is called…system.
The number system that we use in our daytoday life is the decimal number system. Decimal number system has base 10 as it uses 10 digits from 0 to 9.

The number system that is used in our daily life is called…system.