Results 1 to 5 of 5
  1. #1
    DMarsh12 is offline Member
    Join Date
    Mar 2011
    Posts
    43
    Rep Power
    0

    Default Help with writing my own program

    I am trying to write a program where you select from a list of people, input a rating on them, and then additional comments. The information you input I want to be saved so that you can bring up the total amount of ratings you have for each person individually as well as a whole...I have not learned how to do this yet so I figured I would ask for help on here....Here is what I have so far....

    Java Code:
    import java.util.*;
    
    public class SA{
    	
    	public static void main (String [] args)
    	{
    		
    		int Dan;
    		int Ami;
    		int Alida;
    		int Chris;
    		int Mark;
    		int James;
    		int Wes;
    		int Alex;
    		int Rating;
    
    		System.out.println("1. Dan");
    		System.out.println("2. Ami");
    		System.out.println("3. Alida");
    		System.out.println("4. Chris");
    		System.out.println("5. Mark");
    		System.out.println("6. James");
    		System.out.println("7. Wes");
    		System.out.println("8. Alex");
    		
    		System.out.println();
    		
    		System.out.println("Enter what ambassador you would like to submit a review card for.");
    		
    		Scanner keyboard=new Scanner(System.in);
    		
    		int SAR=keyboard.nextInt();
    		if (SAR==1)
    		{
    			System.out.println("Review Card for Daniel");
    			System.out.print("First and Last Name");
    			String first=keyboard.next();
    			String last=keyboard.next();
    			System.out.println(first + " " + last);
    			System.out.print("Rating");
    			Rating=keyboard.nextInt();
    			System.out.println("Comments");
    			String RV=keyboard.next();
    			
    			if (Rating >5)
    				System.out.println("The number must be between 1 and 5.");
    			
    		}
    		
    		if (SAR==2)
    		{
    			System.out.println("Review Card for Ami");
    			System.out.print("First and Last Name");
    			String first=keyboard.next();
    			String last=keyboard.next();
    			System.out.println(first + " " + last);
    			System.out.print("Rating");
    			Rating=keyboard.nextInt();
    			System.out.println("Comments");
    			String RV=keyboard.next();
    			
    			if (Rating >5)
    				System.out.println("The number must be between 1 and 5.");
    			
    		}
    		
    		if (SAR==3)
    		{
    			System.out.println("Review Card for Alida");
    			System.out.print("First and Last Name");
    			String first=keyboard.next();
    			String last=keyboard.next();
    			System.out.println(first + " " + last);
    			System.out.print("Rating");
    			Rating=keyboard.nextInt();
    			System.out.println("Comments");
    			String RV=keyboard.next();
    			
    			if (Rating >5)
    				System.out.println("The number must be between 1 and 5.");
    			
    		}
    		
    		if (SAR==4)
    		{
    			System.out.println("Review Card for Chris");
    			System.out.print("First and Last Name");
    			String first=keyboard.next();
    			String last=keyboard.next();
    			System.out.println(first + " " + last);
    			System.out.print("Rating");
    			Rating=keyboard.nextInt();
    			System.out.println("Comments");
    			String RV=keyboard.next();
    			
    			if (Rating >5)
    				System.out.println("The number must be between 1 and 5.");
    			
    		}
    		
    		
    		else
    			System.out.println("Select a number 1 through 8 please.");
    		}
    		
    	}
    what I really don't know how to do at all is make it so that the information you input is saved and can be brought up again...any help would be greatly appreciated.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default Re: Help with writing my own program

    make it so that the information you input is saved
    Do you want to write the info to a disk file so you can later read the file to retrieve the info?
    Or do you want to save it in the program for later use in the program?

  3. #3
    DMarsh12 is offline Member
    Join Date
    Mar 2011
    Posts
    43
    Rep Power
    0

    Default Re: Help with writing my own program

    Quote Originally Posted by Norm View Post
    Do you want to write the info to a disk file so you can later read the file to retrieve the info?
    Or do you want to save it in the program for later use in the program?
    i want to save it in the program for later use in the program

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default Re: Help with writing my own program

    Then its time to learn how to write a class, put data into the class object and save the class object in an ArrayList.
    There are lots of tutorials out there that explain all this.
    Lesson: Object-Oriented Programming Concepts (The Java™ Tutorials > Learning the Java Language)
    Lesson: Implementations (The Java™ Tutorials > Collections)

  5. #5
    DMarsh12 is offline Member
    Join Date
    Mar 2011
    Posts
    43
    Rep Power
    0

    Default Re: Help with writing my own program

    Quote Originally Posted by Norm View Post
    Then its time to learn how to write a class, put data into the class object and save the class object in an ArrayList.
    There are lots of tutorials out there that explain all this.
    Lesson: Object-Oriented Programming Concepts (The Java™ Tutorials > Learning the Java Language)
    Lesson: Implementations (The Java™ Tutorials > Collections)
    ty i appreciate it

Similar Threads

  1. writing a program launcher (or Timer)
    By Farzaneh in forum Threads and Synchronization
    Replies: 3
    Last Post: 02-17-2009, 09:00 AM
  2. Writing a program(HELP!! It's due tommorrow!!!!!)
    By mk3823 in forum New To Java
    Replies: 9
    Last Post: 10-24-2008, 11:13 AM
  3. Due Tommorow Writing a Program Please Help
    By gallimaufry in forum New To Java
    Replies: 4
    Last Post: 10-23-2008, 03:15 AM
  4. how begin with writing a new program ?
    By dimitrist in forum New To Java
    Replies: 11
    Last Post: 05-13-2008, 03:49 AM
  5. Help needed writing a program...
    By Francis in forum New To Java
    Replies: 2
    Last Post: 11-22-2007, 02:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •