Help me homework c++ The shots file holds a list of shots (imagine some hitscan weapon in a video game like a shotgun or something). Each shot has an origin and a direction. The origin is an (x,y) coordinate, like (5,3). The direction is a slope and whether the shot is traveling along that slope or in the reverse. A slope of "Vertical" means that the shot is travelling straight up and down. The format is: x_location y_location slope(either a number like 2.1 or a non-number meaning "Vertical") forwards(1 meaning forwards, 0 meaning backwards
Help me homework c++
The shots file holds a list of shots (imagine some hitscan weapon in a video game like a shotgun or something). Each shot has an origin and a direction. The origin is an (x,y) coordinate, like (5,3). The direction is a slope and whether the shot is traveling along that slope or in the reverse. A slope of "Vertical" means that the shot is travelling
straight up and down.
The format is:
x_location y_location slope(either a number like 2.1 or a non-number meaning
"Vertical") forwards(1 meaning forwards, 0 meaning backwards)
0 0 0 0
0 0 0 1
0 0 Vertical 0
0 0 Squirrel 1
10 10 -1 1
-10.1 -100.01 2.1 0
The first line is a horizontal line shooting left from the origin (0,0).
The second line is a shot also travelling horizontally from the origin, but forward along the x axis instead of backwards.
The third line is shooting straight down out of the origin
The fourth line is shooting straight up out of the origin (any non-number means Vertical, not just Vertical)
The fifth line is travelling diagonally down and to the right out of (10,10)
The sixth line is travelling steeply (slope: 2.1) down and to the left out of
(-10.1,-100.01)
Things to watch out for: make sure you can handle negative slopes as well as non-numbers (like "vertical" or "squirrel" or "-") which all mean the shot is vertical.
=== Operation 2 - Print the shot data ===
For the sample shots file given above, it would print out this:
(0.00,0.00) Slope: 0.00 Backwards
(0.00,0.00) Slope: 0.00 Forwards
(0.00,0.00) Slope: Vertical Backwards
(0.00,0.00) Slope: Vertical Forwards
(10.00,10.00) Slope: -1.00 Forwards
(-10.10,-100.01) Slope: 2.10 Backwards
![](/static/compass_v2/shared-icons/check-mark.png)
Assuming to be in root flash directory
Trending now
This is a popular solution!
Step by step
Solved in 10 steps with 10 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)