I want to write a program on Stock Brock/trading Reconciliation application. There is a stock brocking firm holdings traders/investors profile who have invested in various company’s stocks and taken number of shares.
Each stock having per second stock price.
Investors buy number of share from particular company.
Investor buy/sell shares basis on day calculation (intraday) stocks.
Investors has to pay brokerage charges 2$ on per transaction.
Reconcile the profit/loss of investors by trading the stocks.
My Designed classes are;
// Stock class
public class Stock {
public String companyName = null;
public String stockRating = null;
public int price = 0;
public int numberOfShares = 0;
public Stock(String companyName, String stockRating, int stockPrice, int numberShares) {
// TODO Auto-generated constructor stub
this.companyName = companyName;
this.stockRating = stockRating;
this.price = price;
this.numberOfShares = numberShares;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getStockRating() {
return stockRating;
}
public void setStockRating(String stockRating) {
this.stockRating = stockRating;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getNumberOfShares() {
return numberOfShares;
}
public void setNumberOfShares(int numberOfShares) {
this.numberOfShares = numberOfShares;
}
}
//Stock Holder class
public class ShareHolder {
private String shareHolderName;
private String uidaiNo;
private String bankDetails;
public String getShareHolderName() {
return shareHolderName;
}
public void setShareHolderName(String shareHolderName) {
this.shareHolderName = shareHolderName;
}
public String getUidaiNo() {
return uidai;
}
public void setUidaiNo(String uidai) {
this.uidai = uidai;
}
public String getBankDetails() {
return bankDetails;
}
public void setBankDetails(String bankDetails) {
this.bankDetails = bankDetails;
}
}
//StockPortfolio class
public class StockPortfolio {
private static final int PORTFOLIO_SIZE = 10;
private Stock [] stocksPortfolio;
public Stock [] getstocksPortfolio(){
return stocksPortfolio;
}
public void setstocksPortfolio(Stock [] value){
stocksPortfolio = value;
}
}
//Main class
import java.util.Scanner;
public class StockBrokingReconcilation {
private static StockPortfolio stockPortfolio;
private static final int PORTFOLIO_SIZE = 10;
private static void stockReconciling() {
for (int i = 0; i<PORTFOLIO_SIZE; i++){
Scanner console = new Scanner(System.in);
System.out.println ("Stock's name:");
String companyName = console.next();
System.out.println ("Stock's rating");
String stockRating = console.next();
System.out.println ("Stock's price:");
int stockPrice = console.nextInt();
System.out.println ("Numbers of shares: ");
int numberShares= console.nextInt();
stockPortfolio.getstocksPortfolio()[0] =
new Stock(companyName, stockRating, stockPrice, numberShares);
}
}
}
So, can any buddy help me to design this problem in better way as requirements are given above. If there is a sample program related to my title of the problem, please share the link. I am very new to design thinking.
Aucun commentaire:
Enregistrer un commentaire