Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 131,642 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,288 people online right now. Registration is fast and FREE... Join Now!




A Program maintaining homework assignments

2 Pages V  1 2 >  
Reply to this topicStart new topic

A Program maintaining homework assignments, i need help

webbywebb
post 8 Oct, 2008 - 01:54 PM
Post #1


D.I.C Head

**
Joined: 30 Jan, 2007
Posts: 73


My Contributions


I need to develop a program to maintain a list of homework assignments. when an assignment is assigned, add it to the list and when it is completed, remove it. i should be able to keep track of the due date. I should be able to provide the following services:
1. add a new assignment
2.remove an assignment
3. provide a list of assignments in the order they were assigned.
4. find the assignments with the earliest due date.

i am not sure where to start. i need help really bad sad.gif
User is offlineProfile CardPM

Go to the top of the page


BetaWar
post 8 Oct, 2008 - 01:57 PM
Post #2


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,976



Thanked 77 times

Dream Kudos: 1175
My Contributions


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks.
User is offlineProfile CardPM

Go to the top of the page

stauffski
post 8 Oct, 2008 - 04:56 PM
Post #3


D.I.C Head

**
Joined: 3 Nov, 2007
Posts: 137



Thanked 16 times
My Contributions


Do you know how to write a main method in a class?
User is offlineProfile CardPM

Go to the top of the page

webbywebb
post 8 Oct, 2008 - 05:04 PM
Post #4


D.I.C Head

**
Joined: 30 Jan, 2007
Posts: 73


My Contributions


here is some of my code

CODE

import java.util.*;

public class LnkList_prj1
{
    static Scanner console = new Scanner(System.in);

    public static void main (String[] args)
    {
         int setLoc, setVal, insLoc, insVal, remLoc;
         ArrayList numLst = new ArrayList();
        

         for (int i = 1; i < 11; i++)
        {
            numLst.add(i);
          }
    
        
         System.out.println("Welcome, How are you how is eveything?");
        System.out.println("Welcome to the homework assignment program");
        System.out.println("Please start the following program");



        
        
        // System.out.println("---set operation---");
         System.out.println("Which element:");
         setLoc = console.nextInt();
         System.out.println("Which integer value to set to:");
         setVal = console.nextInt();
        
            
        // to insert assignments into the program list  
         System.out.println("\n---insert operation---");
         System.out.println("After which element:");
         insLoc = console.nextInt();
         System.out.println("Which integer value to insert:");
         insVal = console.nextInt();
        
         // to remove assignments form the program list
         System.out.println("\n---remove operation---");
         System.out.println("which element:");
         remLoc = console.nextInt();
        
         numLst.set(setLoc, setVal);
         numLst.add(insLoc, insVal);
         numLst.remove(remLoc);

      
        // to updated the array list
         System.out.println("\nThe updated full list is:");
          
         for (int i = 0; i < numLst.size(); i++)
        {
           System.out.println(numLst.get(i));

          }
              
                     
         /*for (counter = 0; counter < items.length; counter++)
        {
            items[counter] = console.nextInt();
          }*/
    }
}

User is offlineProfile CardPM

Go to the top of the page

stauffski
post 8 Oct, 2008 - 05:12 PM
Post #5


D.I.C Head

**
Joined: 3 Nov, 2007
Posts: 137



Thanked 16 times
My Contributions


You are kidding me right?
User is offlineProfile CardPM

Go to the top of the page

webbywebb
post 8 Oct, 2008 - 07:47 PM
Post #6


D.I.C Head

**
Joined: 30 Jan, 2007
Posts: 73


My Contributions


did i do something wrong
User is offlineProfile CardPM

Go to the top of the page

stauffski
post 8 Oct, 2008 - 08:49 PM
Post #7


D.I.C Head

**
Joined: 3 Nov, 2007
Posts: 137



Thanked 16 times
My Contributions


Forgive me, but what you posted was basically a bunch of print methods, no meat. Put some effort into the methods for adding, removing, sorting, and displaying. If you don't understand java code, there should be tutorials in the tutorial section. Basically I want to see just a little more effort and specifics on your trouble.

Good Luck!
User is offlineProfile CardPM

Go to the top of the page

pbl
post 8 Oct, 2008 - 09:05 PM
Post #8


D.I.C Lover

Group Icon
Joined: 6 Mar, 2008
Posts: 2,933



Thanked 185 times

Dream Kudos: 75
My Contributions


QUOTE(stauffski @ 8 Oct, 2008 - 09:49 PM) *

Forgive me, but what you posted was basically a bunch of print methods, no meat. Put some effort into the methods for adding, removing, sorting, and displaying. If you don't understand java code, there should be tutorials in the tutorial section. Basically I want to see just a little more effort and specifics on your trouble.

Good Luck!


A little rude Stauffski you are usually mode "pedagogic" than that ....
Tired ?

Webbyweb I cut and pasted your code... no really error handling but if you put the good values in (int when a int is expected) it works...
So for the third times tonigh (in another posts) what is your problem ?


User is offlineProfile CardPM

Go to the top of the page

stauffski
post 8 Oct, 2008 - 10:43 PM
Post #9


D.I.C Head

**
Joined: 3 Nov, 2007
Posts: 137



Thanked 16 times
My Contributions


Yeah, no excuses, sorry webbywebg. I don't like it when people get code and paste it from the internet and get the same grades as myself, or go onto a chat forum and try and get someone to code their prog. I guess when your first post has no code, I get very suspicious. The site policy about posting code is right in the post box, hard to miss. This is not to say what you did or didn't do. I guess I don't know enough to judge. I assumed, and you know that when you assume, you make an ass out of yourself.

Let me help you outline the program.

java

import java.util.*;

public class homeworkHelper{
public static main(String[] args){
Scanner reader = new Scanner(System.in);
String name, description;
Date dueDate;
boolean run = true;

while(run){
//create a user interface menu here, GUI or command
//1.)Show as due
//2.)Show as assigned
//3.)Add assignment
//4.)Remove Assignment
//5.)Quit
//execute appropriate code, gather necessary data from user
if(quit){
run = false;
}
removeOldDates();
}
}

public void addAssignment(String name, String description, Date dueDate){
//Create with the sent data. Set the assigned date as the current date, or, send that info as well
}

public void removeAssignment(int index){
//remove assignment from lists at index index
}

public String showAsAssigned(){
//return lists in formatted fashion, sorting by assigned date
}

public String showAsDue(){
//return lists in formatted fashion, sorting by due date
}

public void removeOldDates(){
//remove dates that have passed
}
}


If you have any questions, don't be afraid to ask.
Good Luck!

Sorry if I misjudged,
Stauffski
User is offlineProfile CardPM

Go to the top of the page

webbywebb
post 9 Oct, 2008 - 06:10 AM
Post #10


D.I.C Head

**
Joined: 30 Jan, 2007
Posts: 73


My Contributions


thanx for ur help so far. i will let u know if i have anymore problems. i really apperciate ur help
User is offlineProfile CardPM

Go to the top of the page

stauffski
post 9 Oct, 2008 - 08:03 AM
Post #11


D.I.C Head

**
Joined: 3 Nov, 2007
Posts: 137



Thanked 16 times
My Contributions


It's no problem, I did it at 2:00 (military time) so I would be surprised if it doesn't make sense.

Good Luck!
User is offlineProfile CardPM

Go to the top of the page

webbywebb
post 9 Oct, 2008 - 02:10 PM
Post #12


D.I.C Head

**
Joined: 30 Jan, 2007
Posts: 73


My Contributions


i am sorry i am not sure what to do. its been awhile since i programmed in java do. i added a array to the program is this right. i complied the file and it say that cannot find symbol
symbol : variable quit
location: class homeworkHelper
if(quit){
^



CODE

import java.util.*;

    public class homeworkHelper{
       public static void main(String[] args){
         Scanner reader = new Scanner(System.in);
         String name, description;
         Date dueDate;
        
       ArrayList numLst = new ArrayList();

       for (int i = 1; i < 11; i++)
        {
            numLst.add(i);
        }
      
            
            
            
            boolean run = true;
      
         while(run){
         //create a user interface menu here, GUI or command
         //1.)Show as due
         //2.)Show as assigned
         //3.)Add assignment
         //4.)Remove Assignment
         //5.)Quit
         //execute appropriate code, gather necessary data from user
            if(quit){
               run = false;
            }
            removeOldDates();
         }
      }
  
       public void addAssignment(String name, String description, Date dueDate){
      //Create with the sent data. Set the assigned date as the current date, or, send that info as well
      }
  
       public void removeAssignment(int index){
      //remove assignment from lists at index index
      }
  
       public String showAsAssigned(){
      //return lists in formatted fashion, sorting by assigned date
      }
  
       public String showAsDue(){
      //return lists in formatted fashion, sorting by due date
      }
  
       public void removeOldDates(){
      //remove dates that have passed
      }
   }


This post has been edited by webbywebb: 9 Oct, 2008 - 02:12 PM
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/20/08 06:11AM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month