Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please i need a C++ code solution for this question D. Design a class for Vector (2)(4044) Description Point and vector are two important concepts

image text in transcribed

image text in transcribed

image text in transcribed

please i need a C++ code solution for this question

D. Design a class for Vector (2)(4044) Description 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. \{ wgVector v1,v2,v3,v4,v5; int d; cin>>v1;//input a vector cin>>v2; /linput a vector cin>>d: llinput an integer v3=v1+v2;// wo vector addition v4=v2d;//a vector times an integer get another vector v5=v1v2; //two vector subtraction cout

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