Exercises
All is going great in our lovely dinosaur park. However, we do need to do some administrative tasks:
- We need to keep track of the dinosaurs in the park. Declare variables to represent the breed, height, length, and weight of one dinosaur in the main method. Give the variables a value and print them.
- Now, we want to do something similar to the program of exercise 1 and print the dinosaur’s age, name, and whether it’s a carnivore or not. This needs to happen in the main method. Give the variables a value and print them.
- Our park is doing great! But it gets a bit too busy at times. The fire department advised us to introduce a maximum number of visitors that are allowed at any given time. Declare a variable to represent the maximum number of visitors allowed in the park per day. You can choose a reasonable value for the variable. Then, print it in the sentence: “There’s a maximum of [x] people allowed in Mesozoic Eden.” ...