Calculator Class (OOP algorithm): Documentation




Produced by CDE Programming Core.

Website produced by CDE Programming Core.

Welcome to the documentation page for the Calculator class! Click here to go back to the main page.


The methods that a programmer would use are below.


A picture of the user friendly methods or in otherwords the only methods a user needs to use.

Methods intended for use from programmer



  1. __init__(equation)


  2. solve()


  3. return_answer()


  4. return_answer_string()

This next list of methods are methods that the class uses. Note they can be used in other programs possibly requiring only slight modifications.


A picture of the simple arithmetic methods like add, subtract, times, and dividing of the class

Simple arithmetic methods



  1. add(num1, num2)


  2. subtract(num1, num2)


  3. times(num1, num2)


  4. divide(num1, num2)


  5. power(num1, num2)


  6. xroot(num1, num2)

These are methods that performed scans on the actions (cleaned, counted, and modified). Actions are things like +, -, *, /


A Picture of the methods that would scan, count, or modify / clean actions/.

Methods for actions like +, -, *, / ect



  1. check_for_action(string)


  2. check_for_spec_action(string)


  3. clean_actions(string)


  4. check_to_overwrite_actions(action1, action2)


  5. get_actions(list)


  6. final_clean(string)

These methods are methods used for things like parsing, and solve the parsed items.


This picture shows the methods for parsing and solving those parsed items.

Parsing methods, and methods to solve the parsed objects.



  1. get_occurrences(string, value)

  2. solve_and_set_answer(string)


  3. parse_string_and_solve(string)


  4. prep_and_solve_parse(split_str_list)


  5. solve_parse_chunk(split_str_list, solve_location)


  6. fix_doubles(split_list)

These are uncatagorized, simple methods used to do simple tasks.


A Picture of uncatagorized methods. Just another picture. :P

Uncatagorized Methods



  1. find_last_of(string, value)


  2. find_first_of(string, value)


  3. list_to_string(list)

These are index methods. These are specifically tailored to find index's of items in different ways.


A Picture of all the index methods.

Index Methods



  1. swap_indexs(string, index1, index2)


  2. check_for_bad_index(num, max)


  3. replace_index(string, start_index, end_index, new_str)


  4. get_border_indexs(string, value1, value2)


  5. multiple_split(string, list)