while(divA != -1) { cout <<\"Enter amounts of dividends, or enter -1 to quit:\"
ID: 3617382 • Letter: W
Question
while(divA != -1)
{
cout <<"Enter amounts of dividends, or enter -1 to quit:" << endl;
cin >>divA;
dividend[0] +=divA;
}
dividend[0] +=1;
div1.setDividend(dividend[0]);
cout <<"Enter corresponding stock names: "<<endl;
cin.ignore(10,' ');
cin >> stockA >>stockB >> stockC;
getline(cin,stName);
div1.setName(stName);
how do I connect the stock nameto the corresponding amount so I can produced outputlike
Dividends
Google 2000
Coke 2000
Ibm 1000
Total 5000
Explanation / Answer
please see my message and rate- thanks The stock names have to be read in individually Is the class, one of arrays, makes a big difference after the code is changed to something like this they will beassociated with each other the divA while loop, is it accumulating all the dividends for 1stock?--please send me the assignment and rest of code so I canhelp you better for(int i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.