Crossposting because I am Desperate!! Homework from new teacher who knows too much!


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 13 of 13

Thread: Crossposting because I am Desperate!! Homework from new teacher who knows too much!

  1. #1
    Join Date
    May 2006
    Posts
    8

    Crossposting because I am Desperate!! Homework from new teacher who knows too much!

    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 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 Please, anyone

    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!

  2. #2
    Join Date
    Mar 2005
    Location
    UK, London
    Posts
    150
    Check these snippets out, they may help you. http://www.codeyourself.com/Category...indows%20Frame

  3. #3
    Join Date
    May 2006
    Posts
    8
    Thank you!

    Like I said though...I, along with the rest of my classmates, look like idiots trying to do this thing. Is there anymore help I could get!!?? Thank you much!

  4. #4
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    you could tell your teacher what the problem is, that none of you had some lessons in java.
    by the way, how good are your (and your classmates) java skills?
    will it help you when i generally describe what to do?

  5. #5
    Join Date
    May 2006
    Posts
    8
    Haha well, as far as how good my classmates and myself are in Java...we aren't where are teacher wants us to be. We are still trying to teach ourselves where to put things in the code and how to write out things! We were just getting comfortable with doing small programs without a GUI. Now we are doing something that, for us, is an uphill battle.

    Any help would be appreciated...anything!

  6. #6
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    hum. what about using a ide with integrated gui tools, where you can click together you gui like in visual basic?
    otherwise start planing your application with the following:
    1. how many screens do you need and what are the contents of that screens
    2. which objects do you need and what attributes belong to them in general. eg.:
    Product
    -price
    -name
    -symbol
    -category, contains Bread, Meat, Cheese or Others
    ProductList
    -none or many products
    -can add or remove products from this list
    -can calculate the sum of all products contained

    for Category you also could define a class:
    Category
    -name

    now start writing the class files by the lowest an most independent object:
    Code:
    public class Category{
      private String name;
    
      public Category(String name){
        this.name = name;
      }
    
      public String getName(){
        return name;
      }
    
      public void setName(String name){
        this.name = name;
      }
    
      public boolean equals(Object o){
        if (o instanceof Category){
          Category otherCat = (Category) o;
          return getName.equals(otherCat.getName());
        }
        return false;
      }
    }
    that simple. you will have to do the same for a product:
    Code:
    public class Product{
      private Category category;
      private double pricePerUnit;
      private String name;
      private Image icon;
    
      public Product(String name, Category category, double pricePerUnit, Image icon){
        this.name = name;
        this.category = category;
        this.pricePerUnit = pricePerUnit;
        this.icon = icon;
      }
    
      public Image getIcon(){
        return icon;
      }
    
      public double getPricePerUnit(){
        return pricePerUnit;
      }
      ....
    }
    and the ProductList:

    Code:
    public class ProductList{
      private List products = new ArrayList();
      
      public void addProduct(Product product){
        products.add(product);
      }
      
      public void removeProduct(Product product){
        products.remove(product);
      }
    
      public double getTotal(){
        double total = 0;
        Product actual;
        for (int i=0; i<products.size(); i++){
          actual; = (Product) products.get(i);
          total = total+actual.getPricePerUnit();
        }
        retunr total;
      }
      
    }
    this is just the logical representation of the application. the gui should later on use that classes to display their states.
    the code still contains some syntaxerrors and is not complete. but it should be a starting point. having further time i'll add on some code. but i think the most of it has to be done by you.

  7. #7
    Join Date
    May 2006
    Posts
    8
    Haha see even though you are helping a lot, that is even confusing for us

    We aren't sure what to put where and what to replace words with our names and titles for stuff...yeah we stink at this by the way

    If there is any way you could make it a little more simple I would greatly appreciate it!

  8. #8
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    hum. i don't have the time to write all of the application for you. what i can is providing help, not the whole solution. if none of your class can do that, your teacher has to rethink about his plan. since it will not look good if his full class failsthe course...

  9. #9
    Join Date
    May 2006
    Posts
    2
    >Well, we have a new teacher now who is some young buck who thinks he
    >knows everything. Unfortunately for us, he does.

    I find it really sad (and suspicious) that you believe this.

    If case you didn't know, a teacher that knows everything is a good thing. That way you have an opportunity to learn.

    By the way you're responding to the others trying to help, it appears that you are simply looking for free code rather than trying to learn.

    Sad...

    Good luck.

  10. #10
    Join Date
    May 2006
    Posts
    8

    Thumbs down

    Quote Originally Posted by sconnell
    >Well, we have a new teacher now who is some young buck who thinks he
    >knows everything. Unfortunately for us, he does.

    I find it really sad (and suspicious) that you believe this.

    If case you didn't know, a teacher that knows everything is a good thing. That way you have an opportunity to learn.

    By the way you're responding to the others trying to help, it appears that you are simply looking for free code rather than trying to learn.

    Sad...

    Good luck.
    It isn't so much me, it is all of us. We have TRIED to learn by buying books, TRYING to get my teacher to come in and help us...we've even tried doing a calculator GUI and replacing the keys with the words but it just doesn't work. I'm not looking for a free code but for some major help because we don't know much about this stuff. And my teacher is a pompous you-know-what...there is a difference between a good teacher and one that likes to express his level of teaching as an extension of his own character

  11. #11
    Join Date
    May 2006
    Posts
    2
    I don't mean to appear so distrusting of your intent but I've seen a lot of people pretend to be students when in fact they are developers looking for code. Looking for "free" code isn't the problem but misrepresenting yourself is. Just as bad, however, is a student who is looking for an easy mark.... looking for code without having to do any real thinking. What is the point of being in school if you do not wish to learn?

    Anyhow, presumably you are paying for this course. If the teacher is as bad as you say you have a responsibility to take this up with the dean or principle (not sure what grade level we are talking about).

    So you say you cannot get the code working. That surely means you have tried. Please post the code you have done and I am sure anyone of us will be pleased to help you along. BUT it is essential that you show effort on your part.

    Best regards.

  12. #12
    Join Date
    May 2006
    Posts
    13

    it easy

    Code:
    JFrame j = new JFrame("hi)
    JPanel JP = new JPanel();
    JP.setLayout(new BorderLayout());
    JButen C;
    JButen B;
    JP.add("Center", C);
    JP.add("left" , b);
    and so on

  13. #13
    Join Date
    May 2005
    Posts
    22
    Download the free version of JBuilder, and read the help for it... It's a GUI GUI-builder... you can point-and-click to build GUIs.

Similar Threads

  1. java homework
    By Mona in forum Java
    Replies: 6
    Last Post: 06-22-2006, 02:54 AM
  2. Need asp teacher
    By asp in forum ASP.NET
    Replies: 3
    Last Post: 06-13-2000, 09:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center