Provide Implementation Model in Pseudocode containing a minimum of 5 modules. Th
ID: 3823950 • Letter: P
Question
Provide Implementation Model in Pseudocode containing a minimum of 5 modules.
The Recreation Outdoor Equipment (ROE) Company rents and sells recreational toys including canoes, tents, motorcycles, and trailers. The accountant for ROE requires a monthly Cash Requirements Report.
The accounting report is based on a monthly transaction sheet which first lists the date, then each ROE supplier name, the beginning balance owed to the supplier at the beginning of the month, and all supplier transaction records for the month. Each transaction record includes the transaction number, type and amount.
Transaction types represent either items bought (B) by ROE from the supplier or payments (P) made to that supplier.
ROE requires a monthly Cash Requirements Report to show all the information from the transaction sheet. Additionally at the end of each supplier transaction record the report must display the current running balance after appropriately adding or subtracting the transaction amount. And after each supplier's last transaction record the report must display the supplier final balance, supplier monthly purchase amount, and the supplier monthly payment amount.
Additionally after all suppliers are processed a report summary must show the overall final balance, total supplier purchases, total supplier payments, and the average monthly purchases per supplier. Also the summary must display the lowest final supplier balance and the supplier name of the supplier owed this balance. In the case of multiple instances of the lowest only report the first instance.
The supplier final balance is the current running balance plus any applicable interest changes.
Interest charges are applied when the total payments made to the supplier that month were less than the beginning balance forward.
The monthly interest rate is the yearly interest rate divided by 12 (months). ROE negotiates a yearly interest rate with each supplier.
The supplier monthly purchase and supplier monthly payment amounts are the dollar amounts for the specific supplier.
The average monthly purchase per supplier is the total purchase amount divided by the number of suppliers processed.
All numeric values representing balances, transaction amounts, totals and averages should be displayed with decimal positions to ensure monetary values are expressed in dollars and cents.
Having suffered growing pains in the early years ROE tries to limit their monthly balance forward to any one supplier to under a quarter million dollars. This has helped them be able to grow at a moderate pace and while being able to both hire new employees as well as take on new product lines.
ROE is willing to enter the data from the Monthly Transaction Sheet in the order shown in the test data. A zero (0) will be entered for the transaction number to indicate the end of entry for the supplier. The word "Done" will be entered for the supplier name to indicate end of entry for the month.
Recreation Outdoor Equipment Company
Monthly Transaction Sheet Date: February 2017 Supplier Name Balance Forward YearlyInterest Rate Trans
Number Trans
Type Trans Amount Big Mac Kayaks 25000.5 18% 100 B 22000.5 101 B 55000.5 102 P 20000.5 103 B 77000.5 0 Motors & Bikes 30000.5 16.5% 200 B 30000 201 B 30000 202 B 30000 203 P 20000 204 B 30000 0 Hattie Trailers 15000.5 20.5% 300 B 30000 301 P 9000 302 P 9000 303 B 111000 0 Done
Explanation / Answer
import java.util.ArrayList;
import java.util.List;
public class Node {
private Object state;
private Node parent;
private Object action;
private double pathCost;
public Node(Object state) {
this.state = state;
this.pathCost = 0.0;
}
public Node(Object state, Node parent, Object action, double stepCost) {
this(state);
this.parent = parent;
this.action = action;
this.pathCost = parent.pathCost + stepCost;
}
public Object getState() {
return state;
}
public Node getParent() {
return parent;
}
public Object getAction() {
return action;
}
public double getPathCost() {
return pathCost;
}
public boolean isRootNode() {
return parent == null;
}
public List<Node> getPathFromRoot() {
List<Node> path = new ArrayList<Node>();
Node current = this;
while (!current.isRootNode()) {
path.add(0, current);
current = current.getParent();
}
path.add(0, current);
return path;
}
public String toString() {
return "[parent=" + parent + ", action=" + action + ", state="
+ getState() + ", pathCost=" + pathCost + "]";
}
public String pathToString() {
String s = "";
List<Node> nodes = getPathFromRoot();
for (int i = 0; i < nodes.size(); i++) {
System.out.println("Action : " + nodes.get(i).getAction());
System.out.println("State : " + nodes.get(i).getState());
}
return s;
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.