public bool filmAnimal(Animals animal) { //we want to film animals and the stuff they do, so we find them first in order to do so /*bool found = true; * * if(!found) * { * //look for animal * Console.WriteLine("Searching for animal to film..."); * * }*/ //Animals animal = new Animals(); Video video; Console.WriteLine("What will be the title of this video (type rough draft if uncertain): "); video.title = Convert.ToString(Console.ReadLine()); Console.WriteLine(); Console.WriteLine("Who is(are) the filmmaker(s)? : "); video.filmmakers = Convert.ToString(Console.ReadLine()); Console.WriteLine(); Console.Write("What one animal by species name would you like to film? (Type something like gazelle, giraffe, etc. : "); String speciesName; speciesName = Convert.ToString(Console.ReadLine()); animal.species_name = speciesName; video.animalsFilmed = animal.species_name; Console.WriteLine(); //Console.WriteLine("Okay, let's search for {0}...", animal.species_name); //I wonder if I need to ask for the type of the animal and everything else...I guess I could ask for where the animal will be filmed and probably when... //to identify the animal for the time being, let's ask for the name of the animal /*Console.WriteLine("What is the name of the animal to film? : "); * animal.name = Convert.ToString(animal.name);*/ Console.WriteLine("Where are we filming this animal? : "); video.location = Convert.ToString(Console.ReadLine()); Console.WriteLine(); Console.WriteLine("In what natural environment are we filming this animal? : "); /*String habitat; * habitat = Convert.ToString(Console.ReadLine()); * animal.setHabitat(habitat);*/ //animal.habitat.ToString() = habitat; // Colors colorValue = (Colors) Enum.Parse(typeof(Colors), colorString); String habitatValue; habitatValue = Convert.ToString(Console.ReadLine()); //Parse(habitats, habitat); habitats habitat = (habitats)Enum.Parse(typeof(habitats), habitatValue); animal.setHabitat(habitat); video.environment = habitatValue; Console.WriteLine(); Console.WriteLine("When are we filming this animal? : "); /*String timeOfDay; * timeOfDay = Convert.ToString(Console.ReadLine()); //morning, afternoon, night*/ video.date = Convert.ToString(Console.ReadLine()); Console.WriteLine(); Console.WriteLine("How long will the video of this animal be? : "); video.duration = Convert.ToString(Console.ReadLine()); Console.WriteLine(); Console.WriteLine("Off we go!\n"); animal.filmed = true; Console.WriteLine(); Console.WriteLine("Animal has been filmed.\n"); return(animal.filmed); }
static void Main(String[] args) { /* Animals class needs at least two constructors, a struct, at least 5 member variables, methods or functions, private variables, getter and setter, and instances of the class. * Main method has to be in different class (other file). Use enum for the classification of the animal*/ //Animals elephant = new Animals(elephant, mammal, Rose, grassland, herbivore, false, diurnal); //so it's like we've come across an animal, we are observing her or him, and then we are deciding to film her/him Animals animal = new Animals(); Console.WriteLine("What is the species name of the animal (elephant, duck, or what)? : "); animal.setSpeciesName(Convert.ToString(Console.ReadLine())); Console.WriteLine(); Console.WriteLine("Animal type (mammal, bird, reptile, etc.)? : "); String theType; theType = Convert.ToString(Console.ReadLine()); Animals.animalTypes animalType = (Animals.animalTypes)Enum.Parse(typeof(Animals.animalTypes), theType); animal.setAnimalType(animalType); //habitats habitat = (habitats)Enum.Parse(typeof(habitats), habitatValue); Console.WriteLine(); /*Console.WriteLine("Name of animal? : "); * animal.setName(Convert.ToString(Console.ReadLine())); * * Console.WriteLine();*/ Console.WriteLine("Habitat? : "); String theHabitat; theHabitat = Convert.ToString(Console.ReadLine()); Animals.habitats habitat = (Animals.habitats)Enum.Parse(typeof(Animals.habitats), theHabitat); animal.setHabitat(habitat); Console.WriteLine(); Console.WriteLine("What type of eater is this animal? : "); String eatingType; eatingType = Convert.ToString(Console.ReadLine()); Animals.Eaters typeOfEater = (Animals.Eaters)Enum.Parse(typeof(Animals.Eaters), eatingType); animal.setTypeOfEater(typeOfEater); Console.WriteLine(); Console.WriteLine("Has this animal been filmed yet? : "); String isFilmed; isFilmed = Convert.ToString(Console.ReadLine()); if (isFilmed == "yes" || isFilmed == "Yes") { animal.setFilmed(true); } else { animal.setFilmed(false); } Console.WriteLine(); Console.WriteLine("Is this creature diurnal, nocturnal, crepuscular, or cathemeral? : "); String activityTimeType; activityTimeType = Convert.ToString(Console.ReadLine()); //habitats habitat = (habitats)Enum.Parse(typeof(habitats), habitatValue); Animals.active whenActive = (Animals.active)Enum.Parse(typeof(Animals.active), activityTimeType); animal.setWhenActive(whenActive); Console.WriteLine("-------------------------------------------------------------"); Console.WriteLine(); //display the new animal animal.DisplayAnimal(animal); Console.WriteLine(); animal.Fly(animal); animal.Swim(animal); animal.filmAnimal(animal); Console.ReadKey(); }