Question: WRITE AN INTERACTIVE PROGRAM that allows the user to enter (at least two)....UP-TO 15 vectors that are to be added........display the resultant on the screen

WRITE AN INTERACTIVE PROGRAM

that allows the user to enter (at least two)....UP-TO 15 vectors that are to be added........display the resultant on the screen

study in your text the if statement

[use the if statement to make sure the user only enteres between two and 15 vectors] **Comments all the line

use , , , as a header file, do not use any other

one of my friend did it like below, i think all patterns are good here, but professor asked to use if statement to make sure the user only enteres between two and 15 vectors...so need to fix it...

/* Dweep Dey Program 6 02/27/17 This program add up to fifteen vectors from a text file */

using namespace std;

#include #include #include #include

//global variables ifstream Infile; float rdir, rlength, a, endtheta, magnitude, resdir, len, the,sum;

//functiony goodness float calcvector(float length, float theta); float length [15], theta [15]; void getdata();

int main() { float length, theta; //local variables cout<<"I wrote this to show the addition of vectors in a text file...''"<

system;"pause"; //so we can see the equation printed on the screen above return 0; // ends program } void getdata() { int i, numberofdatas; Infile.open("thedata.txt"); i = 0; while(!Infile.eof()) //while not the end of the file { Infile>>length[i]; // cout<>theta[i]; //cout<

***We cannot use void get data under int main(), however he did its good

Thank you.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!