Search Results

Showing results 1 to 23 of 23
Search took 0.00 seconds.
Search: Posts Made By: Achupa ; Forum: Java and child forums
Forum: Java Nov 12th, 2008
Replies: 8
Views: 758
Posted By Achupa
How do I do this on the Human class? It's proving hard for me. And remember the "instanceof" part of it
Forum: Java Nov 12th, 2008
Replies: 8
Views: 758
Posted By Achupa
How about the "instanceof" ? How can I create array of limbs and use the instanceof?
Forum: Java Nov 12th, 2008
Replies: 8
Views: 758
Posted By Achupa
Hi, I have an assignment that's giving me some problem:


My code for the Human class is as:

import java.util.*;
public abstract class Human extends Mammal
{
int MyAge,Age;
String...
Forum: Java Nov 10th, 2008
Replies: 5
Solved: Cinema
Views: 474
Posted By Achupa
How do I add more scenarios? does it mean adding another try catch block?
Forum: Java Nov 10th, 2008
Replies: 5
Solved: Cinema
Views: 474
Posted By Achupa
Hi, I had posted this question before and I did appreciate the response I got. However I still need some little help as:
1.In the addMovieGoers method check that every member of the collection is a...
Forum: Java Nov 4th, 2008
Replies: 11
Views: 803
Posted By Achupa
look at the method below
public void addMovieGoers(Human h) throws IllegalAgeException
{
Human a = new Adult("Joe",43);
Human b = new Adult("Sue",39);
Human c = new...
Forum: Java Nov 4th, 2008
Replies: 11
Views: 803
Posted By Achupa
How do I do that, I'm a little green in java and your help so far is appreciated. Can you just show me how to do it?
Forum: Java Nov 3rd, 2008
Replies: 11
Views: 803
Posted By Achupa
okay, I've modified my Cinema class to look like this

import java.util.*;
public class Cinema
{
float cost;
String Title;

String mrPG="PG";
String mrA="A";
Forum: Java Nov 3rd, 2008
Replies: 3
Views: 1,114
Posted By Achupa
Hi, can someone help me modify this code to achieve the following:
Add methods to your Human that return collections of arms and legs. implement these methods by iterating through the collection of...
Forum: Java Oct 28th, 2008
Replies: 2
Views: 515
Posted By Achupa
Can someone help me modify the code below to do the following:
Ensure that your mammal has a private property which is an collection of limbs and protected methods to add, remove and retrieve the...
Forum: Java Oct 27th, 2008
Replies: 8
Views: 554
Posted By Achupa
Looking at my code, is this comment true:

You have not instatiated the limbs list, how can you then call its add() method
- You are trying to cast a List into a Limb. this cant work.

and if...
Forum: Java Oct 27th, 2008
Replies: 8
Views: 554
Posted By Achupa
thanks, i've corrected it.

I have another problem with a List in a class called Mammal. The code is like this:

import java.util.*;
public abstract class Mammal
{
Head head;
char...
Forum: Java Oct 27th, 2008
Replies: 8
Views: 554
Posted By Achupa
aah! its seems we're not communicating! You are complicating the code further. My question was how to modify this part of my code Child[] children = {new Child("Frank",10), new Child("Lisa",18)};
...
Forum: Java Oct 27th, 2008
Replies: 8
Views: 554
Posted By Achupa
Hi, I have a small question regarding arrays. I have the class Family below:

import java.util.ArrayList;
import java.util.Collection;
import java.io.*;
public class Family
{

private...
Forum: Java Oct 27th, 2008
Replies: 3
Views: 401
Posted By Achupa
okay, I've created my exception class as:


public class MyException extends Exception
{
String exception;
public MyException()
{
super();
exception="Unknown";
Forum: Java Oct 27th, 2008
Replies: 3
Views: 401
Posted By Achupa
Hi, I have a Cinema class as shown in the code below. However I'm required to create my own exceptions and pass them to the controlling module (here method with scenarios). After an exception occurs...
Forum: Java Oct 24th, 2008
Replies: 6
Views: 1,831
Posted By Achupa
The rating is to be picked from the Map in MovieRating class, because there are some movies which can oly be watched by Adults or Children of certain age. I hope it's not confusing.
Forum: Java Oct 24th, 2008
Replies: 6
Views: 1,831
Posted By Achupa
well there's a getMovieGoers method in the Family class that takes a rating as a parameter and returns a collection of all the family members that can watch the movie. This method is to be called in...
Forum: Java Oct 24th, 2008
Replies: 6
Views: 1,831
Posted By Achupa
MovieRating class


import java.util.*;

public class MovieRating
{
private Map ageMap = new HashMap();
private String movieRating;
public MovieRating()
Forum: Java Oct 24th, 2008
Replies: 6
Views: 1,831
Posted By Achupa
Hi, I'm trying to use a map in my application. the class MovieRating which contains the map is as below:

import java.util.*;

public class MovieRating
{
private Map ageMap = new...
Forum: Java Oct 23rd, 2008
Replies: 1
Views: 319
Posted By Achupa
Thank you for your previous help. However I have another question:
I have three classes MovieRating class, Adult class, and Child class.
The Child class and Adult class both have a method...
Forum: Java Oct 23rd, 2008
Replies: 3
Views: 357
Posted By Achupa
Thanks that's perfect. However is there a way of checking the age also and comparing it to some predefined age inside the if() tag, for example:

if ( test instanceof Adult && age>=minAge)
...
Forum: Java Oct 23rd, 2008
Replies: 3
Views: 357
Posted By Achupa
Hi, I have a method that checks whether Objects in a Collection are Human and whether they are of certain age. I have three different classes for Human, Adult and Child. the code for the method is...
Showing results 1 to 23 of 23

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC