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
|
#include <iostream>
#include <string>
#include <time.h>
void DayOne();
constexpr int BunnyStart = 5;
class RandomizeDetails{
public:
std::string FirstName(){
std::string NameArray[] = {"Thumper","Oreo","Coco","Snowball","Marshmello","Bugzy","Midnight"};
int Random = rand() % 7;
std::string TheName = NameArray[Random];
return TheName;
}
int Age(){
int AgeArray[] = {0,1,2,3,4,5,6,7,8,9};
int Random = rand() % 10;
int TheAge = AgeArray[Random];
return TheAge;
}
};
int main(){
srand(time(0));
DayOne();
}
void DayOne(){
RandomizeDetails Random;
for(int i = 0; i < BunnyStart; i++){
std::string NameBunny[i] = Random.FirstName();
std::cout << "Name: " << NameBunny[i] << std::endl;
std::cout << "Age: " << Random.Age() << "\n\n";
}
}
|