Question
I have completed CloudStorage and DedicatedCloud.java. Can anyone finish the rest? please contact me public abstract class CloudStorage { private static int count; protected String
I have completed CloudStorage and DedicatedCloud.java. Can anyone finish the rest?
please contact me
public abstract class CloudStorage {
private static int count;
protected String cloudName;
protected double BaseStorageCost;
CloudStorage() {
count++;
}
CloudStorage(String nm, double bsc) {
this.cloudName = nm;
this.BaseStorageCost = bsc;
}
// end param constrctor CloudStorage
String getName(){
return this.cloudName;
}
void setName(String nm) {
this.cloudName = nm;
}
double getBaseStorageCost(){
return this.BaseStorageCost;
}
void setBaseStorageCost(double bsc) {
this.BaseStorageCost = bsc;
}
static int getCount() {
return count;
}
static void resetCount(){
count = 0;
}
public String toString() {
String output = getName() + " (" + getClass() + ") "
+ "Monthly Cost: $ " + MonthlyCost();
output += " " + "Base Storage Cost: $" + getBaseStorageCost();
return output;
}
public abstract doubleMonthlyCost();
}
import java.text.DecimalFormat;
public class DedicatedCloud extends CloudStorage {
private double ServerCost;
/***
* @param nm gets name.
* @param bsc gets BaseStorageCost.
* @param ServerCostIn gets cost for sercers.
*/
public DedicatedCloud(String nm, double bsc, double ServerCostIn) {
super(nm, bsc);
this.ServerCost = ServerCostIn;
}
/**
* @return the ServerCost
*/
public double getServerCost() {
return ServerCost;
}
/**
* @param ServerCost
* the ServerCost to set
*/
public void setServerCost(double ServerCostIn) {
this.ServerCost = ServerCost;
}
public double MonthlyCost() {
double MonthlyCost = ServerCost + BaseStorageCost;
return MonthlyCost;
}
public String toString() {
DecimalFormat fmt = new DecimalFormat("$#,##0.00");
String output;
output = super.toString()
+ " Server Cost: " + fmt.format(getServerCost());
return output;
}
}
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