Ideas Solution Code
#include <iostream> #include <time.h> #include <stdlib.h> using namespace std; const int rows = 10; const int cols = 10; int selectOption(){ int choice = 0; cout<<"Press 1 to populate a two-dimensional array with integers from 1 to 100\n"; cout<<"Press 2 to display the array elements\n"; cout<<"Press 3 to display the largest element present in the array along with its row and column index\n"; cout<<"Press 4 to find and show the transpose of the array\n"; cout<<"Press 5 To Exit\n"; cout<<"\nPlease select an option, use numbers from 1 to 5: "; do { cin>>choice; if(choice >= 1 && choice <= 5){ break; } else { cout<<"\nChoice should be between 1 and 5\n"; cout<<"Invalid choice, please select again: "; } } while(true); cout<<"___________________________________________________\n"; return choice; } // end selectOption function void populateArray(int data[rows][cols]){ srand(time(0)); for(int i = 0; i < rows; i++){ for(int j = 0; j < cols; j++){ data[i][j] = rand() % 100 + 1; } } cout<<"Array populated sucessfully\n"; } // end of poulateArray function void showElements(int data[rows][cols]){ for(int i = 0; i < rows; i++){ for(int j = 0; j < cols; j++){ cout<<data[i][j]<<"\t"; } cout<<endl; } } // end of showElements function void showLargestElement(int data[rows][cols]){ int largest = 1, row =0, col = 0; for(int i = 0; i < rows; i++){ for(int j = 0; j < cols; j++){ if(data[i][j] > largest){ largest = data[i][j]; row = i; col = j; } } } cout<<"Largest element is "<<largest<<" which is at row = "<<row+1<<" or index = "<<row<<" and column "<<col+1<<" or index "<<col<<endl; } // end of showLargestElement function void transposeArray(int data[rows][cols]){ for(int i = 0; i < cols; i++){ for(int j = 0; j < rows; j++){ cout<<data[j][i]<<'\t'; } cout<<endl; } } // end of transposeArray function main(){ int choice = 0, data[rows][cols] = {0}; do{ choice = selectOption(); switch(choice){ case 1: cout<<endl; populateArray(data); cout<<endl; break; case 2: if(data[0][0] == 0){ cout<<"\nSorry the array is empty, first populate it by pressing 1 to perform this task"<<endl<<endl<<endl; continue; } cout<<endl; showElements(data); cout<<endl; break; case 3: if(data[0][0] == 0){ cout<<"\nSorry the array is empty, first populate it by pressing 1 to perform this task"<<endl<<endl<<endl; continue; } cout<<endl; showLargestElement(data); cout<<endl; break; case 4: if(data[0][0] == 0){ cout<<"\nSorry the array is empty, first populate it by pressing 1 to perform this task"<<endl<<endl<<endl; continue; } cout<<endl; transposeArray(data); cout<<endl; break; } }while(choice != 5); // end of do-while loop } // end of main functionMTH603 Quiz 3 Solution and Discussion
-
Please share Quiz
-
@zaasmi said in MTH603 Quiz 3 Solution and Discussion:
Euler’s Method numerically computes the approximate ________ of a function.
Euler’s method is a numerical tool for approximating values for solutions of differential equations.
-
Euler’s Method numerically computes the approximate ________ of a function.
-
@zaasmi said in MTH603 Quiz 3 Solution and Discussion:
Given that dydt=t+y√dydt=t+y with the initial condition y0=1att0=0y0=1att0=0 find the 2nd term in Taylor series when t=1, y/ =0.2, and h=0.1.
-
Given that dydt=t+y√dydt=t+y with the initial condition y0=1att0=0y0=1att0=0 find the 2nd term in Taylor series when t=1, y/ =0.2, and h=0.1.
-
@zaasmi said in MTH603 Quiz 3 Solution and Discussion:
Given that dydt=y−ty+tdydt=y−ty+t with the initial condition y=1,t=0y=1,t=0 find the 3rd term in Taylor series when t=0.3 and y//= 0.2.
-
Given that dydt=y−ty+tdydt=y−ty+t with the initial condition y=1,t=0y=1,t=0 find the 3rd term in Taylor series when t=0.3 and y//= 0.2.
-
@zaasmi said in MTH603 Quiz 3 Solution and Discussion:
In Runge – Kutta Method, we do not need to calculate higher order derivatives and find greater accuracy.
R.K Methods do not require prior calculation of higher derivatives of y(x) ,as the Taylor method does. Since the differential equations using in applications are often complicated, the calculation of derivatives may be difficult
-
In Runge – Kutta Method, we do not need to calculate higher order derivatives and find greater accuracy.
-
@zaasmi said in MTH603 Quiz 3 Solution and Discussion:
Multistep method does not improves the accuracy of the answer at each step.
Multistep methods attempt to gain efficiency by keeping and using the information from previous steps rather than discarding it. Consequently, multistep methods refer to several previous points and derivative values.
-
Multistep method does not improves the accuracy of the answer at each step.
-
If yn+1=yn+16(K1+2K2+2k3+k4)yn+1=yn+16(K1+2K2+2k3+k4) then, K2K2 is:
-
Given that dydt=t+y√dydt=t+y with the initial condition y0=1att0=0y0=1att0=0 Using Modified Euler’s method, for the range 0⩽t⩽0.60⩽t⩽0.6, h = 0.1 is
-
@zaasmi said in MTH603 Quiz 3 Solution and Discussion:
Euler’s method is only useful for a few steps and small step sizes; however Euler’s method together with Richardson extrapolation may be used to increase the ____________.
Order accuracy is the percentage of all ecommerce orders that are fulfilled and shipped to their final destination without error, such as a mis-pick of an item or incorrect unit quantity. Order accuracy is an important metric to track because it highly impacts customer satisfaction.
-
Euler’s method is only useful for a few steps and small step sizes; however Euler’s method together with Richardson extrapolation may be used to increase the ____________.
-
Given that dydt=y−ty+tdydt=y−ty+t with the initial condition y=1.01 at t=0.01. Using Euler’s method, y at t= 0.04, h=0.05, the value of y(0.05) is


100% Off on Your FEE Join US! Ask Me How?


