TDT4102-Ovinger/Oving9/Oving 9/Oving 9.cpp

122 lines
1.4 KiB
C++
Raw Normal View History

2019-03-13 14:16:48 +01:00
// Oving 9.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
2019-03-13 23:01:06 +01:00
#include <iomanip>
#include <sstream>
#include <vector>
#include "Fibonacci.h"
#include "Matrix.h"
#include "Dummy.h"
2019-03-13 14:16:48 +01:00
using namespace std;
int main()
{
2019-03-13 23:01:06 +01:00
// createFibonacci();
/*
Matrix m1{ 10 };
Matrix m2{ m1 };
Matrix m3;
Matrix m4{ 4, 5 };
m3 = m2;
m1.set(0, 0, 2);
m3.set(0, 1, 10);
m2.set(0, 1, 42);
cout << m1 << endl;
cout << m2 << endl;
cout << m3 << endl;
m3 += m2;
cout << m3 << endl;
m3 += m4;
cout << m3 << endl;
*/
Matrix A{ 2,2 };
Matrix B{ 2,2 };
Matrix C{ 2,2 };
2019-03-13 14:16:48 +01:00
2019-03-13 23:01:06 +01:00
A.set(0, 0, 1);
A.set(0, 1, 2);
A.set(1, 0, 3);
A.set(1, 1, 4);
B.set(0, 0, 4);
B.set(0, 1, 3);
B.set(1, 0, 2);
B.set(1, 1, 1);
C.set(0, 0, 1);
C.set(0, 1, 3);
C.set(1, 0, 1.5);
C.set(1, 1, 2);
cout << A << endl;
cout << B << endl;
cout << C << endl;
A += B + C;
cout << A << endl;
cout << B << endl;
cout << C << endl;
#pragma region Task 3
/*
N<EFBFBD>r dummy kj<EFBFBD>rer vil det skrives ut:
"a: 4"
"b: 4"
"c: 4"
"a: 4"
"b: 3"
"c: 5"
*/
//dummyTest(); // Stemmer ikke overens med ovenfor
/* Skriver ut
"a: 4"
"b: 4"
"c: 4"
"a: 5"
"b: 5"
"c: 5"
*/
/* 3c)
Etter kopikonstrukt<EFBFBD>ren fungerer Dummy b
*/
/* 3d)
Etter =-operat<EFBFBD>ren fungerer programmet som forventet
*/
#pragma endregion
return 0;
}
2019-03-13 14:16:48 +01:00