Homework Statement
Okay. I got two different answers for these and I don't know which one is right so I could continue from there. If you will please help by letting me know which answer is right and why, I'd very much appreciate it.
This is the figure...
The program looks quite messy L: However, the part in bold is the matrix rotation part.
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
void rotate90(string a, string b, string c, string d)
{
string temp =...
Homework Statement
I am trying to rotate a 2D array of type string. I am not sure what the problem is with my function. Flipping does occur but for some reason, it's not by 90.
Homework Equations
The Attempt at a Solution
The program consists of a function and the main. Here's...
Homework Statement
I am attempting to transfer the data from a file into a 2D vector array. The data look like this:
1 2 3
4 5 6
7 8 9
However, the dimensions must be detected dynamically.
Homework Equations
The Attempt at a Solution
There are two files in this code, but I attempted to...
Homework Statement
I came across some codes that calculate the smaller string using user-defined functions.
I tried figuring them out, but some parts I don't get. This is the first one:
bool isShorter (string& s1, string& s2) { // the string objects may be large!
return...
Homework Statement
A force F = 8i-3i N acts on a particle that undergoes a displacement Δr = 2i + j m.
(b) What is the angle between F and Δr? (state your answer to three significant figures)
Homework Equations
Angle = cos-1 (A.B/ AB)
The Attempt at a Solution
W=13.1 J
AB=...