Results 1 to 20 of 23
- 08-24-2011, 10:07 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
Print Parts Of An Array [User Input]
Hi All,
I am learning Java and am still quite new to it.
I am going through a book (Head First Java) and have decided to go a bit further on an exercise.
Its just a bit of fun, but a good learning one for me anyway!! :)
I want to produce a Java Program that relies on user input, so that when they input a number from the array, it will print certain details. In this case, a Movie name, its Star and the Movie Plot.
If I show you what I have done so far hopefully someone can help me.
Many thanks!!
Java Code:/** * Write a description of class Movies here. * * @author (your name) * @version (a version number or a date) */ import java.util.Scanner; class Movies { String title; String staring; String plot; } class MoviesTestDrive { public static void main (String[] args){ Scanner in = new Scanner(System.in); System.out.print("Please enter a number between 1 and 5 for a Movie: "); Movies [] myMovies = new Movies[5]; //Declare the Array!! int x = 0; myMovies[0] = new Movies(); myMovies[1] = new Movies(); myMovies[2] = new Movies(); myMovies[3] = new Movies(); myMovies[4] = new Movies(); myMovies[0].title = "Commando"; myMovies[1].title = "Predator"; myMovies[2].title = "The Terminator"; myMovies[3].title = "Rambo"; myMovies[4].title = "The Expendables"; myMovies[0].staring = "Arnold Schwarzenegger"; myMovies[1].staring = "Arnold Schwarzenegger"; myMovies[2].staring = "Arnold Schwarzenegger"; myMovies[3].staring = "Sylvester Stallone"; myMovies[4].staring = "Sylvester Stallone"; myMovies[0].plot = "A retired special agent named John Matrix led an elite unit and has left the armed forces to live in a secluded mountain home with his daughter Jenny. But now he is forced out of retirement when his daughter is kidnapped by a band of thugs intent on revenge! Unbeknownst to Matrix, the members of his former unit are being killed one by one. Even though Matrix' friend General Franklin Kirby gives Matrix armed guards, attackers manage to kidnap Matrix and Jenny. Matrix learns that Bennett, a former member of his Matrix' unit who was presumed dead has kidnapped him to try to force Matrix to do a political assassination for a man called Arius (who calls himself El Presidente), a warlord formerly bested by Matrix who wishes to lead a military coup in his home country. Since Arius will have Jenny killed if Matrix refuses, Matrix reluctantly accepts the demand."; myMovies[1].plot = "A team of special force ops, led by a tough but fair soldier, Major 'Dutch' Schaefer, are ordered in to assist CIA man, George Dillon, on a rescue mission for potential survivors of a Helicopter downed over remote South American jungle. Not long after they land, Dutch and his team discover that they have been sent in under false pretenses. This deception turns out to be the least of their worries though, when they find themselves being methodically hunted by something not of this world."; myMovies[2].plot = "A cyborg is sent from the future on a deadly mission. He has to kill Sarah Connor, a young woman whose life will have a great significance in years to come. Sarah has only one protector - Kyle Reese - also sent from the future. The Terminator uses his exceptional intelligence and strength to find Sarah, but is there any way to stop the seemingly indestructible cyborg ?"; myMovies[3].plot = "Vietnam veteran John Rambo has survived many harrowing ordeals in his lifetime and has since withdrawn into a simple and secluded existence in Thailand, where he spends his time capturing snakes for local entertainers, and chauffeuring locals in his old PT boat. Even though he is looking to avoid trouble, trouble has a way of finding him: a group of Christian human rights missionaries, led by Michael Burnett and Sarah Miller, approach Rambo with the desire to rent his boat to travel up the river to Burma. For over fifty years, Burma has been a war zone. The Karen people of the region, who consist of peasants and farmers, have endured brutally oppressive rule from the murderous Burmese military and have been struggling for survival every single day. After some inner contemplation, Rambo accepts the offer and takes Michael, Sarah, and the rest of the missionaries up the river. When the missionaries finally arrive at the Karen village..."; myMovies[4].plot = "Barney Ross leads the 'Expendables', a band of highly skilled mercenaries including knife enthusiast Lee Christmas, martial arts expert Yin Yang, heavy weapons specialist Hale Caesar, demolitionist Toll Road and loose-cannon sniper Gunner Jensen. When the group is commissioned by the mysterious Mr. Church to assassinate the merciless dictator of a small South American island, Barney and Lee head to the remote locale to scout out their opposition. Once there, they meet with local rebel Sandra and discover the true nature of the conflict engulfing the city. When they escape the island and Sandra stays behind, Ross must choose to either walk away and save his own life - or attempt a suicidal rescue mission that might just save his soul."; } }
- 08-24-2011, 10:37 PM #2
I think you have have an ok start. Think about what you are trying to do. Java is Object Oriented, so you can model just about anything as an Object. I think it would make more sense to create a Movie object and that might help you understand Java more too. Think about a Movie. You know the movie has a plot, a star, a title, and in this case, we will give it an id. So here is what a Movie Object might look like:
The first part of this code is the constructor:Java Code:public class Movie{ String title; String starring; String plot; int id; public Movie(String title, String starring, String plot, int id){ this.title = title; this.starring = starring; this.plot = plot; this.id = id; } public void setTitle(String title){ this.title = title; } public void setPlot(String plot){ this.plot = plot; } public void setStarring(String starring){ this.starring = starring; } public void setId(int id){ this.id = id; } public String getStarring(){ return starring; } public String getTitle(){ return title; } public String getPlot(){ return plot; } public int getId(){ return id; } }
The constructor helps you to create an instance of your Movie class. So, when you want to create a new instance of a Movie you would do so with:Java Code:public Movie(String title, String starring, String plot, int id){ this.title = title; this.starring = starring; this.plot = plot; this.id = id; }
So what you have done with that 1 line of code is created a new instance of a Movie, and defined all 4 of those properties. So in your program, once you get back the id from the user that they enter, you can use your getters that are a part of the Movie class, and return any piece of data you want. So let's say they enter a 1 (for Commando), and you wan't to get back just the plot. You would call getPlot:Java Code:Movie commando = new Movie("Commando", "Arnold Schwarzenegger", "The Plot of the Movie", 1);
So now you have a string called theplot that holds the plot of the movie, and you can print that out to the user.Java Code:String theplot = commando.getPlot();
Does that make sense?Last edited by sehudson; 08-24-2011 at 10:54 PM.
- 08-24-2011, 10:42 PM #3
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
You are not using the variable x so get rid of it: variables should have descriptive names (like your myMovies) and should actually be used somewhere lest they be clutter.
If I understand your problem, it boils down to
(1) Get an index value from the user
(2) Print things from the movie at that index value
For (1) have a look at the Scanner methods for something that will return you an int value to be used as the index.
Once you have that value (2) is easy:
[Edit] These suggestions are independent of whether you go for an object oriented approach. (Something which looks better and better as you develop your program along the lines of multiple searches, data held outside the program which you might want to edit etc). If you do go for using a Movie class, then make the instance variables private unless you have a really good reason not to. Also think about what you want your class to be (or do: often we think of them in terms of their behaviour). For instance does a movie change its title? If not, then a setTitle() method is not needed.Java Code:System.out.println("The title is " + myMovies[index].title); // etcLast edited by pbrockway2; 08-24-2011 at 10:49 PM.
- 08-24-2011, 10:47 PM #4
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
It does I think, and that was a great reply to my thread actually, so thank you!!
I have never used this.title and this.plot
What does "this" actually do? Is it like a pointer if you like?
Also, by doing that, I get the user to enter a number that will point to the id in my array.
So, by producing another object, in this case perhaps an if, if else depending on what number is entered will display what movie?
Thanks again!!
- 08-24-2011, 10:59 PM #5
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
Thank you for this. Both replies are first class. I am enjoying it, and just finding my way to be honest.
Been doing this at Uni, but I want to build on this now as its just good fun!!
- 08-24-2011, 11:09 PM #6
'this' is a reference to the current object. If I had done something like this:
The this keyword is not necessary in this case. It was only needed in the example I posted because the argument had the same name as the variable that I was setting it to. I cant have:public void setTitle(String titleInput){
title = titleInput
}
That is considered an assignment to self, so the this keyword is a way of saying I am referencing the title of the object.Java Code:public void setTitle(String title){ title = title; }
- 08-25-2011, 02:36 PM #7
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
Thanks for those replies there. Very, very helpful.
The plot in each movie is very long. How can I return a couple of the lines so that the plot is not just one long line?
For instance, in XHTML, to do a line return I would enter </br> in to my code where I want to start a new line.
Cheers all!! :)
- 08-25-2011, 02:48 PM #8
use \n to add a linefeed.
- 08-27-2011, 03:07 PM #9
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
Hey All,
Okay, have hit a slight problem in that the System Input Scanner id does not like me using the "id" for user input?
Here is my code so far...
Am I heading in the right direction here?Java Code:/** * Write a description of class Movies here. * * @author (your name) * @version (a version number or a date) */ import java.util.Scanner; class Movies { String title; String starring; String plot; int id; public void Movie (String title, String starring, String plot, int id) { this.title = title; this.starring = starring; this.plot = plot; this.id = id; } public void setTitle(String title){ this.title = title; } public void setStarring(String starring){ this.starring = starring; } public void setPlot(String plot){ this.plot = plot; } public void setId(int id){ this.id = id; } public String getTitle(){ return title; } public String getStarring(){ return starring; } public String getPlot(){ return plot; } public int getId(){ return id; } public static void main(String [] args){ Scanner in = new Scanner(System.in); //Looking for user input. System.out.print("Please enter a number between 1 and 5 for a Movie: "); id = in.nextInt(); //JAVA DOES NOT SEEM TO LIKE THIS??? Movie commando = new Movie("Commando","Arnold Schwarzenegger","A retired special agent named John Matrix led an elite unit and (has left the armed forces to live in a secluded mountain home with his daughter Jenny. But now he is forced out of retirement when his daughter is kidnapped by a band of thugs intent on revenge! Unbeknownst to Matrix, the members of his former unit are being killed one by one. Even though Matrix' friend General Franklin Kirby gives Matrix armed guards, attackers manage to kidnap Matrix and Jenny. Matrix learns that Bennett, a former member of his Matrix' unit who was presumed dead has kidnapped him to try to force Matrix to do a political assassination for a man called Arius (who calls himself El Presidente), a warlord formerly bested by Matrix who wishes to lead a military coup in his home country. Since Arius will have Jenny killed if Matrix refuses, Matrix reluctantly accepts the demand.", 1); Movie predator = new Movie("Predator","Arnold Schwarzenegger","A team of special force ops, led by a tough but fair soldier, Major 'Dutch' Schaefer, are ordered in to assist CIA man, George Dillon, on a rescue mission for potential survivors of a Helicopter downed over remote South American jungle. Not long after they land, Dutch and his team discover that they have been sent in under false pretenses. This deception turns out to be the least of their worries though, when they find themselves being methodically hunted by something not of this world.", 2); Movie terminator = new Movie("The Terminator","Arnold Schwarzenegger","A cyborg is sent from the future on a deadly mission. He has to kill Sarah Connor, a young woman whose life will have a great significance in years to come. Sarah has only one protector - Kyle Reese - also sent from the future. The Terminator uses his exceptional intelligence and strength to find Sarah, but is there any way to stop the seemingly indestructible cyborg ?", 3); Movie rambo = new Movie("Rambo","Sylvester Stallone","Vietnam veteran John Rambo has survived many harrowing ordeals in his lifetime and has since withdrawn into a simple and secluded existence in Thailand, where he spends his time capturing snakes for local entertainers, and chauffeuring locals in his old PT boat. Even though he is looking to avoid trouble, trouble has a way of finding him: a group of Christian human rights missionaries, led by Michael Burnett and Sarah Miller, approach Rambo with the desire to rent his boat to travel up the river to Burma. For over fifty years, Burma has been a war zone. The Karen people of the region, who consist of peasants and farmers, have endured brutally oppressive rule from the murderous Burmese military and have been struggling for survival every single day. After some inner contemplation, Rambo accepts the offer and takes Michael, Sarah, and the rest of the missionaries up the river. When the missionaries finally arrive at the Karen village...", 4); Movie expendables = new Movie("The Expendables","Sylvester Stallone","Barney Ross leads the 'Expendables', a band of highly skilled mercenaries including knife enthusiast Lee Christmas, martial arts expert Yin Yang, heavy weapons specialist Hale Caesar, demolitionist Toll Road and loose-cannon sniper Gunner Jensen. When the group is commissioned by the mysterious Mr. Church to assassinate the merciless dictator of a small South American island, Barney and Lee head to the remote locale to scout out their opposition. Once there, they meet with local rebel Sandra and discover the true nature of the conflict engulfing the city. When they escape the island and Sandra stays behind, Ross must choose to either walk away and save his own life - or attempt a suicidal rescue mission that might just save his soul.", 5); } }
Regards,
Daz.
- 08-28-2011, 02:14 AM #10
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
You have not declared the variable id anywhere.
Notice this variable (whose value comes from the user) is not the same as the id variable used by the Movie instances which each have their own value for their id. It might be a good idea to use a different name for the variable - one that is descriptive of its intended purpose.
- 08-28-2011, 01:17 PM #11
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
Okay, been looking at this...
The compiler cannot find the Class Movies??? How do you get it to find this?
It is in the code!!
Java Code:/** * Write a description of class Movies here. * * @author (your name) * @version (a version number or a date) */ import java.util.Scanner; class Movies { String title; String starring; String plot; int id; public void Movie (String title, String starring, String plot, int id) { this.title = title; this.starring = starring; this.plot = plot; this.id = id; } public void setTitle(String title){ this.title = title; } public void setStarring(String starring){ this.starring = starring; } public void setPlot(String plot){ this.plot = plot; } public void setId(int id){ this.id = id; } public String getTitle(){ return title; } public String getStarring(){ return starring; } public String getPlot(){ return plot; } public int getId(){ return id; } public static void main(String [] args){ int numberId; Scanner in = new Scanner(System.in); //Looking for user input. System.out.print("Please enter a number between 1 and 5 for a Movie: "); numberId = in.nextInt(); Movie commando = new Movie("Commando","Arnold Schwarzenegger","A retired special agent named John Matrix led an elite unit and (has left the armed forces to live in a secluded mountain home with his daughter Jenny. But now he is forced out of retirement when his daughter is kidnapped by a band of thugs intent on revenge! Unbeknownst to Matrix, the members of his former unit are being killed one by one. Even though Matrix' friend General Franklin Kirby gives Matrix armed guards, attackers manage to kidnap Matrix and Jenny. Matrix learns that Bennett, a former member of his Matrix' unit who was presumed dead has kidnapped him to try to force Matrix to do a political assassination for a man called Arius (who calls himself El Presidente), a warlord formerly bested by Matrix who wishes to lead a military coup in his home country. Since Arius will have Jenny killed if Matrix refuses, Matrix reluctantly accepts the demand.", 1); Movie predator = new Movie("Predator","Arnold Schwarzenegger","A team of special force ops, led by a tough but fair soldier, Major 'Dutch' Schaefer, are ordered in to assist CIA man, George Dillon, on a rescue mission for potential survivors of a Helicopter downed over remote South American jungle. Not long after they land, Dutch and his team discover that they have been sent in under false pretenses. This deception turns out to be the least of their worries though, when they find themselves being methodically hunted by something not of this world.", 2); Movie terminator = new Movie("The Terminator","Arnold Schwarzenegger","A cyborg is sent from the future on a deadly mission. He has to kill Sarah Connor, a young woman whose life will have a great significance in years to come. Sarah has only one protector - Kyle Reese - also sent from the future. The Terminator uses his exceptional intelligence and strength to find Sarah, but is there any way to stop the seemingly indestructible cyborg ?", 3); Movie rambo = new Movie("Rambo","Sylvester Stallone","Vietnam veteran John Rambo has survived many harrowing ordeals in his lifetime and has since withdrawn into a simple and secluded existence in Thailand, where he spends his time capturing snakes for local entertainers, and chauffeuring locals in his old PT boat. Even though he is looking to avoid trouble, trouble has a way of finding him: a group of Christian human rights missionaries, led by Michael Burnett and Sarah Miller, approach Rambo with the desire to rent his boat to travel up the river to Burma. For over fifty years, Burma has been a war zone. The Karen people of the region, who consist of peasants and farmers, have endured brutally oppressive rule from the murderous Burmese military and have been struggling for survival every single day. After some inner contemplation, Rambo accepts the offer and takes Michael, Sarah, and the rest of the missionaries up the river. When the missionaries finally arrive at the Karen village...", 4); Movie expendables = new Movie("The Expendables","Sylvester Stallone","Barney Ross leads the 'Expendables', a band of highly skilled mercenaries including knife enthusiast Lee Christmas, martial arts expert Yin Yang, heavy weapons specialist Hale Caesar, demolitionist Toll Road and loose-cannon sniper Gunner Jensen. When the group is commissioned by the mysterious Mr. Church to assassinate the merciless dictator of a small South American island, Barney and Lee head to the remote locale to scout out their opposition. Once there, they meet with local rebel Sandra and discover the true nature of the conflict engulfing the city. When they escape the island and Sandra stays behind, Ross must choose to either walk away and save his own life - or attempt a suicidal rescue mission that might just save his soul.", 5); } }
- 08-28-2011, 06:48 PM #12
Senior Member
- Join Date
- Jan 2011
- Location
- Belgrade, Serbia
- Posts
- 227
- Rep Power
- 3
Compile it and correct all errors that compiler shows. for example your constructor...
- 08-29-2011, 05:51 AM #13
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
Or post the errors if you can't understand them.
-----
Note, too, that "Movie" is not "Movies".
- 08-29-2011, 12:04 PM #14
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
The error I get is:
Cannot find symbol - Constructor Movies (java.lang.String.java.lang.String.java.lang.Strin g.int)
Java Code:/** * Write a description of class Movies here. * * @author (your name) * @version (a version number or a date) */ import java.util.Scanner; public class Movies { String title; String starring; String plot; int id; public void Movies (String title, String starring, String plot, int id) { this.title = title; this.starring = starring; this.plot = plot; this.id = id; } private void setTitle(String title){ this.title = title; } private void setStarring(String starring){ this.starring = starring; } private void setPlot(String plot){ this.plot = plot; } private void setId(int id){ this.id = id; } private String getTitle(){ return title; } private String getStarring(){ return starring; } private String getPlot(){ return plot; } private int getId(){ return id; } public static void main (String [] args){ int numberId; Scanner in = new Scanner(System.in); //Looking for user input. System.out.print("Please enter a number between 1 and 5 for a Movie: "); numberId = in.nextInt(); Movies commando = new Movies("Commando","Arnold Schwarzenegger","A retired special agent named John Matrix led an elite unit and (has left the armed forces to live in a secluded mountain home with his daughter Jenny. But now he is forced out of retirement when his daughter is kidnapped by a band of thugs intent on revenge! Unbeknownst to Matrix, the members of his former unit are being killed one by one. Even though Matrix' friend General Franklin Kirby gives Matrix armed guards, attackers manage to kidnap Matrix and Jenny. Matrix learns that Bennett, a former member of his Matrix' unit who was presumed dead has kidnapped him to try to force Matrix to do a political assassination for a man called Arius (who calls himself El Presidente), a warlord formerly bested by Matrix who wishes to lead a military coup in his home country. Since Arius will have Jenny killed if Matrix refuses, Matrix reluctantly accepts the demand.", 1); Movie predator = new Movie("Predator","Arnold Schwarzenegger","A team of special force ops, led by a tough but fair soldier, Major 'Dutch' Schaefer, are ordered in to assist CIA man, George Dillon, on a rescue mission for potential survivors of a Helicopter downed over remote South American jungle. Not long after they land, Dutch and his team discover that they have been sent in under false pretenses. This deception turns out to be the least of their worries though, when they find themselves being methodically hunted by something not of this world.", 2); Movie terminator = new Movie("The Terminator","Arnold Schwarzenegger","A cyborg is sent from the future on a deadly mission. He has to kill Sarah Connor, a young woman whose life will have a great significance in years to come. Sarah has only one protector - Kyle Reese - also sent from the future. The Terminator uses his exceptional intelligence and strength to find Sarah, but is there any way to stop the seemingly indestructible cyborg ?", 3); Movie rambo = new Movie("Rambo","Sylvester Stallone","Vietnam veteran John Rambo has survived many harrowing ordeals in his lifetime and has since withdrawn into a simple and secluded existence in Thailand, where he spends his time capturing snakes for local entertainers, and chauffeuring locals in his old PT boat. Even though he is looking to avoid trouble, trouble has a way of finding him: a group of Christian human rights missionaries, led by Michael Burnett and Sarah Miller, approach Rambo with the desire to rent his boat to travel up the river to Burma. For over fifty years, Burma has been a war zone. The Karen people of the region, who consist of peasants and farmers, have endured brutally oppressive rule from the murderous Burmese military and have been struggling for survival every single day. After some inner contemplation, Rambo accepts the offer and takes Michael, Sarah, and the rest of the missionaries up the river. When the missionaries finally arrive at the Karen village...", 4); Movie expendables = new Movie("The Expendables","Sylvester Stallone","Barney Ross leads the 'Expendables', a band of highly skilled mercenaries including knife enthusiast Lee Christmas, martial arts expert Yin Yang, heavy weapons specialist Hale Caesar, demolitionist Toll Road and loose-cannon sniper Gunner Jensen. When the group is commissioned by the mysterious Mr. Church to assassinate the merciless dictator of a small South American island, Barney and Lee head to the remote locale to scout out their opposition. Once there, they meet with local rebel Sandra and discover the true nature of the conflict engulfing the city. When they escape the island and Sandra stays behind, Ross must choose to either walk away and save his own life - or attempt a suicidal rescue mission that might just save his soul.", 5); System.out.print(numberId); } }
- 08-29-2011, 12:38 PM #15
A constructor doesn't have a return type. What you're probably intending to be a constructor, isn't. It's a method.
db
- 08-29-2011, 12:42 PM #16
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
Can you help me amend it please? I am a real newbie you see.
Daz.
- 08-29-2011, 01:29 PM #17
You already have the answer in this thread. Read all the responses -- carefully.
db
- 08-29-2011, 02:12 PM #18
This is ok, but make sure you have understood the basics, that is creating classes, constructors and so on. So read this, reread the related chapters in your head first book and all responses given here in this thread.
Last edited by j2me64; 08-29-2011 at 02:15 PM.
- 08-29-2011, 04:10 PM #19
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
Hi All, I have nailed it finally. The CONSTRUCTOR MUST BE THE SAME AS THE CLASS!!
I need to print out now from user input...
Any tips? PLEASE? Thanks for being patient with me.
Daz.
Java Code:/** * Write a description of class Movies here. * * @author (your name) * @version (a version number or a date) */ import java.util.Scanner; public class Movies { String title; String starring; String plot; int id; public Movies (String title, String starring, String plot, int id) { } private void setTitle(String title){ this.title = title; } private void setStarring(String starring){ this.starring = starring; } private void setPlot(String plot){ this.plot = plot; } private void setId(int id){ this.id = id; } private String getTitle(){ return title; } private String getStarring(){ return starring; } private String getPlot(){ return plot; } private int getId(){ return id; } public static void main (String [] args) { int id; Scanner in = new Scanner(System.in); //Looking for user input. System.out.print("Please enter a number between 1 and 5 for a Movie: "); id = in.nextInt(); Movies commando = new Movies("Commando","Arnold Schwarzenegger","A retired special agent named John Matrix led an elite unit and (has left the armed forces to live in a secluded mountain home with his daughter Jenny. But now he is forced out of retirement when his daughter is kidnapped by a band of thugs intent on revenge! Unbeknownst to Matrix, the members of his former unit are being killed one by one. Even though Matrix' friend General Franklin Kirby gives Matrix armed guards, attackers manage to kidnap Matrix and Jenny. Matrix learns that Bennett, a former member of his Matrix' unit who was presumed dead has kidnapped him to try to force Matrix to do a political assassination for a man called Arius (who calls himself El Presidente), a warlord formerly bested by Matrix who wishes to lead a military coup in his home country. Since Arius will have Jenny killed if Matrix refuses, Matrix reluctantly accepts the demand.", 1); Movies predator = new Movies("Predator","Arnold Schwarzenegger","A team of special force ops, led by a tough but fair soldier, Major 'Dutch' Schaefer, are ordered in to assist CIA man, George Dillon, on a rescue mission for potential survivors of a Helicopter downed over remote South American jungle. Not long after they land, Dutch and his team discover that they have been sent in under false pretenses. This deception turns out to be the least of their worries though, when they find themselves being methodically hunted by something not of this world.", 2); Movies terminator = new Movies("The Terminator","Arnold Schwarzenegger","A cyborg is sent from the future on a deadly mission. He has to kill Sarah Connor, a young woman whose life will have a great significance in years to come. Sarah has only one protector - Kyle Reese - also sent from the future. The Terminator uses his exceptional intelligence and strength to find Sarah, but is there any way to stop the seemingly indestructible cyborg ?", 3); Movies rambo = new Movies("Rambo","Sylvester Stallone","Vietnam veteran John Rambo has survived many harrowing ordeals in his lifetime and has since withdrawn into a simple and secluded existence in Thailand, where he spends his time capturing snakes for local entertainers, and chauffeuring locals in his old PT boat. Even though he is looking to avoid trouble, trouble has a way of finding him: a group of Christian human rights missionaries, led by Michael Burnett and Sarah Miller, approach Rambo with the desire to rent his boat to travel up the river to Burma. For over fifty years, Burma has been a war zone. The Karen people of the region, who consist of peasants and farmers, have endured brutally oppressive rule from the murderous Burmese military and have been struggling for survival every single day. After some inner contemplation, Rambo accepts the offer and takes Michael, Sarah, and the rest of the missionaries up the river. When the missionaries finally arrive at the Karen village...", 4); Movies expendables = new Movies("The Expendables","Sylvester Stallone","Barney Ross leads the 'Expendables', a band of highly skilled mercenaries including knife enthusiast Lee Christmas, martial arts expert Yin Yang, heavy weapons specialist Hale Caesar, demolitionist Toll Road and loose-cannon sniper Gunner Jensen. When the group is commissioned by the mysterious Mr. Church to assassinate the merciless dictator of a small South American island, Barney and Lee head to the remote locale to scout out their opposition. Once there, they meet with local rebel Sandra and discover the true nature of the conflict engulfing the city. When they escape the island and Sandra stays behind, Ross must choose to either walk away and save his own life - or attempt a suicidal rescue mission that might just save his soul.", 5); System.out.println(id); } }
- 08-29-2011, 06:06 PM #20
Member
- Join Date
- Jan 2011
- Posts
- 27
- Rep Power
- 0
Similar Threads
-
user input array
By localhost in forum New To JavaReplies: 5Last Post: 12-30-2010, 04:00 AM -
How to ask the user how many elements to print from an array?
By rania.idan in forum New To JavaReplies: 2Last Post: 12-02-2010, 04:18 AM -
Read user input into integer array
By varunb in forum New To JavaReplies: 12Last Post: 07-09-2010, 12:50 PM -
how to get input from User
By Alvaro in forum New To JavaReplies: 7Last Post: 01-15-2010, 11:02 PM -
need help with two dimensional array and setting it up using user input
By Peanuts1 in forum New To JavaReplies: 5Last Post: 11-26-2009, 07:01 PM


3Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks