• 100% Satisfaction Guarantee
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
3546829
Scott is online now

# My name is ***** *****. actually I find this and this is

### Customer Question

Customer: My name is ***** *****. actually I find this http://www.justanswer.com/computer-programming/6d9mt-answer-http-www-math-ucla-edu-virtanen-10a-2-12w-assignments-hw8-hw8-html.html#re.v/417/ and this is exactly same homework as mine. and seems that you already answered them.
JA: Thanks. Can you give me any more details about your issue?
Customer: http://www.math.ucla.edu/~virtanen/10a.2.15f/assignments/hw8/hw8.html this is my homework and #include #include #include #include #include #include using namespace std;int main(){ /*************************************************************** ask the user to enter the dimensions of the matrix and check that the number of rows and the number of columns given are valid If they are not, then ask the user to re-enter the dimensions. If they are valid, then create the matrices. ***************************************************************/ cout x >> y; while (x>10 || y>10) { cout x >> y; if (x<11 && y<11) break; } cout << "Thank you for setting the dimensions of the matrices. \n"; int A[x][y]; //global array int B[x][y]; //global array int C[x][y]; //global array //ask the user if they would like to fill the matrices from a file or fill them with random values. int z; cout << "How do you want the matrices to be filled? \n" << "Type 0 to fill the matrices from a file, or \n" z; //fill the matrices with numbers (all be made of ints, and every entry has a value between -10 and 10) //If they choose the file option, prompt the user for a file name, and fill matrix from file if (z == 0) { string filenamein; cout filenamein; } while (z == 0) { void fillfile (int A[x][y], int x, int y); { //code: function that fills a matrix with values from a file } void fill (int B[x][y], int x, int y); { //code: function that fills a matrix with values from a file } break; } //If random... srand((int) time(0)); while (z == 1) { void fillrandom (int A[x][y], int x, int y); //code: function that fills A with random values between -10 and 10 { for (int i = 0; i < x; i++) { for (int j=0; j < y; j++) { A[j] = rand() % 21 - 10; } } } void fillrandom (int B[x][y], int x, int y); //code: function that fills B with random values between -10 and 10 { for (int i = 0; i < x; i++) { for (int j=0; j < y; j++) { B[j] = rand() % 21 - 10; } } } break; } //Ask the user if the output should go to a file or to the console. If the user chooses output to a file, ask the user for a file name. int w; cout << "Do you want the output to go to a file or to the console? \n" << "Type 0 to output to a file, or \n" w; if (w == 0) { string filenameout; cout filenameout; } //After the matrices have been filled output the two matrices either to screen or to a file. if (w == 0) //code to output to file void printtofile (int A[x][y], int x, int y);//to output A to file { //code } if (w == 1) // code to output to console void printrandom (int A[x][y], int x, int y);//to output A to console cout << "\n Here is matrix A: \n \n"; { for (int i = 0; i < x; i++) { for (int j=0; j < y; j++) { cout << setw(5) << A[j]; //setw(5) forces 5 spaces between matrix row elements } cout << endl; } void printrandom (int B[x][y], int x, int y);//to output B to console cout << "\n Here is matrix B: \n \n"; { for (int i = 0; i < x; i++) { for (int j=0; j < y; j++) { cout << setw(5) << B[j]; } cout << endl; } } } void matrixaddition (int C[x][y], int x, int y); //function that adds two matrices { for (int i = 0; i < x; i++) { for (int j=0; j < y; j++) { C[j] = (A[j] + B[j]); } } } //Output the result to either the console or to a file as requested by the user. Need a function that outputs a single matrix to the console; and a function that outputs a single matrix to a file. if (w == 1) // code to output C to console { void printrandom (int C[x][y], int x, int y);//to output C to console cout << "\n Here is matrix C obtained by adding matrices A and B: \n \n"; { for (int i = 0; i < x; i++) { for (int j=0; j < y; j++) { cout << setw(5) << C[j]; //matrix C is priniting out as a line instead of a matrix - why??? } } cout << endl; } } if (w == 0) //code to output C to file void printtofile (int C[x][y], int x, int y);//to output C to file { //code } cout << "\n end of program \n"; return 0;} oh no, sorry I shouldn't have typedt this here. .. but the function doesn't work.
JA: OK got it. Last thing — JustAnswer charges a fee (generally around \$18) to post your type of question to Programming Experts (you only pay if satisfied). There are a couple customers ahead of you. Are you willing to wait a bit?
Customer: how long? actually I need them by 4:50
JA: OK. Now I'm going to take you to a page to place a secure deposit with JustAnswer. Don't worry, this chat is saved. After that, we will finish helping you.
Submitted: 1 year ago.
Category: Homework
Customer: replied 1 year ago.
When can I get help for it? I really need an answer asap, by 4:50pm today.
Expert:  John replied 1 year ago.

hi