This needs to be in C++

Problem3.cpp
![#include problem3.h 2 3 void rotatematrix(int m, int n, int mat[][MAX]) 4 //write your code here 5](http://img.homeworklib.com/questions/7c401210-9e10-11ea-a562-ed78c48224bb.png?x-oss-process=image/resize,w_560)
Problem3.h:
![1 #ifndet LAB3 PROBLEM3 2 #define LAB3PROBLEM3 3 #define MAX 100 4 void rotatematrix(int m, int n, int mat[][MAX]); 5 #endif](http://img.homeworklib.com/questions/7c9aa2c0-9e10-11ea-a568-bf7f74336d72.png?x-oss-process=image/resize,w_560)
/*
* Problem3.h file
*/
#ifndef LAB3_PROBLEM3
#define LAB3_PROBLEM3
#define MAX 100
void rotatematrix(int m, int n, int mat[][MAX]);
#endif
/* problem3.h file ends */
/*
* Problem3.cpp
*/
#include "problem3.h"
void rotatematrix(int m, int n, int mat[][MAX]) {
int M = m, N = n;
int row = 0, col = 0;
int prev, curr;
while (row < m && col < n)
{
if (row + 1 == m || col + 1 == n)
break;
prev = mat[row + 1][col];
for (int i = col; i < n; i++)
{
curr = mat[row][i];
mat[row][i] = prev;
prev = curr;
}
row++;
for (int i = row; i < m; i++)
{
curr = mat[i][n-1];
mat[i][n-1] = prev;
prev = curr;
}
n--;
if (row < m)
{
for (int i = n-1; i >= col; i--)
{
curr = mat[m-1][i];
mat[m-1][i] = prev;
prev = curr;
}
}
m--;
if (col < n)
{
for (int i = m-1; i >= row; i--)
{
curr = mat[i][col];
mat[i][col] = prev;
prev = curr;
}
}
col++;
}
// Print rotated matrix
for (int i = 0; i < M; i++)
{
for (int j = 0; j < N; j++)
cout << mat[i][j] << "\t";
cout << endl;
}
}
/* Probelm3.cpp file ends */
/*
* Main.cpp file
*/
#include <iostream>
using namespace std;
#include "problem3.h"
int main()
{
int mat[][MAX] = { {1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15, 16} };
rotatematrix(4, 4, mat);
return 0;
}
/* Main.cpp file ends */

Note: Please drop comment, for issues or queries.
This needs to be in C++ Problem3.cpp Problem3.h: Given a matrix, clockwise-rotate elements in it. Please...
Given a matrix, clockwise-rotate elements in it. Please add code to problem3.cpp and the makefile. I have also given the main_problem3.cpp and problem3.h to test. problem3.cpp::: #include "problem3.h" // A function to rotate a matrix mat[][MAX] void rotatematrix(int m, int n, int mat[][MAX]) { // your code here } Makefile::: all : problem3.o g++ -o mainp3 # your code here problem3.o : problem3.h problem3.cpp # your code here clean: rm -f *.o mainp3 main_problem3.cpp::: #include <iostream>...
C++
how can I fix these errors
this is my code
main.cpp
#include "SpecialArray.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int measureElementsPerLine(ifstream& inFile) {
// Add your code here.
string line;
getline(inFile, line);
int sp = 0;
for (int i = 0; i < line.size(); i++)
{
if (line[i] == ' ')
sp++;
}
sp++;
return sp;
}
int measureLines(ifstream& inFile) {
// Add your code here.
string line;
int n = 0;
while (!inFile.eof())
{
getline(inFile,...
CC++
Compiler: CPP (gcc-5.x) 0 Simple Calculator Given two integers and a string, create a simple calculator which performs the following operations: • Addition if the string is "+" • Difference if the string is "-" Multiplication if the string is "*" • Return quotient (obtained by dividing the first number by the second) if the string is "/" • Return greater value if the string is "max" • Return lesser value if the string is "min" solution.cpp 2 Create...
You are given the root of a Binary Search Tree. Print the leaf elements of the tree starting from right to left. We have defined the following node C++ Node class for you: class Node { public: int name; Node* left = NULL; Node* right = NULL; }; Function to code: void printLeaves(Node* root); The first input in test cases are nodes of a tree which are inserted in that order. You don't need to implement insert. You have access...
Assignment: Write a C function that accepts the pointer to a matrix of integer numbers (i.e. a two-dimensional array), number of rows and number of columns as input and prints the matrix after rotating it 90 degrees clockwise. Example: void rotate-matrix (int* matrix, int row, int column) Inputs: row 4, column-6 and the pointer to the matrix below: 2 3 6 5 8 0 Output:
Write a program whose input is two integers and whose output is
the two integers swapped.
Write in C language
7.3 LAB: Swapping variables Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 38 then the output is: 83 Your program must define and call a function. SwapValues returns the two values in swapped order. void SwapValues(int* userVali, int* userVal2) ACRIVITY 7.3.1: LAB: Swapping variables 0/10 ] main.c...
Define a test method testfindMax that exercises
Calculation.findMax() in Calculation class
Define a tearDown() method
Given the following code below: 6. 7. 1. public class Calculation { 2. //method that returns cube of the given number 3. public int findMax(int ac[]}{ 4. int max=0; 5. for(int į=1;i<acr.length;i++){ if(max<arc[i]). max=acc[i]; } 8. return max: 10. } 11. //method that returns cube of the given number 12. public static int cube(int n){ 13. return n*n*n; 14. 15. } } 9. }
(b) Find the sircular convolution on xi(n) and x2(n). Show the steps. xi(n)- 4 9 16 x2(n)- (12 -6 4 -3) (n-0, 1,2,3) xiun) x2(-n reverse/rotate clockwise 14 916 9 16 14916 (reverse order) rotate right) 14916___ 14 916 4916
(b) Find the sircular convolution on xi(n) and x2(n). Show the steps. xi(n)- 4 9 16 x2(n)- (12 -6 4 -3) (n-0, 1,2,3) xiun) x2(-n reverse/rotate clockwise 14 916 9 16 14916 (reverse order) rotate right) 14916___ 14 916 4916
CONVERT CODE TO JAVA
// A C++ program to Print all elements in sorted order from row
and
// column wise sorted matrix
#include<iostream>
#include<climits>
using namespace std;
#define INF INT_MAX
#define N 4
// A utility function to youngify a Young Tableau. This is
different
// from standard youngify. It assumes that the value at
mat[0][0] is
// infinite.
void youngify(int mat[][N], int i, int j)
{
// Find the values at down and right
sides of...
In C please
Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutesToMiles(). Original maino: int main(void) { double milesPerHour, double minutes Traveled; double hours Traveled; double miles Traveled; scanf("%f", &milesPerHour); scanf("%lf", &minutes Traveled); hours Traveled = minutes Traveled / 60.0; miles Traveled = hours Traveled * milesPerHour; printf("Miles: %1f\n", miles Traveled); return 0; 1 #include <stdio.h> 3/* Your solution goes here */ 1 test passed 4 All tests passed...