VIPSolutions logo ✨ VIPSolutions

Program Name: DataCenterCostAnalysis.java Virtual Cloud Unlimited (VCU) is a cloud computing startup that manages data centers to sell to other companies. VCU has created a text file of their data center cost data that we looked at in Project 2. You will write a program that will accept at the command line two filenames: one is a text file containing the data center cost data and the other is an output filename. The data in the first text file consists of information about the data centers that VCU manages. The data contains many lines of data, one for each data center. Each line of data contains information about a data center: The construction firm building the data center The construction cost of the data center (in millions of dollars) The IT load of the data center (in megawatts) The operating cost of the data center (in millions of dollars) A sample text file is below: nginx Copy Edit Turner 442.2 168.4 19.0 Holder 584.8 307.2 26.4 HITT 420.7 21.8 11.1 DPR 726.5 271.0 24.5 Fortis 574.1 50.5 12.7 Mortenson 717.0 117.7 16.2 JEDunn 763.4 199.6 20.7 Clune 527.9 289.1 25.5 DataCenter Before implementing DataCenterCostAnalysis.java, we will create an object to encapsulate the data values associated with a data center. Here are the specifications for the DataCenter.java class: You will have 4 instance variables: constructionFirm: String, constructionCost: double, ITLoad: double, operatingCost: double You will have a default constructor that sets all string values to an empty String and numeric values to 0.0. You will have a parameterized constructor that passes in a constructionFirm, constructionCost, ITLoad, and operatingCost to set to the instance variables You will have getters and setters for each instance variable You will have a toString() method that will return the constructionFirm, constructionCost, ITLoad, and operatingCost separated by a space. Each double value will be rounded to two decimal places using String.format().

Question:

Program Name: DataCenterCostAnalysis.java Virtual Cloud Unlimited (VCU) is a cloud computing startup that manages data centers to sell to other companies. VCU has created a text file of their data center cost data that we looked at in Project 2. You will write a program that will accept at the command line two filenames: one is a text file containing the data center cost data and the other is an output filename. The data in the first text file consists of information about the data centers that VCU manages. The data contains many lines of data, one for each data center. Each line of data contains information about a data center: The construction firm building the data center The construction cost of the data center (in millions of dollars) The IT load of the data center (in megawatts) The operating cost of the data center (in millions of dollars) A sample text file is below: nginx Copy Edit Turner 442.2 168.4 19.0 Holder 584.8 307.2 26.4 HITT 420.7 21.8 11.1 DPR 726.5 271.0 24.5 Fortis 574.1 50.5 12.7 Mortenson 717.0 117.7 16.2 JEDunn 763.4 199.6 20.7 Clune 527.9 289.1 25.5 DataCenter Before implementing DataCenterCostAnalysis.java, we will create an object to encapsulate the data values associated with a data center. Here are the specifications for the DataCenter.java class: You will have 4 instance variables: constructionFirm: String, constructionCost: double, ITLoad: double, operatingCost: double You will have a default constructor that sets all string values to an empty String and numeric values to 0.0. You will have a parameterized constructor that passes in a constructionFirm, constructionCost, ITLoad, and operatingCost to set to the instance variables You will have getters and setters for each instance variable You will have a toString() method that will return the constructionFirm, constructionCost, ITLoad, and operatingCost separated by a space. Each double value will be rounded to two decimal places using String.format().

This is AI generated Response.
Asked by: Test User 100118
Created at: 2025-05-01 08:26:23

Final Answer:

Rendered Raw Text
Did you like this answer?
Certainly! Below is the implementation of the `DataCenter.java` class based on the specifications provided: ```java public class DataCenter { // Instance variables private String constructionFirm; private double constructionCost; private double ITLoad; private double operatingCost; // Default constructor public DataCenter() { this.constructionFirm = ""; this.constructionCost = 0.0; this.ITLoad = 0.0; this.operatingCost = 0.0; } // Parameterized constructor public DataCenter(String constructionFirm, double constructionCost, double ITLoad, double operatingCost) { this.constructionFirm = constructionFirm; this.constructionCost = constructionCost; this.ITLoad = ITLoad; this.operatingCost = operatingCost; } // Getters public String getConstructionFirm() { return constructionFirm; } public double getConstructionCost() { return constructionCost; } public double getITLoad() { return ITLoad; } public double getOperatingCost() { return operatingCost; } // Setters public void setConstructionFirm(String constructionFirm) { this.constructionFirm = constructionFirm; } public void setConstructionCost(double constructionCost) { this.constructionCost = constructionCost; } public void setITLoad(double ITLoad) { this.ITLoad = ITLoad; } public void setOperatingCost(double operatingCost) { this.operatingCost = operatingCost; } // toString() method @Override public String toString() { return String.format("%s %.2f %.2f %.2f", constructionFirm, constructionCost, ITLoad, operatingCost); } } ``` --- ### Explanation: - The class defines four private instance variables as specified. - The default constructor initializes string to empty and doubles to 0.0. - The parameterized constructor allows setting all variables at object creation. - Getters and setters are provided for each variable. - The `toString()` method formats the output with two decimal places for the double values, aligning with the requirement to round to two decimal places. --- ### Next Steps: You can now proceed to implement the `DataCenterCostAnalysis.java` class that will utilize this `DataCenter` class to read data from a file, process it, and write results to an output file as per your project requirements. If you'd like, I can help you with that implementation as well!

📢 Instructions:

  • Ask anything relatd to above question only.
  • For new Question goto :

Study Help, Fast Answers

VIPSolutions focuses on clear, step‑by‑step explanations so you can learn quickly. Whether you need an AI‑generated walkthrough or a short hint to get unstuck, each solution is organized for fast reading and easy review later.

Search similar questions, compare approaches, and bookmark the best answers for revision. Our goal is simple: quick, reliable study help that feels natural—not noisy.