Course Solutions Uncategorized (Solved) : First Statement Im Trying Iterate Pname 0 Run Enter Ages Else Run Enter Age 1 Age Runs X T Q38012900 . . . .

(Solved) : First Statement Im Trying Iterate Pname 0 Run Enter Ages Else Run Enter Age 1 Age Runs X T Q38012900 . . . .

 

In my first if statement, Im trying to iterate, if pName > 0,then run “enter the ages” else run “Enter the age” (for only 1age)

//Runs X times(consticted by pAmount) obtaining name(s) andage(s)
   for (int i = 0; i < pAmount; i++)
   {
       cout << “Enter thename(s):”;
       getline(cin, pName);

       if (pName > 1)
       {
           cout <<“Enter the age:”;
           cin >>age;
          cin.ignore();
       }
       else
       {
           cout <<“Enter the age:”;
           cin >>age;
          cin.ignore();
       }

       p[i].setName(pName);  //Saves names in array
       p[i].setAge(age);      //Saves the ages in

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post