Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Oh Please Help! Change of teacher, signed insane project...this is my last hope!

Hello all!

My teacher in our Computer Programming class left halfway through the year due to illness. He was very good and he KNEW that none of us in the class had any knowledge of how to do anything Java related and that this class was our "first steps in water" so to say. Well, we have a new teacher now who is some young buck who thinks he knows everything. Unfortunately for us, he does. Our assignment is to create a Java GUI to look like one of those touchscreen menu systems. As in, have a GUI with the words "Bread, Meat, Cheese, Others" on the left side of the screen going up and down and have the boxes on the right side of the screen in rows of four and adjacent from the labels they go with that I had just typed: "White, Wheat, French, Italian, Salami, Turkey, Ham, Roast Beef, Cheddar, Swiss, Mozzarella, Pepperjack, Spicy Mustard, Dijon Mustard, Mayonnaise, Italian Dressing".

We are supposed to set a price of whatever we want for each item and have another little window in the GUI to show what we ordered each time we press a button then have another window to show the total. We are supposed to name the GUI "Restaurant". The cherry on top is that for each button, we have to have an icon to symbolize each item...such as the button that lets your order Roast Beef would have a picture of a cow on it. Not only that but we have to have a sound that plays each item's "sound" such as the aforementioned cow have a "moo" sound. I would just be happy if somebody TOLD me how to add them let alone actually do it for me...Before my teacher left we were learning how to do small programs that ran in the text box of JGrasp...now we are doing this. My classmates (all 3 of them, the other 5 dropped out after we got this nutcase in charge) have no idea what to do. We've re-read our book, bought Java for Dummies, and even asked this teacher for help but he is too busy to come in because he is moving across town :confused: Everyone in my class has no prior experience with this sort of thing and you can probably tell how overwhelming something like this is. Please PLEASE can anybody help. We asked the head of the department and he said that he cannot do anything about our assignment this late in the year and that what we are doing is what students in Computer Programming II END WITH :eek: Please, anyone :o

It is due Monday...I have been searching all over the internet for sample calculator problems and I stumbled upon these forums...I am so worn out from searching and searching and re-reading over and over that I really don't even know what to do anymore!
[2632 byte] By [krackerjack411] at [2007-11-11 8:35:39]
# 1 Re: Oh Please Help! Change of teacher, signed insane project...this is my last hope!
Hi Krackerjack -- sounds like you got thrown into the deep end of the pool. What you instructor is asking you to do is actually not very difficult at all so don't let it intimidate you. I also noticed you did not specify a GUI platform -- if your instructor was not specific about this, I would consider doing it in JSP because the learning curve is not as steep as AWT or Swing. You can download Tomcat at apache.org. In terms of making the GUI look and sound the way the instructor said -- this can be done with basic HTML and basic javascript. Are you experienced with HTML and/or JSP? I would give you example HTML of what it would look like but your description is a little ambigous too me and I don't really understand what you mean. Maybe something like this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Resturant</title>
</head>
<body>
<h4 align="center">Restaurant</h4>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="65%" valign="top">
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="25%"><b>Bread</b></td>
<td width="75%">
<input type="checkbox" name="checkbox" value="checkbox" id="checkbox" /> White
<input type="checkbox" name="checkbox" value="checkbox" id="checkbox" /> Wheat
<input type="checkbox" name="checkbox" value="checkbox" id="checkbox" /> French
<input type="checkbox" name="checkbox" value="checkbox" id="checkbox" /> Italian </td>
</tr>
<tr>
<td><b>Meat</b></td>
<td>
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Salami
<input type="checkbox" name="checkbox3" value="checkbox" id="checkbox3" /> Turkey
<input type="checkbox" name="checkbox4" value="checkbox" id="checkbox4" /> Ham
<input type="checkbox" name="checkbox5" value="checkbox" id="checkbox5" /> Roast Beef </td>
</tr>
<tr>
<td><b>Cheese</b></td>
<td>
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Cheddar
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Swiss
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Mozzarella
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Pepperjack </td>
</tr>
<tr>
<td><b>Others</b></td>
<td>
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Spicy Mustard
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Dijon Mustard
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Mayonnaise
<input type="checkbox" name="checkbox2" value="checkbox" id="checkbox2" /> Italian Dressing </td>
</tr>
<tr>
<td> </td>
<td align="right"><input type="submit" name="Submit" value="Place Order" /></td>
</tr>
</table>
</form>
</td>
<td width="35%" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><b>Items Ordered</b></td>
</tr>
<!-- start loop over an array of Items Ordered here (you can persist this array as a session object) -->
<tr>
<td> </td>
</tr>
<!-- end loop here -->
<tr>
<td><b>Total Cost</b></td>
</tr>
<tr>
<!-- Perform calculations here -->
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Regarding the java side of things -- you need to create a bean with getters and setters that contain all the information you need to output Items ordered and total cost. This is also where you will persist the cost. Have you learned about creating plain old java objects? I hope this helped, if your even more confused -- let me know, I will check this later.
smcneill at 2007-11-11 22:34:57 >
# 2 Re: Oh Please Help! Change of teacher, signed insane project...this is my last hope!
Oh -- one more thing, in case you didn't already know -- you will need to make those check box names/id unique. Like:

<input type="checkbox" name="RoastBeef" value="Roast Beef" id="RoastBeef" /> Roast Beef

you actually don't need the id but it helps with the javascript
smcneill at 2007-11-11 22:35:51 >
# 3 Re: Oh Please Help! Change of teacher, signed insane project...this is my last hope!
Ohhh thank you so much! I will use that if I do not hear from you again today, but our teacher wanted us to use the program JGrasp. Does that make sense :o I really think I should pay you for helping me out with such a big project and it is so nice to FINALLY have someone to help after what we all have been through with our teacher. Thank you thank you thank you!!

Sorry I was so vague in my first post...it was around 3:30 A.M. EST when I put it on here. The best way to describe what my teacher wants is something that you see at one of those Sheets restaurants where you create your own sub. In the program our teacher wanted us to make, we need to be able to click on a button (such as White, Wheat, Salami, Turkey etc. etc.) and have its price shown in another box and watch the price add up as we click on more boxes.

I'm sure that anyone who has knowledge in how to do this stuff such as yourself can clearly understand what you're saying in your first post but it is a little confusing for me...by the way, me and my two other classmates are gathered around the computer in our library and refreshing this site over and over :D Thank you so much!
krackerjack411 at 2007-11-11 22:36:55 >
# 4 Re: Oh Please Help! Change of teacher, signed insane project...this is my last hope!
I'm not familiar with jGrasp -- but I did a quick google on it and found http://www.eng.auburn.edu/grasp/ (I imaginethis is the tool he is refering to.)

Hmm - I looked at the getting started manual, I guess you could use that to make your java objects. Seems like its kind of a mickey mouse IDE though. Anyway Good luck. If your looking for more direction -- just post a question or concern in this thread and I will try to help you. Don't worry about paying me -- thats what these boards are here for.
smcneill at 2007-11-11 22:37:55 >
# 5 Re: Oh Please Help! Change of teacher, signed insane project...this is my last hope!
Thank you again!!

I think I am going to try out this HTML code you put up earlier, but how do I use it :o Do I just copy and paste it into JGrasp then finish it up or do I put it in Tomcat (which I'm not even sure how to use haha).

**EDIT**

Ok I put the code in Front Page and it works!

Honestly the JGrasp thing is just what we use at school. Any programming that can handle Java code such as NetBeans would work fine. Only problem is I'm more confused on NetBeans than I am JGrasp...sheesh!

It is so frustrating with JGrasp...everytime I think I have SOMETHING going right it always gives me one or two errors that I have no idea what are there for. I've copied stuff verbatim out of our text book and it still gives me an error :confused: Just let me know if you have anymore tips!! Thanks!
krackerjack411 at 2007-11-11 22:38:54 >