Define a physicsvector class which consists of a struct


Question 1: Recall from physics that a physics vector can be represented by a direction and a magnitude (e.g., force or distance).

Define a Physics_vector class which consists of a struct containing the direction and magnitude, and also define a function add_physics_vector that takes two physics vectors and returns their physics vector sum. 

The main should ask for 4 lines of input, the direction and magnitude of two physics vectors, and print the vector sum on two lines (direction and magnitude); repeat until the user enters a vector of

-1 -1.

As you design the program consider:

Part 1: Will the direction and magnitude be integers or doubles?

Part 2: Will the input vectors be passed by value, by reference, or by const reference?

Part 3: What will be public in the class?

Can you design the public class and implement the program?

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Define a physicsvector class which consists of a struct
Reference No:- TGS0957751

Expected delivery within 24 Hours