Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the ((pseudo code)),and the output of the program . Progr amming Assignment ADT Two-dimensional Vector ABSTRACT DATA TYPE (ADT) Two-dimensional vector There are

I need the ((pseudo code)),and the output of the program .
image text in transcribed
image text in transcribed
Progr amming Assignment ADT Two-dimensional Vector ABSTRACT DATA TYPE (ADT) Two-dimensional vector There are many applications in mathematics, engineer ing, physics, finance, etc. in which the underlying model is a twodimensional veetor .in Whi The general form of an two-dimensional vector is: where: and b are each a real number Example: v = ( 2.45, -2.78 ) The following are some of the operations that are frequently requiedn applications that involve two-dimensional vectors: vectors:vi a, b scalar: vector addition: 2. vector subtraction: 3 Scalar multiple: 4 scalar product v2b d) k a kb) Also called: dot product or inner product. 5 magnitude (length) of a vector 2 2 1/2 Note the result obtained from the scalar product and magnitude operations is a scalar valde (not another vector IMPLEMENTATION OF THE ADT In order to implement this ADT in a progr amming language it is necessary to first select an appropriate data structure. The ADT vector can be r epr esented as: struct VECTOR double double This declaration makes it possible to declare variables of type VECTOR in the application programs DIRECTIONS use the following for ALL test suns of this pr ogr am: Vector 1 vec1: namel name2 scalar 10 Vector 2 veq2: 4. Continuing to use a STEPWISE MODULAR APPROACH you should next write the code declaration and definition) for the function that implements the vector subtraction operation and then add the calls:. calc difference( veci, vec2, differ) print vector (outfile, "Difference, differ) at the, appropr iate points in the main function 5 Write the code (declaration and definition) for the function that i mplements the scalar multiple operation and tben add the calls: scalarmult( veci, 10, s mult) print vector(outfile, Scalar multiples mult) 6. Write the code (declaration and definition) for the function that implements the scalar product operation (use a return statement) and then add th ne of code: outfile

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

More Books

Students also viewed these Databases questions

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago

Question

=+j What rules will apply to the process of negotiations?

Answered: 1 week ago