Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions programming4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,18 @@ int main()
std::cout << "This is vector 3" << std::endl;
for(size_t i = 1; i < vector1.size(); ++i)
{
std::cout << (vector2[i] - vector2[i-1]) / (vector1[i] - vector1[i-1]) << std::endl;
vector3.push_back((vector2[i] - vector2[i-1]) / (vector1[i] - vector1[i-1]));
std::cout << vector3[i-1] << std::endl;
}

std::vector<double> vector4;
std::cout << "This is vector 4" << std::endl;
std::cout <<"print out"<< std::endl;

for(size_t i = 1; i < vector3.size(); ++i)
{
std::cout << (vector3[i] - vector3[i-1]) / (vector1[i+1] - vector1[i-1]) << std::endl;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try to create a private function to make the code cleaner and less repetitive. Good job, though.

vector4.push_back((vector3[i] - vector3[i-1]) / (vector1[i+1] - vector1[i-1]));
std::cout << vector4[i-1] << std::endl;
}


Expand Down
Binary file modified programming4.exe
Binary file not shown.
Binary file modified programming4.obj
Binary file not shown.