Results 1 to 5 of 5

Thread: edit data??

  1. #1
    Daniela_v is offline Member
    Join Date
    Mar 2009
    Posts
    5
    Rep Power
    0

    Default edit data??

    If the user must input values, how can I enable the user to edit these values. Can u pls give me an example.What is the code for retrieving the data to edit it, and then update this data ?

    thanks in advance

  2. #2
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default

    You mean something like the following:
    • user inputs data
    • print to screen what user input
    • ask again if user want's to change his input


    Luck,
    CJSL
    Last edited by CJSLMAN; 03-06-2009 at 02:37 AM. Reason: typo
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  3. #3
    Daniela_v is offline Member
    Join Date
    Mar 2009
    Posts
    5
    Rep Power
    0

    Default

    thanks for the help but I don't really understand how to do that.I made this code for the user to input data:

    class editstudentdetails
    {
    public static void main(String[] args){

    int N;
    String[] studName;

    if (int N=0;N<studName.length;N++){

    System.out.print("Enter name for student number" +N+ ":" );
    studName[N]=keyboard.nextInt();
    System.out.print("Enter form /1-5/ for student " +N+ "." +studName+ ":" );
    studForm[N]=keyboard.nextInt();
    System.out.print("Enter group /A-D/ for student " +N+ "." +studName+ ":");
    studGroup[N]=keyboard.nextChar();
    System.out.print("Enter mark of maths for student" +N+ "." +studName+ ":");
    studMarkMths[N]=keyboard.nextInt();
    System.out.print("Enter mark of physics for student" +N+ "." +studName+ ":");
    studMarkPhys[N]=keyboard.nextInt();
    System.out.println("Enter mark of computing for student" +N+ "." +studName+ ":");
    studMarkComp[N]=keyboard.nextInt();

  4. #4
    Daniela_v is offline Member
    Join Date
    Mar 2009
    Posts
    5
    Rep Power
    0

    Default

    This is what I did so far but it's a total mess. Is this the way to display the details for each student of from 1-5 consecutively? I don't know how to make it right. I'm confused



    public class viewDetails(String[] studName, int[] studForm, char[] studGroup, int[] studMarkMths, int[] studMarkPhys, int[] studMarkComp)
    {
    public String getstudName()
    {
    return studName;
    }
    public Double getstudForm()
    {
    return studForm;
    }
    public Char getstudGroup()
    {
    return studGroup;
    }

    public Double getstudMarks()
    {

    return studMarkMths;
    return studMarkPhys;
    return studMarkComp;

    int f;
    for (f=0,f<=form.length, f++){

    System.out.print("Name:"+studName[f]);
    System.out.print("Form:"+studForm[f]);
    System.out.print("Group:"+studGroup[f]);
    System.out.print("Maths:"+studMarkMths[f]);
    System.out.print("Physics:"+studMarkPhys[f]);
    System.out.print("Computing:"+studMarkComp[f]);
    System.out.print("");
    System.out.print("");
    }

  5. #5
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default

    I'm thinking two things right now:
    1) You don't know what you need to do.... at least I'm confused about it. So why not sit down, take a big breath and write down exactly what you need your program to do. Then, when you understand that, write down the steps that need to happen to get that task done. Then when that is done you can start to commit grey matter to code.
    2) You don't have the Java basics to go forward. I would suggest studing the following tutorial:
    The Java™ Tutorials

    Another good link is the Java 6 API Specification,, which tells the specifics about the Java classes and their methods:
    Java Platform SE 6

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

Similar Threads

  1. How To Edit/Add JSP Pages in NetBeans IDE
    By JavaForums in forum NetBeans
    Replies: 2
    Last Post: 02-17-2009, 11:14 AM
  2. Edit and compile
    By lmperator in forum New To Java
    Replies: 7
    Last Post: 01-03-2009, 05:15 PM
  3. Edit Command
    By viji83 in forum New To Java
    Replies: 1
    Last Post: 08-15-2008, 03:26 AM
  4. Basic keyboard input and edit
    By BHCluster in forum New To Java
    Replies: 18
    Last Post: 08-08-2008, 11:52 PM
  5. how to edit lines.
    By jason27131 in forum New To Java
    Replies: 1
    Last Post: 08-01-2007, 04:41 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
  •