i need your help to solve this coding..
i hope anyone can help me to done this project..
import java.util.*;
public class clinic {
public clinic(){
}
public static void main(String[] args) {
int choice;
Scanner input = new Scanner(System.in);
System.out.println(" SYSTEM CLINIC REGISTRATION");
System.out.println(" 1. Admin Menu ");
System.out.println(" 2. Doctor Menu ");
System.out.println(" 3. Exit Menu ");
System.out.println(" Enter your choice : ");
choice = input.nextInt();
if(choice == 1){
mainMenu();
}
else if(choice == 2){
doctorMenu();
}
else if(choice == 3){
exit(0);
}
else {
System.out.println(" Sorry, invalid data");
}
}
public class admin extends clinic {
public void mainMenu() {
int choice;
System.out.println(" 1. Insert Patient ");
System.out.println(" 2. Update Patient ");
System.out.println(" 3. search Patient ");
System.out.println(" 4. Display Patient ");
System.out.println(" 5. Remove Patient ");
System.out.println(" 6. Exit ");
Scanner input = new Scanner(System.in);
System.out.println(" Enter your menu :");
choice = input.nextInt();
if(choice == 1){
InsertPatient();
}
else if(choice == 2){
UpdatePatient();
}
else if( choice == 3){
RemovePatient();
}
else if(choice == 4){
SearchPatient();
}
else if(choice == 5){
Display();
}
else
System.out.println("Sorry, Invalid Data");
}
public void InsertPatient (){
String name, address, date,id;
int phoneNo;
Scanner input = new Scanner(System.in);
System.out.println("\t PATIENT RECORD ");
System.out.println("-----------------------------");
System.out.println("Enter patient name :");
name = input.next();
System.out.println(" Enter patient id :");
id = input.next();
System.out.println(" Enter patient address :");
address = input.next();
System.out.println(" Enter patient Phone Number :");
phoneNo = input.nextInt();
System.out.println(" Enter patient date visiting :");
date = input.next();
}
public void UpdatePatient(){
String id, date, input;
int phoneNo;
Scanner input = new Scanner(System.in);
System.out.println(" ** Update patient data** ");
System.out.println("------------------------------- ");
System.out.println(" Enter patient id:");
id = input.next();
if (input == id){
System.out.println(" Phone Number :");
phoneNo = input.nextInt();
System.out.println(" visiting date (DDMMYY) :" );
date = input.next();
}
else
{
System.out.println(" sorry, data not found! ");
}
}
public void SearchPatient(){
}
public void RemovePatient( ){
do{
char answer;
Scanner input = new Scanner(System.in);
System.out.println(" ** DELETE PATIENT ** ");
System.out.println(" ");
System.out.println(" Do you want remove the data ?");
System.out.println(" Y = Yes or N = No ");
answer = input.next();
if (answer == 'y' || answer == 'Y')
{
name=0;
id=0;
address=0;
phoneNo=0;
date=0;
System.out.println(" Your data has been deleted ");
}
else{
System.out.println(" Sorry, Data not in the list");
}
} while(answer=='n' ||answer=='N');
}
public void Display(){
String name ,address ,id,date ;
int phoneNo;
System.out.println("****************************** *****");
System.out.println(" PATIENT INFORMATION ");
System.out.println("****************************** *****");
System.out.println(" Patient name :" + name);
System.out.println(" Patient Id :" + id);
System.out.println(" Patient Addres :" + address);
System.out.println(" Patient Phone Number :" + phoneNo);
System.out.println(" Patient Date Visiting:" + date);
}
}
public class doctor extends clinic {
public void doctorMenu (){
int choice;
Scanner input = new Scanner(System.in);
System.out.println(" -- DOCTOR MENU -- ");
System.out.println(" 1. UPDATE PATIENT ");
System.out.println(" 2. SEARCH PATIENT ");
System.out.println(" 3. EXIT ");
System.out.println(" Enter your choice :");
choice=input.nextInt();
switch(choice){
case 1 :
UpdatePatient();
break;
case 2 :
SearchPatient();
break;
case 3 :
mainMenu();
default :
System.out.println(" invalid insertion ");
break;
public void UpdatePatient(){
int phoneNo;
String id;
Scanner input = new Scanner(System.in);
System.out.println(" ** Update patient data** ");
System.out.println(" ");
System.out.println(" Enter patient id:");
id = input.next();
System.out.println(" Phone Number :" + phoneNo);
phoneNo = input.nextInt();
}
public void SearchPatient(){
String id, address, phoneNo, name, input;
Scanner input = new Scanner(System.in);
System.out.println(" Enter patient id:");
id = input.next();
if (input = id){
System.out.println(" Name :" + name);
System.out.println(" Id :" + id);
System.out.println(" Address :" + address);
System.out.println(" Phone No:" + phoneNo);
}
else {
System.out.println(" invalid data");
}
}
}
}