Java Project
Java Project
InputMismatchException;
import java.util.Scanner;
String name;
String number;
String address;
void getdata() {
name = scanner.next();
number = scanner.next();
address = scanner.next();
void showdata() {
String name;
String degree;
void getedu() {
name = scanner.next();
degree = scanner.next();
void showedu() {
String name;
String phno;
String address;
String doctorName;
void getapp() {
name = scanner.next();
phno = scanner.next();
address = scanner.next();
doctorName = scanner.next();
}
public static void main(String[] args) {
username = 123;
password = 123;
try {
System.out.print("Username: ");
cUsername = scanner.nextInt();
System.out.print("Password: ");
cPassword = scanner.nextInt();
} catch (InputMismatchException e) {
int choice;
System.out.println("================================================");
System.out.println("================================================");
choice = scanner.nextInt();
if (choice == 1) {
Patient patient = new Patient();
int subChoice;
System.out.println("=========================================");
System.out.println("=========================================");
subChoice = scanner.nextInt();
if (subChoice == 1) {
patient.getdata();
} else if (subChoice == 2) {
patient.showdata();
} else {
System.out.println("Invalid entry.");
} else if (choice == 2) {
int subChoice;
System.out.println("=========================================");
System.out.println("=========================================");
subChoice = scanner.nextInt();
if (subChoice == 1) {
doctor.getedu();
} else if (subChoice == 2) {
doctor.showedu();
} else {
System.out.println("Invalid entry.");
}
} else if (choice == 3) {
appointment.getapp();
} else {
System.out.println("Invalid entry.");
} else {