NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package com.codington.module6;
public class RidesDetails
{
/**
*
* Topic: Inheritance in Java
* Activity to implement inheritance concepts. *
* Instructions:Code as per TODOs.
*/
// Main method for entry point of RidesDetails program.
public static void main(String[] args)
{
//TODO 1. Create an instance of the ZOO class by invoking a parameterized constructor
// and passing a double type argument 12.45.
Zoo z1 = new Zoo(12.45);

//TODO 2. Set zoo animals details by setting the no of animals attribute to 6.
z1.setNoAnimalVal(6);

//TODO 3. Set zoo animals details by setting the animals names by following below instructions.
// a Declare a string array and initialize it with animal names like Lion, African Elephants,Australian
// Kangaroos,Giraffe,Deer,Rhinoceros.
// b Invoke setAnimalNames method to zoo class and pass zooAnimals string array.
// c Set the zooAnimals string array value to null.
String[] animalNames = new String[6];
animalNames[0] = "Lion";
animalNames[1] = "African Elephants";
animalNames[2] = "Australian Kangaroos";
animalNames[3] = "Giraffe";
animalNames[4] = "Deer";
animalNames[5] = "Rhinoceros";

//TODO 4.Create an instance of the Safari class.
Safari s1 = new Safari();

//TODO 5. Set values for Safari class attribute, SafariCost to 2500.
s1.setSafariCost(2500);

//TODO 6. Set values for Safari class attribute, SafariDescription to Night Safari.
s1.setSafariDescription("Night Safari");

//TODO 7. Set values for Safari class attribute, safari duration to 45.
s1.setSafariDuration(45);

//TODO 8. Set values for Safari class attribute, safari name to South Codington Safari.
s1.setSafariName("South Codington Safari");

//TODO 9. Call setSafari() method of Zoo class by passing the Safari class object populated in above step.
z1.setS1(s1);

//TODO 10. Call setServiceTax() method of Zoo class by passing a double value 20.50.
z1.setServiceTax(20.50);

//TODO 11. Call assignRideCategory() method of Zoo class.
z1.assignRideCategory();

//TODO 12. Invoke getAnimalNames() method of zoo class and assign return value to instance variable zooAnimals.
z1.getAnimalNames();

//TODO 13. Display animal details by looping through the string array zooAnimals.
for(int i = 0; i < animalNames.length; i++)
{
System.out.print(animalNames[i] + "n");
}

//TODO 14. Display rides category zoo details by invoking getRideDetails() method.

z1.getRideDetails();

//TODO 15. Display rides safari details by invoking getSafari() method.
z1.getSafari();

//TODO 16. Display zoo fare by invoking calculateFare() method.
z1.calcFare();
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.