• Post Reply Bookmark Topic Watch Topic
  • New Topic

I need some fast help with a Java Program  RSS feed

 
Michael Ossino
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok i'm finishing up a beginer Java course in College and I got my last Java program/assignment that is supposed to simulate a tv remote, and a vcr remote that inherits the functions from tv remote , beign able to change the channels and volume as well. The tv remote is supposed to change the channels 1-25 relooping them, and the volume 1-10 not relooping them. The vcr is supposed to fast forward, rewind, stop, play, eject and insert the tape. The vcr has a getMode and setMode. The getMode tells the user which mode they are in and gives a message if there isn't a tape in the vcr. The setMmode is supposed to play, stop, fast forward, and rewind. It is only supposed to simulate a remote and will only display what level the volume is, which channel you are on, and which vcr feture is currently in use(play, rewind, ect). I got some help with this but it is still incomplete and I can't tell what i'm doing wrong. I still don't have a way to rewind, fast forward, stop, and play the tape or a way for the user to interface with the program. It was due today but my prof. was kind enough to give me until 9:00a.m tomorrow morning to finish this last assignment. If anyone could give me some help with this i would greatly apprecite it...i've gotten quit lost about halfway through the semester and just trying to finish this lass program. Here is the code that i have so far:
import javax.swing.JOptionPane;
public class TVRemote{
int volume = 5;
int channel = 5;
public void channelUp(){
if(channel < 25){
channel++;
}
}
public void channelDown(){
if(channel > 1){
channel--;
}
}
public void volumeUp(){
if(volume < 10){
volume++;
}
}
public void volumeDown(){
if(volume > 1){
volume--;
}
}
}
public class VCRemote extends TVRemote{
String tape = null;
String mode = "Stop";
public void insertTape(String t){
tape = t;
}
public void ejectTape(){
tape = null;
}
public void setMode(String m){
mode = m;
}
public String getMode(){
return mode;
}
}
public String getMode(){
if(tape == null){
System.out.println("There is no tape");
}
return mode;
}
Again thank you to anyone who can help me. I greatly appreciate it. Thank you.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's a cross-forum post.... I saw one post exactly the same as this in Java in General(Beginner) forum....
But I have no authority to delete one... :roll:
 
Michael Ossino
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeeah sorry about that...I relized after I posted it in the beginers forum that it wasn't really a beginners topic so I posted it here. I'm new and was reffered here from another forum where I was lookling for some help on this matter. Sorry for the double post.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok then, I will assist u to solve ur problem....
Here I got some correction in your problem... I think it might help you to develop more...
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't it be better to provide hints to the solution of his problems?
I'm dubious of the benefits of handing someone the solution to their problem, particularly when it is an assignment.
That said, all the best with the solution Michael.
Dave.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David O'Meara:
Wouldn't it be better to provide hints to the solution of his problems?

Yes, I do agree with that sentence, David... I think the solution that I give to him is not perfect... I let him do the GUI part by himself....
 
Gillian Bladen-Clark
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recognised this as one of the example problems in the Wrox book Beginning Java 2 SDK 14. You can usually download the code for this book from Wrox (www.wrox.com) but I couldn't find the particular code for this example. If you know anyone who has this book - check out Chapter 6 page284 for the solution. Might be worth you getting this book just in case future projects on your course have also been "inspired" from this source.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!