bubblepantz
Thread Starter
- Joined
- Mar 21, 2008
- Messages
- 56
Im very new to C++ and im using the program as sort of a comprhension check on what i know so far. im stuck bc of an array. i want to change the value of an int to an array value based on a selection. such as:
entry.orville based on user input changes to entry.orville[0][0]; something along those lines. Any help is sooo much apprciated.
entry.orville based on user input changes to entry.orville[0][0]; something along those lines. Any help is sooo much apprciated.
Code:
#include <iostream>
using namespace std;
struct database {
int orville;
int tiffany;
int robin;
int dawn;
int dad;
int mom;
int choices;
int arraychoices;
};
int main()
{
system("TITLE Orville .1");
database entrys;
entrys.orville;
entrys.tiffany;
entrys.robin;
entrys.dawn;
entrys.dad;
entrys.mom;
entrys.choices;
entrys.arraychoices;
cout<< "Welcome to the box." << endl;
cout<< "In this im displaying my knowledge of what ive learned about in C++ this far" << endl;
cout<< "Please select a choice to continue:" << endl;
cout<< "1. Orville 2. Tiffany 3. Robin 4. Dawn 5. Dad 6. Mom" << endl;
cin>> entrys.choices;
cout<< "Next we will want to put these values into an array(grid)" << endl;
cout<< "Select where you would like Orville to go," << endl;
cout<< "Remember, this is a 6x6 grid" << endl;
cout<< "1.1x1 square 2.2x2 square 3.3x3 square" << endl;
cin >> entrys.arraychoices;
int simplearray[7][7];
switch (entrys.arraychoices)
{
case '1':
cout << "Orville has been placed in the 1x1 sqaure" << << endl;
break;
case '2':
cout << "Orville has been placed in 2x2 on the grid" << << endl;
break;
case '3':
cout << "Orville has been placed in 3x3" << << endl;
break;
default:
cout << "!! Warning: Please select a proper action !!" << endl;
break;
}
switch (entrys.choices)
{
case 1:
cout << "Orville, the Lil Brother" << endl;
break;
case 2:
cout << "Tiffany, the Lil Sister" << endl;
break;
case 3:
cout << "Robin, The Big Sister" << endl;
break;
case 4:
cout << "Dawn, The Medium Sister" << endl;
break;
case 5:
cout << "Big Pappa" << endl;
break;
case 6:
cout << "The *****" << endl;
break;
default:
cout << "!! Warning: Please select a proper action!!" << endl;
break;
}
system("pause");
}