PA #2
Purpose
To demonstrate the skills of working with git branches.
- The equation that you need to work upon is shown on the image below (take equation that equals to your number in the list of the group you study at).
- Create a new repo in github, clone the repo to a local directory.
- Create files suite with a source code in cpp language: a cpp/h file pair holding a class with a public function named FuncA calculating a trigonometric function returning value 0, and the file named main.cpp that instantiates the class and calls the function; Push the code to a branch named master;
- Branch out from master, naming a new branch branchA. In branchA update the implementation of FuncA calculating function result value as the sum of the first n elements of an infinite sequence (see variants table). Make n as a function argument. Stash your changes.
- Branch out from master branch creating a new branch named hotfix; In hotfix update the implementation of FuncA returning its value as the sum of the first 3 elements of an infinite sequence. Commit the code and push to the repo;
- Merge hotfix branch into master branch;
- Switch back to the branch branchA. Stash pop your intermediate result. Finish the implementation, add comments to the class and its function about the param meaning. Commit the changes.
- Switch to master branch, get the latest updates, try to merge BranchA into the branch. Resolve the conflict in favor of branchA changes. Take a screenshot of a 3-way diffmerge vimdiff contents when merging. Commit and push.
- Make a photo/screenshot showing the log of branch history.
Presentation
- Submit a link to github repo, an image showing 3-way merge contents of vimdiff and an image of a branch log final history through this form.
Assessment
8 points maximum
Variants







Comments
Post a Comment