Ill post my code later.
Hints:
The growth can be found using a recursive series and the associated logic.
Will require a for loop.
Ill post my code later.
Hints:
The growth can be found using a recursive series and the associated logic.
Will require a for loop.
Jump in the discussion.
No email address required.
#include <iostream></iostream>
//only one type of std used so namespace is ok
Using namespace std;
int main(){
//intialization of variables
int factorial = 1;
int rentfreeisastrag;
// check for proper input from user
do{
cout << "Enter the order of the matrix\n**";
cin >> rentfreeisastrag;
if(cin.fail()){
cout << "Hey cute twink! Thats not an integer! Do it again" << endl;
cin.clear();
cin.ignore(100, '\n');
continue;
}
else if( rentfreeisastrag ==1){
cout << "Hey cute twink! That's a scalar.
REDO" << endl;
cin.clear();
cin.ignore(100, '\n');
continue;
}
else if( rentfreeisastrag < 1){
cout << "Hey cute twink! That doesnt exist!" << endl;
cin.clear();
cin.ignore(100, '\n');
continue;
}
}while(cin.fail() || rentfreeisastrag <= 1)
// calculation of the factorial
for( int norentfreeirl = rentfreeisastrag; norentfreeirl > 1; norentfreeirl--){
factorial = factorial*norentfreeirl;
}
// actual 2x2's needed to be computed
determinComp= factorial/2;
cout << "The 2 by 2 determinants computed is " << determinComp << endl;
if( determinComp > 60){
cout << "Good luck!" << endl;
}
return 0;
}Not the most optimized. But i hate switch statements.
Jump in the discussion.
No email address required.
More options