Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners MovieRating class

Have Programming Question? Ask it here!
 
 
 


Robby
MovieRating class
2 Answer(s)      5 years and 10 months ago
Posted in : Java Beginners



Advertisement
View Answers

October 16, 2008 at 3:13 PM


Hi Friend,

"Human.java"
abstract class Human
{
Human() { }
Human(String str) { }
abstract boolean canWatchMovie(String MovieRating);
}

There is some missing in the Code in class Family :

class "Dog","Cats","Rabbit" not available.

public class Family
{
private Dog ourDog;
private Cats ourCat;
private Rabbit ourRabbit;
private Adult adults;

}

Thanks


October 16, 2008 at 6:09 PM


Sorry for not including the Rabbit,Cats and Dog classes. They work correctly. My major problem starts from Question 11 to 15, that's where the program is not flowing for me.

//Rabbit class

class Rabbit extends Mammal
{
protected String rabbit_color,eye_color,earShape,MyRabbitType;
public Rabbit(String name )
{
super(name);
this.rabbit_color="";

}
@Override
public void makeSound()
{
System.out.print(name+" Oooops ");
}
@Override
public void eat()
{
System.out.print("Some food please...");

}
// some unique characteristics of the rabbit
protected void setRabbitColor(String color)
{
rabbit_color = color;
}
protected void earShape(String shape)
{
earShape=shape;
}
protected void seteyeColor(String color)
{
eye_color=color;
}
protected void rabbitType(String rabType)
{
MyRabbitType=rabType;
}


}


//Cats class

class Cats extends Mammal
{
protected String cat_color,miewSound,catClaw, MyCatType;
public Cats(String name)
{
super(name);
this.cat_color="";

}
@Override
public void makeSound()
{
System.out.print(name+" Oooops ");
}
@Override
public void eat()
{
System.out.print("Some food please...");

}
// Unique properties of a cat
protected void setCatColor(String color) // cats colour
{
cat_color = color;
}
protected void miew(String sound) // cats sound
{
miewSound=sound;
}
protected void clawSize(String size) // size of the claw
{
catClaw=size;
}
protected void catType(String catType) // the cat type/category
{
MyCatType=catType;
}


}


//Dog class

class Dog extends Mammal
{
protected String dog_color,dogBark, MydogType;
public Dog(String name )
{
super(name);
this.dog_color="";

}
@Override
public void makeSound()
{
System.out.print(name+" Oooops ");
}
@Override
public void getOlder(int years)
{
age += years;
}
@Override
public void eat()
{
System.out.print("Some food please...");

}

protected void setDogColor(String color) // Dog Color e.g brown
{
dog_color = color;
}
protected void barkingSound(String bark) // Barking sound
{
dogBark=bark;
}
protected void dogType(String dogType) // Dog type e.g Bulldog
{
MydogType=dogType;
}

}


I hope that will complete the picture. But my main concern is the addMovieGoers(), canWatchMovie() methods and how to call them.


Related Tutorials/Questions & Answers:
MovieRating class - Java Beginners
the movie rating. 12.Create a MovieRating class that contains a private map.... //MovieRating class import java.util.*; public class MovieRating { private Map...(); int cAge = Integer.parseInt(temp); //MovieRating class
class
class  Is a class a subclass of itself
Advertisements
class
is a class to represent a country in medal tally. It has an attribute of country... medals. In this class, you should also define constructors, and assessor, mutator methods. Task 2 MedalTally.java is a class to model a medal tally, containing
Class
Class, Object and Methods       Class : Whatever we can see in this world all the things... is termed as a class. All the objects are direct interacted with its class
Movie and Cinema class - Java Beginners
: Question: 1. Create a new Movie class which has two properties, title and rating. 2. Create a new Cinema class, add method addMovieGoers which... not take any arguments.(---DONE---) Your Cinema class should also have a setMovie
Super class of an Exception class
Super class of an Exception class  hello,,, What is super class of an Exception class?   hii,, the super class of an exception is throwable class. and the super class of an throwable class is the object class
Class
Class       This section explores the concept of a class in reference to object oriented programming techniques. A class defines the properties of  objects and methods used
Explain final class, abstract class and super class.
Explain final class, abstract class and super class.  Explain final class, abstract class and super class.   Explain final class, abstract class and super class. A final class cannot be extended. A final class
class file
class file  How to create class file in jsf easily
class loaders
class loaders   Explain static and dynamic class loaders
.class and .tld
.class and .tld  how to create .class and .tld file
inner class
inner class  what is mean by inner class   Inner class is a non-static class which is defined inside another class
Node class
Node class   hii, What is a node class?   hello, A node class is a class that has added new services or functionality beyond the services inherited from its base class
Matrix Class
Matrix Class   A class to manage matrices and add them. Create in the driver class two objects of it and use the add method
Matrix Class
Matrix Class   A class to manage matrices and add them. Create in the driver class two objects of it and use the add method
wrapper class
wrapper class  list wrapper class methods
wrapper class
wrapper class  wrapper class methods
printstrim class
printstrim class  discribe PrintStream class
printstrim class
printstrim class  discribe PrintStream class
Abstract class
Abstract class  what is an Abstract class
Abstract class
Abstract class  Can an abstract class be final
singleton class
singleton class  What is singleton class
Locale class
Locale class  What is the Locale class
immutable class
immutable class  How to make a class immutable
Java class
Java class  What is the purpose of the Runtime class
lock on a class
lock on a class  hello, Can a lock be acquired on a class?   hiii,, Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object
objective c extending a class with a class
objective c extending a class with a class  I need an example for extending a class with a class in objective c. thanks
objective c extending a class with a class
objective c extending a class with a class  I need an example for extending a class with a class in objective c. thanks
Nested class
Nested class  What is nested class?  when a class is defined within another class then such a class is called a nested class. Nested... readable and maintainable code. class OuterClass { ... static class
robot class
robot class  please send me uses of robot class and some examples using robot class
wrapper class
wrapper class  why wrapper class does not have a default constructor
super class
super class  which is the super base class in java
create a class
create a class  plz provide any example related to class
class file
class file  how to convert java classfile into java sourcefile
Adapter Class
Adapter Class  Hello Everybody, Can anybody help me to describe what is Adapter class and when to use this class and give a suitable example... visit the following links: What is Adapter Class Example of Adapter Class
java.sql.DriverManager class
java.sql.DriverManager class  Why isn't the java.sql.DriverManager class being found
abstract class
abstract class  Can there be an abstract class with no abstract methods
Wrapper Class
Wrapper Class  what is wrapper class in java and why we use it   Hi Friend, Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g.
abstract class
abstract class  abstract class AbstractClass{ } is possible and compile the class or any compile time error occur tell me the answer Blockquote
Dictionary class
Dictionary class  hello,, What is the Dictionary class?   hii,, The Dictionary class provides the capability to store key-value pairs
GregorianCalendar class
GregorianCalendar class   hello,, What is the GregorianCalendar class?   hii, The GregorianCalendar provides support for traditional Western calendars
Inner class
Inner class  how can i call outer class A `s method to print Outer. class A { void m() { System.out.println("outer"); } } public class TestInners { public static void main(String[] args) { new
abstract class
abstract class   Explain the concept of abstract class and it?s use with a sample program.   Java Abstract Class An abstract class is a class that is declared by using the abstract keyword. It may or may not have
Sealed class
between sealed class and dynamic classes? Please give me an example of each class Thanks  Ans: Dynamic class: Specifies that instances of a class may possess dynamic properties added at run time. Sealed class: Sealed
Sealed class
Sealed class  Hi........ What are sealed class? Please give an example Thanks  Ans: Sealed class: Sealed classes conserve memory..., and the compiler can provide better error feedback. The class which is not dynamic
Class Loader
Class Loader  What is class loader? Explain in detail.   The Java ClassLoader is a an abstract class which extends the Object class. Java class loader is a part of the Java Runtime Environment that dynamically loads
Class Loader
Class Loader  What is class loader? Explain in detail.   The Java ClassLoader is a an abstract class which extends the Object class. Java class loader is a part of the Java Runtime Environment that dynamically loads
java class
java class  write a java program to display a msg "window closing" when the user attempts to close the window.(a) create a window class (b) create frame within the window class (c) extends window adapter class to display the msg
class and Object
class and Object  how many classes,References and objects in this following statement.... A a=new B();   Hi, In the statement: A a=new B(); There are 2 classes, Class A and Class B. References : 1 (Object of B
class name
class name  how to create a class named box thaT INCLUDES integer data fields for length,width,and height, include three contructors that require one,two,three arguments
 

 

 

DMCA.com