Results 1 to 6 of 6

Thread: Marks programm

  1. #1
    blackmoon is offline Member
    Join Date
    Dec 2009
    Posts
    1
    Rep Power
    0

    Default Marks programm

    Hi, i have to programm a markssaver:

    which is able to

    1. i give it some marks
    2. it saves this marks
    3. it saves the number of students
    4. it gives me back the marks + the students+ the average

    do someone knows about such a programm code for me (java)?
    can i download it somewhere?

    i'm looking forward to hearing from you
    thxxx

  2. #2
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    I googled "class grades" and got a bunch of choices.
    Rule 12: Never program for yourself what others have already done.

    Many teachers get by with just a spreadsheet.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    So let me get this straight: you have an assignment to do, and you're asking folks here to find the code for you so you can hand it in as your own? Am I missing anything? You're not studying to be a politician are you?

  4. #4
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    Here's some notes that may help.
    The important design step is to focus on interfaces:
    • How does the program get the data from the user?
      Prompt for a line where each line has name and grade
      OR prompt separately for each name and each grade?
    • How is the data stored in a file? Typically each line in the file
      has a name and grade separated by a special character like a colon.
    • What is the in-memory representation of the data?
      Possibly a new class called GrayList which extends ArrayList
      and contains Grade objects where each has a name and grade.
    • What is the format of the output?


    Now write GrayList methods to read into a GrayList list from the console,
    write a GrayList to a file, read a file into a GrayList,
    and compute the average from a GrayList.
    The final program more or less just calls these methods.

  5. #5
    sky
    sky is offline Member
    Join Date
    Nov 2009
    Posts
    96
    Rep Power
    0

    Default

    Quote Originally Posted by zweibieren View Post
    Here's some notes that may help.
    The important design step is to focus on interfaces:
    • How does the program get the data from the user?
      Prompt for a line where each line has name and grade
      OR prompt separately for each name and each grade?
    • How is the data stored in a file? Typically each line in the file
      has a name and grade separated by a special character like a colon.
    • What is the in-memory representation of the data?
      Possibly a new class called GrayList which extends ArrayList
      and contains Grade objects where each has a name and grade.
    • What is the format of the output?


    Now write GrayList methods to read into a GrayList list from the console,
    write a GrayList to a file, read a file into a GrayList,
    and compute the average from a GrayList.
    The final program more or less just calls these methods.
    Just curious, is it the same to declare the ArrayList like this:

    Java Code:
    ArrayList<Grades> list = new ArrayList<Grades>();

    than to create a new class that extends ArrayList?

  6. #6
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    A class extending ArrayList can have methods.
    Java Code:
    class GrayList extends ArrayList<Grade> {
    
        public void method(...) { ... }
    
    }
    or even
    Java Code:
    ArrayList<Grades> list = new ArrayList<Grades>() {
    
        public void method(...) { ... }
    
    };

Similar Threads

  1. Retrieving double quotation marks from xml using java
    By fireportal in forum New To Java
    Replies: 3
    Last Post: 11-12-2009, 12:13 PM
  2. [SOLVED] my programm doesn´t run like it shoud be.
    By AlejandroPe in forum New To Java
    Replies: 3
    Last Post: 04-07-2009, 01:42 PM
  3. web programm (.jsp)
    By renars1985 in forum New To Java
    Replies: 1
    Last Post: 12-18-2007, 04:23 PM
  4. web programm (.jsp)
    By renars1985 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 12-18-2007, 09:34 AM
  5. Programm Error: cannot find symbol Help?
    By junix in forum New To Java
    Replies: 2
    Last Post: 12-10-2007, 06:30 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
  •