Vectors and while loop.

Hello I have to create a program which allows the user to enter the type, number, size and aggression of how ever many types of fish they have and then calculate how large of a fish tank they would need. The problem I am having is when the user enters another type of fish, the program works fine if they have one type of fish. The only way I can think of to let them enter a new type of fish type, number, size and aggression is to re write the whole code with different variables.
This is what I have so far any advice would be greatly appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <iostream>      // for cout and cin 
#include <string>
#include <vector>
#include <iomanip>
using namespace std;

int main()
{
	cout << " Christian Seely"
		 << "\n Project 3"
		 << "\n The objective of this project is to find the user a fish tank that is in stock,"
		 << " based on the number, type, size and agression of the fish.";
	string answer1;
	
	int GallonsOfWater;
	while (answer1 == "yes" ||  answer1 == "Yes" || answer1 == "y" || answer1 == "Y");
	{
	vector<string>VFish;
	VFish.push_back("Neon Tetras");
	VFish.push_back("Clown Loaches");
	VFish.push_back("Betta Fish");
	VFish.push_back("Koi Angel");
	VFish.push_back("Checkerboard Discus");

	cout << " \n\nPlease enter the numeric value which corresponds with the type of fish you wish to purchase.";
	for (int i = 0; i < VFish.size(); ++i)
		cout << "\n" << i + 1 << setw(20) << VFish.at(i);
	    cout << " \nType of fish:   ";
		int TypeOfFish;
		cin >> TypeOfFish;
		cin.ignore();

cout << " \n\n Please enter the number of the type of fish selected."
	 << "\n Number:    ";
    int input = 0;
	int input2 = 0;
	vector<int>VNumberOfFish;
	cin >> input;
	cin.ignore();
	VNumberOfFish.push_back(input);
	
cout << "\n\nPlease enter the numeric value in half inch increments of the size of fish"
		 << "\n that you are purchasing, range of the size is from .5 inches to 6 inches."
		 << "\n Size of fish:    ";
		int SizeOfFish = 0;
	vector<double>VFishSize;
	cin >> SizeOfFish;
	cin.ignore();
	VFishSize.push_back(SizeOfFish);

	cout << "\n Are your fish agressive?"
		 << "\n Please enter a 'Y' for yes or a 'N' for no:     ";
	string aggression;
	getline(cin,aggression);
	
if ( aggression == "yes" || aggression == "Yes" || aggression == "Y" || aggression == "y")
    {
	GallonsOfWater = (SizeOfFish * 3 * input);
	cout << GallonsOfWater;
	}
if ( aggression != "yes" || aggression != "Yes" || aggression != "Y" || aggression != "y")
{

	GallonsOfWater = (SizeOfFish * 2 * input);
	
}
	cout << "\n\nWould you like to select another type of fish?     ";
		getline(cin,answer1);	
if (answer1 == "no" || answer1 == "No" || answer1 == "n" || answer1 == "N")
{
string TypeOfTheFish;
int index = 0;
cout << "\n\n Type of Fish         Number        Adult Size (in inches)\n\n";
cout <<" "<< VFish.at(TypeOfFish -1);
cout << "          "<<input<<"                "<< SizeOfFish << "\n\n";
cout << "\n\n    Aggressive:   " <<aggression;
cout << "\n    Total Fish Length:    " <<SizeOfFish;
cout << "\n    Minimum Required Gallons:    " << GallonsOfWater;
cout << "\n    Min Tank Size:    ";
if (GallonsOfWater <= 80)
{
	if ( GallonsOfWater >= 1 && GallonsOfWater <= 20 )
    {
		int SizeOfTank = 20;
		cout << " 20 gallons\n\n";
    }
	if ( GallonsOfWater >= 21 && GallonsOfWater <= 40)
	{ 
		int  SizeOfTank = 40;
		cout << " 40 gallons\n\n";
	}
	if ( GallonsOfWater >=41 && GallonsOfWater <=60)
	{
		int SizeOfTank= 60;
		cout << " 60 gallons\n\n";
	}
	if ( GallonsOfWater >=61 && GallonsOfWater <=80)
	{
		int SizeOfTank = 80;
		cout << " 80 gallons\n\n";
	}
}
}
	else
	{
		cout << "\n We do not carry a tank large enough for that";
	}

	}
return 0;	
}
use a struct or class to create a fish object with all the properties you mentioned in your code.
Sorry I don't exactly know what your saying, we have not reached creating classes in the course i'm taking yet.
Topic archived. No new replies allowed.