Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code is in C++ Point and vector are two important concepts in math. Design a class for point and a class for vector in

The code is in C++

image text in transcribedimage text in transcribed

Point and vector are two important concepts in math. Design a class for point and a class for vector in math to implement vector operations. The point and class are in 3-Dimension with three components. To make thing simple, they are integers. You are provided with main function. You are required to complete the program, and test it, and run it. You dont have to worry about input and output format. Instructions: A vector is an object that has both a magnitude and a direction. Geometrically, we can picture a vector as a directed line segment, whose length is the magnitude of the vector and with an arrow indicating the direction. The direction of the vector is from its tail to its head. A vector can be represented in the form of v=xi+yk+zkv=xi+yj+zk So a vector has three components (x,y,z) where x,y and z are real numbers(here to make thing simple they are integers). Now you are required to design a class for vector which has the following features: You are required to design a class for point and vector to complete the following main function. So that it can run and print out the expected results. int main() \{ wgVector v1,v2,v3,v4,v5 int d; cin >v1// input a vector cin >v2; //input a vector cin > d; //input an integer v3=v1+v2;/ two vector addition v4=v2d;//a vector times an integer get another vector v5=v1v2;// two vector subtraction cout d; //input an integer v3=v1+v2;// two vector addition v4=v2d; //a vector times an integer get another vector v5=v1v2;// two vector subtraction cout 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions

Question

4-6 Is there a digital divide? If so, why does it matter?

Answered: 1 week ago