Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 dataList = new ArrayList(); BankRecords bankrecords[]; BankRecords(){ } @Override void readData() { // TODO Auto-generated method stub try{ br = new BufferedReader(new FileReader(csvFile)); while ((line = br.readLine()) != null) { dataList.add(line); } bankrecords= new BankRecords[dataList.size()]; } catch(FileNotFoundException e){ System.out.println("Exception occured: "+e); } catch(Exception e){ System.out.println("Exception occured: "+e); }finally { if (br != null) { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } }

@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:

image text in transcribed

But when I run the project It keeps giving me an error:

image text in transcribed

How can I fix this problem?

Other snapshots:

image text in transcribed

image text in transcribed

a JRE system LIbrary pavast- src (default package) D BankRecords,java > [A Client.java bank-Detail (1).csv

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

2. Clearly identify time constraints.

Answered: 1 week ago

Question

understand the key issues concerning international assignments

Answered: 1 week ago