Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need this JAVA programming assignment completed! All info is included! Security

ID: 3885407 • Letter: N

Question

Need this JAVA programming assignment completed! All info is included!

Security (Abstract) Interface: CostBasis Attributes A unique identifier for a customer, must be 7 digits in l Purchase date of Security in Julian date format-YYmddd. The value for year must be greater than 1g00The value for days must be between 1 and 365. inclusive Purchase price of Number of shares Market s private custNumber private purchDt: int must be r than 10000 double share, in dollars shares: double hased: for dis decimal posi tions should be limited to three (3 of Operations public Security nbr: String Full constructor date: int, price: double, gty: double, sym: Strine l:Security public toString): String Returns a formatted String object describing the Security object: The Security belongs to Customer# custNumber; shares shares of symbol were purchased on purchDt for SpurchPrc per share. The interface method calcCost is not given a concrete definition here. There can be no null constructor defined for this class. NOTES:

Explanation / Answer


CostBasis.java
------------------------
public interface CostBasis {
public double calcCost();
}
-------------- End--------------------
Security.java
--------------------
public abstract class Security implements CostBasis {
private String custNumber;
private int purchDT;
private double purchPrc;
private double shares;
private String symbol;
public Security() {
super();
}
public Security(String custName, int purchDT, double purchPrc,
double shares, String symbol) {
super();
this.custNumber = custName;
this.purchDT = purchDT;
this.purchPrc = purchPrc;
this.shares = shares;
this.symbol = symbol;
}
@Override
public String toString() {
return "The Security belongs to Customer# " + custNumber + "; Shares="
+ shares + " shares of symbol=" + symbol
+ " were purchased on " + purchDT + " $" + purchPrc
+ " per share";
}
public String getCustNumber() {
return custNumber;
}
public void setCustNumber(String custNumber) {
this.custNumber = custNumber;
}
public int getPurchDT() {
return purchDT;
}
public void setPurchDT(int purchDT) {
this.purchDT = purchDT;
}
public double getPurchPrc() {
return purchPrc;
}
public void setPurchPrc(double purchPrc) {
this.purchPrc = purchPrc;
}
public double getShares() {
return shares;
}
public void setShares(double shares) {
this.shares = shares;
}
public String getSymbol() {
return symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
}
--- End-----------------------------
MutualFunds.java
-----------------------------
public class MutualFunds extends Security {
private String type;
private double admin;
private char rptPeriord;
private boolean mgmt;
public MutualFunds() {
super();
}
public MutualFunds(String custName, int purchDT, double purchPrc,
double shares, String symbol, String type, double admin,
char rptPeriord, boolean mgmt) {
super(custName, purchDT, purchPrc, shares, symbol);
this.type = type;
this.admin = admin;
this.rptPeriord = rptPeriord;
this.mgmt = mgmt;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public double getAdmin() {
return admin;
}
public void setAdmin(double admin) {
this.admin = admin;
}
public char getRptPeriord() {
return rptPeriord;
}
public void setRptPeriord(char rptPeriord) {
this.rptPeriord = rptPeriord;
}
public boolean isMgmt() {
return mgmt;
}
public void setMgmt(boolean mgmt) {
this.mgmt = mgmt;
}
@Override
public double calcCost() {
return ((this.getShares() * this.getPurchPrc()) * (1 + this.getAdmin()));
}
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(
"The Mutual friends belongs to Customer# "
+ this.getCustNumber() + ";")
.append(this.getShares() + "shares of " + this.getSymbol())
.append("was purchased on " + this.getPurchDT())
.append("for $" + this.getPurchPrc() + " per share")
.append(" ").append("This is " + this.getType() + "fund.")
.append(" ")
.append("Admin costs are capped at " + this.getAdmin())
.append(" ")
.append("The Report cycle is " + this.getRptPeriord())
.append(" ").append("The Fund is Managed " + this.isMgmt());
return buffer.toString();
}
}
------------------- End-------------------
Stock.java
---------------
public class Stock extends Security {
private String exchange;
private boolean dividends;
private int divDate;
private double divAmount;
public Stock() {
super();
}
public Stock(String custName, int purchDT, double purchPrc, double shares,
String symbol, String exchange, boolean dividends, int divDate,
double divAmount) {
super(custName, purchDT, purchPrc, shares, symbol);
this.exchange = exchange;
this.dividends = dividends;
this.divDate = divDate;
this.divAmount = divAmount;
}
public String getExchange() {
return exchange;
}
public void setExchange(String exchange) {
this.exchange = exchange;
}
public boolean isDividends() {
return dividends;
}
public void setDividends(boolean dividends) {
this.dividends = dividends;
}
public int getDivDate() {
return divDate;
}
public void setDivDate(int divDate) {
this.divDate = divDate;
}
public double getDivAmount() {
return divAmount;
}
public void setDivAmount(double divAmount) {
this.divAmount = divAmount;
}
@Override
public double calcCost() {
return (this.getShares() * (this.getPurchPrc() * this.getDivAmount()));
}
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("The stock is traded on exchange")
.append("The Stock does not pay a divided")
.append("A dividend of $" + this.getDivAmount()
+ "will be payed in the " + divDate + "Quater");
return buffer.toString();
}
}
-------------- End-------------------------

Description

----------------------

Since we cannot upload the zip file as answer. I am mentioning following java files above

1. CostBasis.java ( Interface)

2. Security.java

3. MutualFund.java

4. Stock.java

We need to place all the java files in one directory otherwise we need to include specific package name in java file.

Question ?

----------------

do You have source code of Test class mentioned in actual question ? beacuse it's too lengthy file for copy and paste.

If you don't have the same then i will be submitting it once you confirmed.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote