Question
In java, i had to create -Create an abstract class called Client.java to allow for three abstract methods the bank needs to process. Name your
In java, i had to create
-Create an abstract class called Client.java to allow for three abstract methods the bank needs to process. Name your methods readData(), processData() and printData(). No arguments are needed for your methods.
-Create a BankRecords.java file which will utilize the Client asbtract methods and generate ultimately the client records from the csv file.
The client file has the following header information
id {string}
age {numeric}
sex {FEMALE,MALE}
region {INNER_CITY,TOWN,RURAL,SUBURBAN}
income {numeric}
married {NO,YES}
children {0,1,2,3}
car {NO,YES}
save_act {NO,YES}
current_act {NO,YES}
mortgage {NO,YES}
pep {YES,NO}
Which I did:
Client file:
public abstract class Client {
abstract void readData();
abstract void processData();
abstract void PrintData();
String id;
int age;
String sex;
String region;
float income;
boolean isMarried;
int childern;
boolean hasCar;
boolean hasSav_act;
boolean hasCur_act;
boolean mortgage;
boolean pep;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public float getIncome() {
return income;
}
public void setIncome(float f) {
this.income = f;
}
public boolean isMarried() {
return isMarried;
}
public void setMarried(boolean isMarried) {
this.isMarried = isMarried;
}
public int getChildern() {
return childern;
}
public void setChildern(int childern) {
this.childern = childern;
}
public boolean isHasCar() {
return hasCar;
}
public void setHasCar(boolean hasCar) {
this.hasCar = hasCar;
}
public boolean isHasSav_act() {
return hasSav_act;
}
public void setHasSav_act(boolean hasSav_act) {
this.hasSav_act = hasSav_act;
}
public boolean isHasCur_act() {
return hasCur_act;
}
public void setHasCur_act(boolean hasCur_act) {
this.hasCur_act = hasCur_act;
}
public boolean isMortgage() {
return mortgage;
}
public void setMortgage(boolean mortgage) {
this.mortgage = mortgage;
}
public boolean isPep() {
return pep;
}
public void setPep(boolean pep) {
this.pep = pep;
}
}
BankRecords:
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList;
public class BankRecords extends Client{ String csvFile = "C:/Users/anmamaha/Desktop/bank-Details.csv"; BufferedReader br = null; String line = ""; String cvsSplitBy = ","; ArrayList
@Override void processData() { // TODO Auto-generated method stub for(int i=0;i @Override void PrintData() { // TODO Auto-generated method stub //System.out.printf("%-20s%-11s%-18s%-16s%-12s%-26s%-12s ","S.no","ID","AGE","SEX","REGION","INCOME","MORTGAGE"); System.out.println("S.no \t\t"+" ID \t\t"+"AGE \t\t"+ "SEX \t\t"+"REGION \t\t\t"+ "INCOME \t\t" +"MORTGAGE \t\t"); for(int i=0;i As well I added the exel file to the project: But when I run the project It keeps giving me an error: How can I fix this problem? Other snapshots:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started