Spreadsheet Application Gaming Project in C++

Explanation

  1. Class Definition:
    • Spreadsheet class is used to manage a 2D grid of cells.
    • It has private members data (a 2D vector of strings) to store cell values, and rows, cols to store the dimensions of the spreadsheet.
  2. Constructor:
    • Initializes the data vector with empty strings and sets the dimensions.
  3. Member Functions:
    • setValue(size_t row, size_t col, const std::string& value): Sets the value at the specified cell if coordinates are valid.
    • getValue(size_t row, size_t col) const: Retrieves the value from the specified cell if coordinates are valid.
    • display() const: Displays the entire spreadsheet with each cell formatted to a fixed width.
  4. Main Function:
    • Takes user input to create the spreadsheet with specified dimensions.
    • Provides a menu to set values, get values, display the spreadsheet, or exit.
    • Handles user interactions through a loop and processes choices accordingly.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top