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.

You use Excel Spreadsheet. You know what it is. A spreadsheet has

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 2345678

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!