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
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
***please follow teachers hint, do not do it other way, if you do it otherway, its not going to help me, professor very strict*** ;(
Professor hint:
/* adding two vectors h thomas tucker 2017 spring EGR111 */ using namespace std; #include#include //functional prototype void get_data(); void resultant(); int N, M, K; float mag[20], dir[20]; int main() { cout<<"how many vectors are you going to enter? "; cin>>N; if(N<2 && N<15) { get_data(); resultant(); system("pause"); return 0; } system("dpause"); return 0; } int get_data() { int i; for(i=0; i<=N-1; i++) { cout<<"enter the vectors magnitude "; cin>>mag[i]; cout<<"enter the vectors direction "; cin>>dir[i]; } } void resultant() { }
***Please follow his direction***
Comments all The line*** do not use any other header than he used***
Thank you.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
