Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

Proficiency with Microsoft Word, Excel, PowerPoint

Answered: 1 week ago

Question

Experience with SharePoint and/or Microsoft Project desirable

Answered: 1 week ago