Skip to content

Commit 7e3cb17

Browse files
Able to print out 5 vectors correctly. Table has correct values now. Will format later.
1 parent 18fdfe3 commit 7e3cb17

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

programming4.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ int main()
8383
}
8484

8585
std::vector<double> vector5;
86+
std::cout << "Size of vector 4: " << vector4.size() << std::endl;
8687
std::cout << "This is vector 5" << std::endl;
87-
// for(size_t i = 1; vector4.size(); ++i)
88-
// {
89-
// vector5.push_back((vector4[i] - vector4[i -1]) / (vector1[i + 2] - vector1[i -1]));
90-
// std::cout << vector5[i-1] << std::endl;
91-
// }
88+
for(size_t i = 1; i < vector4.size(); ++i)
89+
{
90+
vector5.push_back((vector4[i] - vector4[i -1]) / (vector1[i + 2] - vector1[i -1]));
91+
std::cout << vector5[i-1] << std::endl;
92+
}
9293

9394
std::cout << "Print out first part";
9495
std::cout << (vector4[1] - vector4[0]) << std::endl;

programming4.exe

512 Bytes
Binary file not shown.

programming4.obj

2.44 KB
Binary file not shown.

0 commit comments

Comments
 (0)