#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    0

    Appointment system


    Appointment ID
    A001
    A002
    A003

    Appointment time
    0905
    1000
    1550

    Name
    Peter
    Mary
    Sandy

    Gender
    M
    F
    F

    Age
    25
    30
    22

    Discount
    Yes
    No
    No

    Cost
    222.50
    118.00
    223.75

    The questions is i have to study the above data and write a program to declare variables for each field.

    ==============================================

    I need help with this question, after keying in the codes. I am stuck. Not sure how to proceed. Below are my codes, Can someone help me out on this question?

    import java.util.Scanner;
    public class Apptsys {
    public static void main (String [ ] args);
    Scanner sc = new Scanner(System.in);
    String str = apptID;
    String str = apptTime;
    String str = name;
    char gender;
    int age = sc.nextInt;
    boolean Discount;
    double cost;
    System.out.print("Enter new Appointment id = " +apptID);
    }
    }
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    write a program to declare variables for each field.
    Make a list of the fields that you need and what types of data each will hold.
    That will help you decide what variables are needed. The words in bold look like the names for the variables.

    What more needs to be done to the posted code?

    Please edit the post and wrap the code in code tags.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    0
    Originally Posted by NormR
    Make a list of the fields that you need and what types of data each will hold.
    That will help you decide what variables are needed. The words in bold look like the names for the variables.

    What more needs to be done to the posted code?

    Please edit the post and wrap the code in code tags.
    Hi NormR,
    Thanks for the reply, as i am a new member and i can't post html links thus I type in the question. The quote you had made was the question title and those you see before it was the question.

    Recap, this is the question
    Appointment ID
    A001
    A002
    A003

    Appointment time
    0905
    1000
    1550

    Name
    Peter
    Mary
    Sandy

    Gender
    M
    F
    F

    Age
    25
    30
    22

    Discount
    Yes
    No
    No

    Cost
    222.50
    118.00
    223.75

    The questions is i have to study the above data and write a program to declare variables for each field.
  6. #4
  7. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    What is wrong with the code you posted? It appears to have variables defined in it.

    NOTE: When posting code be sure to wrap the code in code tags.

IMN logo majestic logo threadwatch logo seochat tools logo