Add the correct code to fill the matrix array with the value

Assignment Help C/C++ Programming
Reference no: EM13163430

Use the file below code and add the correct code to fill the matr2 array with the values that make it the matrix transpose of matr1. There are many examples on the Internet that show how to do this in C++ and what it should look like when it is correct.

#include <cstdlib>

#include <ctime>

#include <iostream>

#include <iomanip>

 

const int ROWS = 6;

const int COLS = 7;

 

using namespace std;

 

int main()

{

srand((unsigned)time(0));

int i, j, matr1[ROWS][COLS];

for(i=0; i<ROWS; i++)

{

for (j=0; j<COLS; j++)

{

matr1[i][j] = (rand()%500)+1;

cout << setw(5) << matr[i][j];

}

cout << endl;

}

cout << endl << endl;

 

// transpose

int matr2[COLS][ROWS];

 

 

// display second matrix

for (i=0; i<COLS; i++)

{

for (j=0; j<ROWS; j++)

cout << setw(5) << matr2[i][j];

cout << endl;

}

}

 

 

Reference no: EM13163430

Questions Cloud

Implement a standard sorted linked list class : Write C++ Program:Implement a standard SORTED linked list class. Be sure to include constructor/copy constructor, destructor, and assignment operator overload.
Compute the zero-point energy of a harmonic : Calculate the zero-point energy of a harmonic oscillator consisting of a rigid CO molecule adsorbed to a metal surface by a bond of force
State what is the heat of vaporization of ethanol : The heat of fusion, ?Hfus, of ethanol (C2H5OH) is 4.9 kJ/mol. The heat of sublimation of ethanol, for the process C2H5OH(s) ? C2H5OH(g) , is 43.5 kJ/mol. What is the heat of vaporization of ethanol?
Computer program that inputs a degree : Write a computer program that inputs a degree of difficulty and seven judges' scores, and outputs the overall score for that dive. The program should ensure that all inputs are within the allowable data ranges
Add the correct code to fill the matrix array with the value : Use the file below code and add the correct code to fill the matr2 array with the values that make it the matrix transpose of matr1. There are many examples on the Internet that show how to do this in C++ and what it should look like when it is corre..
Compute the downward pressure in pascals due to gravity : Calculate the downward pressure in pascals due to gravity exerted by the bottom face of a 3.25kg cube of iron that is 7.50 cm
Calculate the concentration of sodium ion in a solution : Calculate the concentration of sodium ion in a solution made by diluting 350.0 mL of 3.00 M sodium carbonate to a total volume of 2.00 L.
Determine molar mass for this compound and oxidation state : Determine molar mass for this compound and oxidation state of lead in it. write the oxide formula of lead for the corresponding oxidation state
Write a program that allows users to enter a dollar amount : Write a program that allows users to enter a dollar amount for their bank account balance at the beginning of the month.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Structured programming using procedural languages

A a program that is called "Playing with Numbers or Letters".

  Implement database having array of pointers

One way to implement this database is to have an array of pointers pointing to Employee objects. You will obviously require a function named Calculate_salary() which will be different for each employee class. Write code in c++

  Show the deatils of an emplyoee - c programming

Show the deatils of an emplyoee in a neat format.

  Write a program code to compute and build a table of reynold

Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)

  Program which asks the user for due date of next assignment

Write a program which asks the user for due date of the next assignment (hours, minutes). Then print number of minutes between the current time and the due date in format.

  Flipflaps - game based on pancake sorting

The project is to design and write a C++ 11/FLTK game program with a graphical user interface.The game is based on "pancake sorting,", which actually has some mathematical significance.

  C program to compute parking fare for customers

Write C program to compute parking fare for customers who park their cars in parking lot when following information is provided: A character showing type of vehicle: C for car, B for bus and T for truck

  Implement a graphics system that has classes

Implement a graphics System that has classes for various figures: rectangles, squares, triangles and circles. A rectangle has data members height, width, color , and center point. A square has center point and an edge and color

  Illustrate example from ansi c programming language

Illustrate example from ANSI C programming language, without using nested procedures, to show the fact that "assignment-by-sharing in conjunction with quasi-dynamic object binding

  Write c++ program that reads in the average monthly rainfall

Write a C++ program that reads in the average monthly rainfall for a city for each month of the year and then reads in the actual monthly rainfall for each of the previous 12 months

  Takes a string containing a full name

Write a program that takes a string containing a full name and outputs each part of the name separately with its length. The name should be in the form of first, middle, and last name, separated from each other by a single space. For example, if the ..

  Write program which inputs number of winning coupons

Write a program which inputs number of coupons you win and outputs how many candy bars and gumballs you can get if you spend all off your coupons on candy bars first and remaining coupons on gumballs in c++.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd