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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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

Expert Solution
Step 1

Assuming to be in root flash directory 

Computer Engineering homework question answer, step 1, image 1

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 10 steps with 10 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY