I'm trying to make the type of animal a char array and make the charge a double, how do I about this? Everytime I run my code, it always loops, continuously once I answer "Enter type of animal" and I have to exit out of program in order for it to stop. I just need the output to be in three columns: Tracking Number, Type of Animal and Boarding Charge.
Please Enter the Tracking Number:
1
Please Enter the Animal:
a
Please enter the Boarding Charge:
11
Would you like to enter more information?
Enter 'Y' or 'N'
N
____________________________________________________________________________
Please Enter the Tracking Number:
1
Please Enter the Animal:
a
Please enter the Boarding Charge:
11
Would you like to enter more information?
Enter 'Y' or 'N'
Y
Please Enter the Tracking Number:
2
Please Enter the Animal:
b
Please enter the Boarding Charge:
22
Would you like to enter more information?
Enter 'Y' or 'N'
N
____________________________________________________________________________
Line 10,23,56: Animal and InitAnimal allow only a single character. However your formatting at line 78 appears to expect animal to be up to 25 characters wide. If you want more than one character, then you need to declare a character array:
char Animal[26]; // Allow space for trailing null
As your code is, if you enter more than a single character at line 32, the extra characters will remain in the input buffer and cause the cin at line 34 to fail.
Line 59: You can't assign character arrays that way. I asked in your other thread why you can't use std::string. std::string is easier and safer to use than character arrays. You still have an include for <string> at line 3.