Untitled
unknown
plain_text
2 years ago
5.0 kB
15
Indexable
package view;
import java.util.*;
import model.Underwriter;
import model.Vehicle;
public class MVC_Main {
public static void main(String[] args) {
Underwriter u = new Underwriter();
Vehicle v = new Vehicle();
Scanner sc = new Scanner(System.in);
boolean flag = true;
while(flag) {
try {
System.out.println("Input 1 for Admin");
System.out.println("Input 2 for Underwriter");
int choice = sc.nextInt();
switch(choice) {
case 1:
boolean f = true;
while(f) {
try {
System.out.println("Input 1 for Underwriter Reg");
System.out.println("Input 2 to search Underwriter by ID");
System.out.println("Input 3 to update underwriter password");
System.out.println("Input 4 to delete underwriter by ID");
System.out.println("Input 5 to view all underwriters");
System.out.println("Input 6 to view all vehicle specific by underwriter ID");
int ch = sc.nextInt();
switch(ch) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
default:
System.out.println("Wrong Input!");
}
}catch(InputMismatchException e1) {
System.out.println("Wrong Input");
}
}
case 2:
boolean fg = true;
while(fg) {
try {
System.out.println("Input 1 to create new vehicle insurance");
System.out.println("Input 2 to renew policy");
System.out.println("Input 3 to change policy type");
System.out.println("Input 4 to view policy");
int c = sc.nextInt();
switch(c) {
case 1:
case 2:
case 3:
case 4:
default:
System.out.println("Wrong Input!");
}
}catch(InputMismatchException e2) {
System.out.println("Wrong Input");
}
}
default:
System.out.println("Wrong input!");
}
}catch(InputMismatchException e) {
System.out.println("Wrong input!");
}
}
sc.close();
}
}
package model;
import java.time.LocalDate;
public class Underwriter {
private int uid;
private String name;
private LocalDate dob;
private LocalDate jd;
private String pwd;
public int getId() {
return uid;
}
public void setId(int uid) {
this.uid = uid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public LocalDate getdob() {
return dob;
}
public void setdob(LocalDate dob) {
this.dob = dob;
}
public LocalDate getjd() {
return jd;
}
public void setjd(LocalDate jd) {
this.jd = jd;
}
public String getpwd() {
return pwd;
}
public void setpwd(String pwd) {
this.pwd = pwd;
}
@Override
public String toString() {
return "Underwriter [id= " + uid + ", name= " + name + ", dob= " + dob + ", jd= " + jd + ", password= " + pwd + "]";
}
}
package model;
import java.time.LocalDate;
public class Vehicle {
private int pno;
private String vno;
private String vtype;
private String cname;
private int engno;
private int chno;
private Long phno;
private String itype;
private int preamo;
private LocalDate fd;
private LocalDate td;
private int uid;
public int getpno() {
return pno;
}
public void setpno(int pno) {
this.pno = pno;
}
public int getId() {
return uid;
}
public void setId(int uid) {
this.uid = uid;
}
public String getvno() {
return vno;
}
public void setvno(String vno) {
this.vno = vno;
}
public String getvtype() {
return vtype;
}
public void setvtype(String vtype) {
this.vtype = vtype;
}
public String getName() {
return cname;
}
public void setName(String cname) {
this.cname = cname;
}
public int getengno() {
return engno;
}
public void setengno(int engno) {
this.engno = engno;
}
public int getchno() {
return chno;
}
public void setchno(int chno) {
this.chno = chno;
}
public Long getphno() {
return phno;
}
public void setphno(Long phno) {
this.phno = phno;
}
public String getitype() {
return itype;
}
public void setitype(String itype) {
this.itype = itype;
}
public int getpreamo() {
return preamo;
}
public void setpreamo(int preamo) {
this.preamo = preamo;
}
public LocalDate getfd() {
return fd;
}
public void setfd(LocalDate fd) {
this.fd = fd;
}
public LocalDate gettd() {
return td;
}
public void settd(LocalDate td) {
this.td = td;
}
@Override
public String toString() {
return "Vehicle [pno= " + pno + ", vno= " + vno + ", vtype= " + vtype + ", cname= " + cname + ", engno= " + engno + ", chno= " + chno + ", phno= " + phno + ", itype= " + itype + ", preamo= " + preamo + ", fd= " + fd + ", td= " + td + ", uid= " + uid + "]";
}
}
Editor is loading...
Leave a Comment