Advertisement
ciacho152

Applicant

Jul 24th, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.52 KB | None | 0 0
  1. import java.util.Scanner;
  2. /**
  3.  * Write a description of class Applicant here.
  4.  *
  5.  * @author (Your mom)
  6.  * @version (perturbed koala)
  7.  */
  8. public class Applicant
  9. {
  10.     // instance variables - replace the example below with your own DICK
  11.     private String name;
  12.     private String surname;
  13.     private int age;
  14.     private String sex;
  15.     private String schoolname;
  16.     private Results[] results;
  17.     Scanner user_input= new Scanner (System.in);
  18.  
  19.     /**
  20.      * Constructor for objects of class Applicant's DICK
  21.      */
  22.     public Applicant(String input_name, String input_surname, int input_age, String input_sex, String input_schoolname)
  23.     {
  24.         // initialise instance variables
  25.        this.name=input_name;
  26.        this.surname=input_surname;
  27.        this.age=input_age;
  28.        this.sex=input_sex;
  29.        this.schoolname=input_schoolname;
  30.     }
  31.    
  32.     public String inputDetails() //method that takes user's input and assigns it to variables
  33.     {
  34.         System.out.print("Enter applicant's name: ");
  35.         public String input_name=user_input.next();
  36.         System.out.print("Enter applicant's surname: ");
  37.         public String input_surname=user_input.next();
  38.         System.out.print("Enter applicant's age: ");
  39.         public String input_age=user_input.nextInt();
  40.         System.out.print("Enter applicant's sex: ");
  41.         public String input_sex=user_input.next();
  42.         System.out.print("Enter applicant's school: ");
  43.         public String input_schoolname=user_input.next();
  44.     }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement