Is it possible to prompt information from user then display the result in a one dimensional array form? If yes can anyone tell me how should i link them together?
What input you want to take? What do you mean by "one dimensional array form"?
Show an example please.
@MiiNiPaa the salary received by an employee.
sample of one dimensional array:
int main ()
int grossSales ;
for (t=0; t<10; t++) grossSales[t] = t;
for (t=0; t<10; t++)
cout << "This is gross sales[" << t << "]: " << grossSales[t] << "\n";
@MiiNiPaa this is the latest coding i have done just now but the answers are still weird...
using namespace std;
int main ()
double salary = 0;
for (i=0; i<10; i++)
cout << "Please enter the gross sales that you have made for the week: " << endl;
cin >> gross;
salary = 200 + (0.09 * gross[i]) ;
cout << setprecision(3) << "\n\nYour commission for the week: " << salary << endl;
cin >> gross; err... shouldn't it be
cin >> gross[i];?
@MiiNiiPaa hmm and any idea how can i categorise all my results into the following categories?
$200 - $299
$300 - $399
$400 - $499
$500 - $599
$600 - $699
$700 - $799
$800 - $899
$900 - $999
which statement should i use or do you have any examples? sorry for bothering you ):
@MiiNiiPaa "cin >> gross; err... shouldn't it be cin >> gross[i];" wait let me try that out.