Question
You use Excel Spreadsheet. You know what it is. A spreadsheet has its column title starting with the letter A, representing the first column. The
You use Excel Spreadsheet. You know what it is. A spreadsheet has its column title starting with the letter "A", representing the first column. The 2nd column's title is "B", and so on.
Write the following class member function that takes your Excel spreadsheet column title as input, and computes its corresponding column number in integer:
class CIS14 { public: int convertExcelTitleToNumber(string* s); };
For examples:
Input A Output: 1
Input: B
Output: 2 Input: Z
Output: 26
Input: AA Output: 27
Input: AB Output: 28
Input: AAA Output: 703
Input: AAAA Output: 18279
Constraints / Assumptions:
If input is NULL, return -1
The function takes a pointer to the input title string
Input is always a valid Excel column title (namely the title string contains only valid UPPER English characters 'A' - 'Z')
Your main() won't be graded but your class and its functionality will be graded.
It is your responsibility to compile your code in C++11/C++14 (no pre-C++11!). Failure to do that means your code isn't compilable and you will receive 0 points.
Wrong member function signature or wrong class declaration receive -1 styling point each
Grading for this problem is as follows:
Logic: 8 points (-1 point for each test failure)
Styling/Documentation: 2 points (-1 for wrong function signature, -1 for wrong class declaration, and/or -1 for lack of documentation)
1 2345678Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started