This project will be tested using the Catch2 ( ) test framework. This file also includes a typedef of an enum used for the four arithmetic functions called FUNCTIONS. This abstract class (CalcListInterface) contains the pure virtual version of all the required methods. This project includes an abstract class for the CalcList from which to inherit. Returns a string of the list of operations completed so far formatted with a fixed point precision. std::string toString(unsigned short precision) const Removes the last operation from the calc list and restores the previous total. Example: newOperation(ADDITION, 10) => adds 10 to the total. The operation alters total by using the function with the operand. void newOperation(const FUNCTIONS func, const double operand)Īdds an operation to the CalcList and creates a new total. The program should not have to iterate through the entire list each time the total is needed. Total should run as a constant time operation. This method returns the current total of the CalcList. The calculator has to implement at least four methods:Ībstract Class and Files double total() const Any projects that use the C++ Standard Library Lists or other sources to implement the linked list will receive a zero. The calculator (which must be called “CalcList”) has to be implemented using a singly, doubly, or circularly linked list. The calculator will also be able to output a string of the operations completed so far with fixed precision. The calculator will also have an “undo” function for removing the last operation. The calculator will keep a running total of the operations completed, the number of operations completed, and what those operations were. The calculator will be able to perform addition, subtraction, multiplication, and division. For Programming Project 1, the student will implement a linked list based arithmetic calculator.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |