Clinton Portis 211 Practically a Posting Shark

in my opinion, you should write functions that evaluate everything from royal flush to high card:

//function prototypes
bool is_royal_fush(hand[7]);
bool is_straight_flush(hand[7]);
bool is_4kind(hand[7]);
bool is_full_house(hand[7]);
bool is_flush(hand[7]);
bool is_straight(hand[7]);
bool is_3kind(hand[7]);
bool is_2pair(hand[7]);
bool is_pair(hand[7);
int get_high_card(hand[7]);

Some hands might qualify for several winning scenarios, so it is important to test from royal flush down to high card and break at the first true test in order to get the highest value of the hand.

Clinton Portis 211 Practically a Posting Shark

when it took me 6 months to figure out how to add basic resources to a win32 project.... and going through 5 compilers just to change window background color, i knew this **** was just to messed up. i'm glad i stopped at just c++ or else i would be spending the rest of my life as an abusive and angry alchoholic.

Clinton Portis 211 Practically a Posting Shark

One problem may be that you never initialized any of your variables.

//These could literally be any value.
int n,x,i,j;

Here you create a variable 'j', and make a whole bunch of loop conditions that are based on 'j'... 'j' could be anything......

for([B]j[/B]=(2*[B]j[/B]-1);[B]j[/B]>0;[B]j[/B]--)
Clinton Portis 211 Practically a Posting Shark

int types do not support floating point decimal. try using double types, and if you desire a set precision, you can go even further and use float's.

with your calculator application, it is possible to prompt the user for a desired precision, in which case you would use float types.

http://www.cplusplus.com/reference/iostream/manipulators/setprecision/

Clinton Portis 211 Practically a Posting Shark
#include <iostream>

int main()
{
     std::cout << "Merry Christmas Everyone!";
     return 0;
}
Clinton Portis 211 Practically a Posting Shark

I think you'd have to first check to see if there are any possible moves your king can make... and then if the attacking piece is not a knight, you will probably have to check every other piece on the board to see if it can move anywhere inside the line of the attacking piece and the king. lastly, every piece should be tested to see if it can actually kill the attacking piece.

if the king cannot make a legal move, and the attacking piece is a knight, then the only possible scenario is a checkmate (unless the knight itself can be taken.) No block can occur.

When all three conditions occur; no legal move for king, no block can occur, and the attacking piece cannot be taken, only then can you conclude checkmate.

VernonDozier commented: Good suggestions. +15
Clinton Portis 211 Practically a Posting Shark

system("cls") is cheap and easy. just like my women.

Nick Evan commented: Hehe :) +17
Clinton Portis 211 Practically a Posting Shark
struct service_plan
{
     int account_number;
     char service_code;
     int data_size;
}


int main()
{
     //create an array of service_plans

     //start loop

          //prompt user for account number
          //prompt user for service code
          //prompt user for amount of data
          //ask user if they would like to enter another record
          //increment an array counter

     //end loop

     //start loop

          //display element account_number
          //display element service_code
          //display element data_size
          //increment array counter
  
     //end loop

     return 0;
}
Clinton Portis 211 Practically a Posting Shark

I've dabbled in winsock a bit. So i'll throw in me' two cents:

I believe you should have a couple of struct attributes that include the 'type' of struct, and perhaps also the 'size' of the struct. These should probably be the first two things ye' test for as a client. Then ye' can identify and handle the type of data ye' are receiving.

there seems to be a common theme among win32 and winsock ADT's in that they usually contain a 'header' of some sort, which tells you everything you need to know about the struct, before you even begin to dig into of the contents of the struct. Try employing a similar strategy in the design your ADT's.

extra bonus
(also, i believe the size of many Winsock structs are 'padded' with useless attributes to the nearest power of 2 (128, 256, 512, 1024, etc) for sending and receiving efficiency. Win32 ADT's employ the same strategy for memory management efficiency.)

Clinton Portis 211 Practically a Posting Shark

ye' need to enclose your if() case in curly braces;

if(something)
{
      //do stuff
}

else if(something)
{
     //do other stuff
}

else
{
     //do something else
}

simple mistake.

Daniel_49 commented: ~ ty dude. :) +0
Clinton Portis 211 Practically a Posting Shark

perhaps computer programming isn't the field for you. perhaps you should change your major to liberal arts or something.

Clinton Portis 211 Practically a Posting Shark

if pseudorandom21 is correct, perhaps having random access to the file data would be an alternative to having to read in the entire file at once.

Clinton Portis 211 Practically a Posting Shark

in my opinion, data hiding in today's IT can be best utilized in a few specialized scenarios:

if working on a classified/sensitive project, tasks can be delegated to specific departments, and assembled by one specific person/department. this ensures a 'balance of power' and a system of checks and balances among the programming team. For example, each department may contribute code for a nuclear inertial guidance system, but only a select few will have absolute knowledge of the entire system. This allows for greater control of the project; if information is leaked, it is easy for the company to point the finger at select individuals.

Although this may be an extreme example, 'data hiding' has more applications of a proprietary nature in order to maintain company secrets, especially if portions of the project are outsourced or sub-contracted.

Clinton Portis 211 Practically a Posting Shark

The name of this this post should be, "Challenge, Who will do my homework."

Narue commented: Indeed. +25
happygeek commented: Well said +11
Clinton Portis 211 Practically a Posting Shark

your code is very, very, very, very, very, hard to follow because you did not use code tags when you posted your code. The result is your code that is not indented, looks like regular text, and contains smiley faces.

i suspect you are trying to return a char in a function that is prototyped to return a unknown type, but that's just a guess because i can't read your code. it's too jumbled up and messy. If your function is prototyped to return a char, 'B+' for example, would exceed the capacity of a char. Suitable alternatives include use of cstrings or string class objects.

Here is an example of code that uses code tags:

#include<iostream>

using namespace std;

int main()
{
     cout << "Hello world.";

     return 0;
}

compare to posting without code tags:

#include<iostream>

using namespace std;

int main()
{
cout << "Hello world.";

return 0;
}

Clinton Portis 211 Practically a Posting Shark

We've done over 90% of the work for you... all we are asking for is a 10% effort on your part. I cannot ethically continue to work on this assignment without knowing that you will be turning in plagarized work.

Take it one step at a time. Do a little research on your own. Humor us... at least take a wild guess at how you would write the display() function.

Anything... I mean ANYTHING is better than "do it for me."

btw line #12 in the class should be

Vehicle();

my mistake.

Clinton Portis 211 Practically a Posting Shark

I see that you have went out of your way to captivate us with your innovative post and well written description of your problem. However, despite your exhaustive efforts to ask a smart question, I am still curious.. how much of your homework assignment have you completed thus far? Please, by all means, enlighten us with your prowess of the c++ language. We would all love to see the all the effort you have put into your project. Then, and only then, will we offer improvments, suggestions, and other forms of high quality c++ code (free of charge.)

Clinton Portis 211 Practically a Posting Shark

Iway agreeway ithway altPWay aboutway oundsay etectionday ithinway hetay copesay ofway ouryay sc100cay lasscay. Inway orderway otay akemay ouryay instructorway appyhay houghtay, e'llway avehay otay roceedpay underway hetay assumptionway hattay anyway ordway endingway inway "ay" illway esultray inway anway "ay" oundsay. ithWay histay inway indmay, Iway resentpay otay e'yay hetay ollwingfay odecay:

bool is_ay(string& word)
{
     int pos = word.rfind("ay");
    
     return (pos == word.size()- 2);
}

ownay ouya ancay esttay ordsway orfay hetay "ay" oundsay, if(is_ay(word)) hentay eavelay itway aloneway.

jonsca commented: Next stop, a compiler that understands PL! +5
Clinton Portis 211 Practically a Posting Shark

Whenever you want white-space delimited data extraction from file, simply use ifstream's >> insertion operator... perfect for what you are trying to do:

while(infile >> temp)
{
     myvec.push_back(temp);

     infile >> temp;
     myvec2.push_back(temp);

     infile >> temp;
     myvec3.push_back(temp);
}
Clinton Portis 211 Practically a Posting Shark

I'll make you a deal... you translate and repost your request for help into pig latin.. and I'll throw some quality c++ code your way.

SgtMe commented: LOL :L +3
Clinton Portis 211 Practically a Posting Shark

Here is how you can compare an element, against every other element.. while we are at it, we'll erase any matching words in order to get a good word count:

string temp;

//This array will contain single occurances of words from wordsM[ ]
string unique_words[length];

//This array will serve as a counter, and will directly corrospond to unique_words[ ]
int unique_counter[length];

//Array initialization (clean the trash out of the array)
for(int i=0; i<length; i++)
{
     unique_counter[i] = 0;
}

//Pick a word
for(int i=0; i<length; i++)
{
     temp = wordsM[i];

     //Compare it with every other word
     for(int j=0; j<length; j++)
     {
          if(temp.compare(wordsM[j]) && !wordsM[j].empty())
          {
               unique_words[i] = wordsM[j];
               wordsM[j].clear();
               unique_counter[i]++;
          }
     }
}

Now you have a counter that corrosponds to an array of individual words. I gave you a really good idea of how to get this done.. see if you can make it work in your code.

Clinton Portis 211 Practically a Posting Shark

Thank you Christina.

It's nice to see someone who can really pick up on this stuff and run with it. You actually required very little help on this project.

With that said, we should hook up sometime. Maybe talk some c++ over dinner. Add Dave Weirich on facebook. I am currently using a pic of Jim Mora as my profile pic.

jonsca commented: LOL +5
Clinton Portis 211 Practically a Posting Shark

I have a feeling you just did this guy's homework.. :(

Clinton Portis 211 Practically a Posting Shark

1) create an array of struct objects that will hold ID and GPA information:

struct Student
{
     int id;
     double gpa;
     
}data[50];

2) Now you can fill up your array of structs:

int size=0;
while(infile >> data[size].id)
{
     infile >> data[size].gpa;
     size++;
}

3) Now ye' can sort:

#include<algorithm>

sort(&data[0].gpa, &data[size].gpa);

4) Display your sorted data with great ease:

cout << "ID:      GPA:";
for(int i=0; i<size; i++)
{
     cout << data[i].id << "      " << data[i].gpa << endl;
}
Clinton Portis 211 Practically a Posting Shark

There might be a better way to do this, but this is just my idea:

1. determine sign of the result
2. make all cstring'd numbers positive
3. big number always goes on top
4. smaller number always goes on bottom
5. perform right-to-left subtraction just like you learned in 2nd grade.
6. apply proper sign to result

If anyone knows a better way to do this, let me know.

Clinton Portis 211 Practically a Posting Shark

The erase() function requires an iterator type argument, but i was hoping to get away with an array referrence.

Just out of curiosity, see if this works:

sV.erase(&sV[j]);

If not, this will work:

sV.erase(sV.begin() + j);
Clinton Portis 211 Practically a Posting Shark

click here for a good example on recursion.

jonsca commented: Well played. +5
Clinton Portis 211 Practically a Posting Shark

The easiest way to read diagonally through your array would be to take the procedural approach and just write out each element of the 2d array that makes up the diagonal you want to add.

But it seems like you are looking for a better method that would involve less code, using a loop. When it comes to something like this, look for a pattern. Once you've discovered the pattern, you have to make it part of your loop condition.

For example, in your [10][10] array, you start out at [0][0], then [1][1], then [2][2], then [3][3] and so on.. so we have identified a pattern; from [0][0], each subsequent element of the diagonal is [row+1][col+1]. So we can make this part of our loop condition:

int subtotal = 0;

//one diagonal
for(int i=0, i<10, i++)
{
     //increment diagonally through the array
     subtotal += array[i][i];
}

To get the other diagonal, you would start at [0][10], then go to [1][9], then [2][8], then [3][7].. etc. Initialize the element indicies to 0 and 10 and handle them appropriately in your loop condition in such a manner that will result in a diagonal summation.

Clinton Portis 211 Practically a Posting Shark

This is really a self explanitory type of assignment. Straight-forward, no exotic techniques required.

I will assume since requirement #3 mandates the use of PEMDOS precidence, requirements #1 & #2 do not; therefore, we can get away with working "left-to-right" for requirements #1 & #2.

Requirement #1: We have to assert that the user entered equation matches number of operations. If not, throw errror and back out to main menu. Push the equation into a single string object. Identify the number of operators, you could use the count() function from <algorithm>. Number of operators should equal number of operations. Parse the string into a terms[ ] string array, you can use the <string> class substr() function for string parsing. Pass each term into a user defined function that will return a 'double' type result of each term. You can use the <sstream> class to perform string-to-int conversion. Accumulate the result into a double type 'subtotal' variable. Repeat until all terms have been processed.

Requirement #2: Actually a little easier than req. #1 since we do not have to perform operators == operations assertion. Push user entered expression into a single string. Parse each expression into a token[ ] string array. Pass each token into a user defined function for processing. Use the <sstream> class to perform string-to-int conversion. Accumulate the results from each token into a double type 'subtotal' variable.

Requirement #3: Perform the same steps at req. #2 up …

kvprajapati commented: Neat & clear. Very good explanation. +11
Clinton Portis 211 Practically a Posting Shark

in your function, try the following at #17:

string temp1, temp2;

while(getline(fin, temp1))
{
     //Handle even number of lines
     if(getline(fin, temp2))
     {
          fout << temp2 << endl;
          fout << temp1 << endl;
     }
     //Handle odd number of lines
     else
     {
          fout << temp1;
     {
}
Clinton Portis 211 Practically a Posting Shark

1. if argc != 3, throw error message. exit program.
2. create an ifstream object that will handle all file reading operations.
3. create on ofstream object that will handle all file writing operations.
4. open the file using your ifstream object, using argv[0] as the file to open.
5. perform some sort of error checking to see if the file was actually opened.
6. create a new file using your ofstream object, using argv[1] as the file to create.
7. loop through the file, reading character at a time; write the char to the output file.
8. if (char_count == atoi(argv[2])) write a '\n' newline to file
9. close the ifstream object
10. close the ofstream object
11. return 0;

Clinton Portis 211 Practically a Posting Shark
//Begin loop: 0 to 40 (years)

     //Year_Total = Year_total + Monthly_payment * 12

     //If the Loop_Counter / 2 has no remainder, then it has to be a "2nd Year"
          //Monthly_payment = Monthly_payment * 1.10

//End Loop
Clinton Portis 211 Practically a Posting Shark

According to this documentation:

http://www.cplusplus.com/reference/algorithm/search/

The search() function is overloaded to provide 2 variations of the function to the user, depending on program needs; the first version takes 4 args, the second takes 5.

Clinton Portis 211 Practically a Posting Shark

1. you should #include<algorithm>

2. you create 'string line;' but then never assign anything to it..

3. so when you call search(line.begin(), line.end(), search.begin(), search.end(), nocase_compare), arguments #1 and #2 will return iterators to a string of nothing.


for more information: http://www.cplusplus.com/reference/algorithm/search/

Clinton Portis 211 Practically a Posting Shark

Hello Ms. Christina,

Let me first say that I have never done any work with .pgm files. I've just looked at some .pgm examples though, and it doesn't look too terribly difficult. However, I think we might have to put our brains together to come up with the result that ye' be looking for.

With that said, I am unclear when it comes to "subtracting the lower right and subtracts the center pixel." If you can provide me a notepad example of a .pgm file, and show me what it means to perform the subtraction, I am sure I can help you on the file I/O, array and pixel manipulation.

-Dave W.

ChristinaS commented: Fab! Thx! +2
Clinton Portis 211 Practically a Posting Shark

Just take my code above and edit to create what I asked.

would you like a side of fries with your order..

Clinton Portis 211 Practically a Posting Shark

I just threw some code your way to get you started.. maybe jog some of them brain cells. I purposely did not finish your assignment.

This was my thought process (although somewhat impaired after just comming back from a fresh concert last night featuring Axe Murder Boyz opening up for ABK):

1. create a counter that will hold student's test performance based on 5 test ranges: 0-29, 30-49, 50-69, 70-89, and 90-100. Each second-dimension element will serve as a 'counter' of how many test results qualified for each range:

//First  Dimension: [0] is the assignment, [1] is lab, [2] is test, and [3] is exam
//Second Dimension: [0] is 0-29, [1] is 30-49, [2] is 50-69, [3] is 70-89 and [4] is 90 to 100

int ranges[4][5];  

//to make our array easier to read, i'll also do the following quick little trick:
//assign = 0, lab = 1, test = 2, and exam = 3

enum{assign, lab, test, exam};

2. Now that I got a counter, I needed a function that I could plug in test information and will return which element of ranges[][] to populate:

int get_range(int& grade)
{
     if(grade < 30)
     {
          //increment ranges[][0]
          return 0;    
     }
     else if(grade >= 30 && grade <= 49)
     {
          //increment ranges[][1]
          return 1;
     }
     else if(grade >= 50 && grade <= 69)
     {
          //increment ranges[][2]
          return 2;
     }
     else if(grade >= 70 && grade <= 89)
     {
          //increment ranges[][3]
          return 3;
     }
     else
     {
           //Anything else must …
Clinton Portis 211 Practically a Posting Shark

Administrator locked out my edit:

I will be decisive and assume that you need the number of A's, B's, C's, D's, and F's for the assignment, lab, test, and exam. A's will be 100% to 90%, B's, will be 89% to 80%, C's will be 79% to 70%, D's will be 69% to 60%. F's will be below 60%:

int get_grade(int& grade, char& test)
{    
     //test: A = assignment, L = lab, T = test, E = exam

     grade /= 10;

     switch(grade)
     {
          case 10:
          case  9:  return 0;     break;
          case  8:  return 1;     break;
          case  7:  return 2;     break;
          case  6:  return 3;     break;
          default:  return 4;     break;
     }
}

int grades[5];  // A's = [0], B's = [1], C's = [2], D's = [3], F's = [4]

 inFile    >>stumarks[i].studentid >>stumarks[i].seperator>>stumarks[i].progassn
           >>stumarks[i].seperator>>stumarks[i].lab
           >>stumarks[i].seperator
           >>stumarks[i].test>>stumarks[i].seperator
           >>stumarks[i].exam;

//Populate grade statistics
grades[get_grade(stumarks[i].progassn, A)]++;
grades[get_grade(stumarks[i].lab,  L)]++;
grades[get_grade(stumarks[i].test, T)]++;
grades[get_grade(stumarks[i].exam, E)]++;
Clinton Portis 211 Practically a Posting Shark

I will be decisive and assume that you need the number of A's, B's, C's, D's, and F's for the assignment, lab, test, and exam. A's will be 100% to 90%, B's, will be 89% to 80%, C's will be 79% to 70%, D's will be 69% to 60%. F's will be below 60%:

int get_grade(studmarks& s, char& test)
{
     //test: A = assignment, L = lab, T = test, E = exam

     int grade = 0;

     switch(test)
     {
          case 'A':  grade = s.progassn / 10;  break;
          case 'L':  grade = s.lab  / 10;      break;
          case 'T':  grade = s.test / 10;      break;
          case 'E':  grade = s.exam / 10;      break;
     }

     switch(grade)
     {
          case 10:
          case  9:  return 0;     break;
          case  8:  return 1;     break;
          case  7:  return 2;     break;
          case  6:  return 3;     break;
          default:  return 4;     break;
     }
}

int grades[5];  // A's = [0], B's = [1], C's = [2], D's = [3], F's = [4]

 inFile    >>stumarks[i].studentid >>stumarks[i].seperator>>stumarks[i].progassn
           >>stumarks[i].seperator>>stumarks[i].lab
           >>stumarks[i].seperator
           >>stumarks[i].test>>stumarks[i].seperator
           >>stumarks[i].exam;

//Populate grade statistics
grades[get_grade(stumarks[i].progassn, A)]++;
grades[get_grade(stumarks[i].lab,  L)]++;
grades[get_grade(stumarks[i].test, T)]++;
grades[get_grade(stumarks[i].exam, E)]++;
Clinton Portis 211 Practically a Posting Shark

Force total user compliance: (you call it error trapping)

do{

     //stuff
     //suff
     //and more stuff

     if(is user input correct?)
     {
          //Display error message
     }

}while(user input is incorrect);

To run your program multiple times, do this:

int main()
{
     char choice = '\0';

     do{
  
          //stuff
          //stuff
          //stuff

          cout << "\nWould ye' like to try again?  (Y/N): ";
          cin >> choice;

     }while(choice == 'y' || choice == 'Y');
 
     return 0;
}

Follow these simple topologies and ye' will be good to go.

jonsca commented: Mad rep for using the word "topology" in your post +2
Clinton Portis 211 Practically a Posting Shark

This project will require you to develop three C functions:

You are asking for C help in a C++ forum. You deserved to be weeded out of the natural order of the human species. I should do your assignment in c++ and let you turn it in.

Ancient Dragon commented: Good idea :) +26
Clinton Portis 211 Practically a Posting Shark

Line #12: Initialize 'c' to 9 instead of 10.

Line #32: Initilize 'g' to 9 instead of 10.

Clinton Portis 211 Practically a Posting Shark

we need the code.

Clinton Portis 211 Practically a Posting Shark
for(int i=0; i<10; i++)
{
     cout << i;
}

for(int i=10; i>0; i--)
{
     cout << i; 
}
Clinton Portis 211 Practically a Posting Shark

Run and compile this little program. Go through it line by line. Proceed no further until you understand the basics of using a simple loop. Then when you are comfortable, do experimentation with changing the loop conditions and loop contents to make it do new and exciting things:

#include iostream
using namespace std;

int main()
{
     int lines = 0;
     char c = '\0';

     cout << "Enter number of lines: ";
     cin >> lines;

     cout << "\nEnter a character: ";
     cin >> c;

     //Learn to use simple loops
     //Don't be afraid to try new things here
     // (make it loop backwards for example)
     //Your imagination is the only limitation.
     for(int i=1; i<lines; i++)
     {
          for(int j=0; j<i; j++)
          {
               cout << c;
          }
     
          cout << endl;
     }

return 0;
}
Clinton Portis 211 Practically a Posting Shark

IS THERE A BETTER WAY TO DO IT?

Look at lines #20 through #28 in my previous post for a better way to do this.

Yes, you will have to learn to use nested loops, which I believe is the goal of your assignment.

As for the overall design of your assignment, the important pieces of your program could look like this:

display_menu();

cout << "Enter shape to draw: ";
cin >> shape_selection;

cout << "Enter character to use to draw shape: ";
cin >> char_selection;

cout << "Enter odd number of lines to draw: ";
cin >> lines;

switch(shape_selection)
{
     case 1:  draw_tri(char_selection, lines);
     break;
     case 2:  draw_upsidedown_tri(char_selection, lines);
     break;
     case 3:  draw_rectange(char_selection, lines);
     break;
     case 4:  draw_plus_sign(char_selection, lines);
     break;
     default:  menu_error();
}

//Function definitions
void draw_tri(int char_selection, int lines)
{
     //Use a nested loop to draw a triangle, line at a time, top to bottom
     //Copy and paste the triangle algorithm from my previous post
     //No thinking required.
}

void draw_upsidedown_tri(char_selection, lines)
{
     //Use a nested loop to draw an upside-down triangle
     //Refer to my previous post for a triangle drawing algorithm
     //Alter the loop conditions to draw the triangle upside-down.
}

void draw_rectangle(char_selection, lines)
{
     //draw top of rectangle
     //Using a loop, draw left side, bunch of spaces, then draw right side.  Newline each loop iteration.
     //draw bottom of rectangle
}

void draw_plus_sign(char_selection, lines)
{
     //use a loop to draw vertical top half of plus, newline each loop iteration.
     //draw the horizontal row of …
Clinton Portis 211 Practically a Posting Shark

You are losing the fact that there is an array. All the function knows is a pointer was passed in. It has no idea how many locations are associated with the pointer. You need to also pass the size into the function.

void myfunction(int array[], int array_size)
{
    //stuff
}
Clinton Portis 211 Practically a Posting Shark

Here is an in-depth discussion I googled concerning the dangers of using sizeof(array)/sizeof(arraytype) in order to get current length of an array:

http://www.gamedev.net/community/forums/topic.asp?topic_id=345898

Some alternatives to consider:

  • Dedicate a 'size' variable to hold number of entries made into an array.
  • Use null-terminated c-strings; get array length using strlen().
  • Use an STL container such as String or Vector, use a size() member function to return string length.
Clinton Portis 211 Practically a Posting Shark

You are attempting to implement the answer using a linear method. Try using a nested loop and I think you'll have the results ye' be looking for:

int lines = 0;
char c = '\0';

//Prompt for user input
do{
     cout << "\nEnter an odd number of lines of triangle to be drawn: ";
     cin >> lines;

     //Test user input
     if(! lines%2)
     {
          cout << "\n\aNumber entered is even.  Please enter an odd number.";
     }
}while(! lines%2);

cout << "\nEnter chararcter to be used to draw triangle: ";
cin >> c;

//Draw ye' precious triangle
for(int i=0; i<lines; i++)
{
     for(int j=0; j<i; j++)
     {
          cout << c;
     }
     
     cout << endl;
}
jonsca commented: Arg matey, Cap'n Portis is back +2
Clinton Portis 211 Practically a Posting Shark

Useful tips:

you can consolidate lines 13 through 33, and eliminate lines 35 through 44 by doing this:

// Initializing the eight choices.
	int iChoice1 = (rand() % 8) + 1;
	int iChoice2 = (rand() % 8) + 1;
	int iChoice3 = (rand() % 8) + 1;
	int iChoice4 = (rand() % 8) + 1;
	int iChoice5 = (rand() % 8) + 1;
	int iChoice6 = (rand() % 8) + 1;
	int iChoice7 = (rand() % 8) + 1;
	int iChoice8 = (rand() % 8) + 1;

Furthermore, keeping your choices in array format would continue to simplify your code:

int choices[8];

for(int i=0; i<8; i++)
{
     choices[i] = (rand()%8) + 1;
}