Finite Automata and the Recognition Problem
Recognizing Numbers in Scientific Normal Form

Introduction

A number is said to be represented in scientific notation if it is in the form of:

```           number = s * (r^exp)
```
where number is the number in scientific notation, s is called the significand, r is the radix (or base), and exp is the exponent. The number is said to be in normal form when the significand meets the criteria:
```           1 <= s < r
```
This rule implies that, for decimal numbers with no leading zeros, the decimal point always occurs at the right of the first significant symbol.

Example:
 Number Comment 23.24 Not in scientific normal form (SNF) since the base and the exponent are missing. 23.24*10^0 Not in SNF since the significand (23.24) is larger than the base 2.324*10^1 Is a number in SNF: the significand (2.324) is larger than 1 and smaller than 10, and it is multiplied by the base (10) raised at some power (1).

For practical and historical reasons, numbers in scientific notation are entered in computers in a slightly different format: the base (understood to be 10) is replaced by a e or a E, and the caret sign (^) is omitted.

For computer purposes, a number like 23.24 will be represented as 2.324e1 in SNF. Note that the number may have a leading sign (+ or -), and that the exponent itself can have a sign. The same number (23.24) can also be represented as +2.324e+1 where both the sign of the number and the sign of the exponent are present.

Your program will read a string from standard input and will decide whether the string represents a number in SNF or not. Note that your program must make the decision regardless of whether the number is actually representable in the computer or not.

For instance 1.41421356237309504880168872420969807856963176679737e0 would be a perfectly valid input to your program; however, you never get this many significant bits in any common computer representation.

Depending on how you write your program you may be able to indicate an error as soon as the character is entered, or else read the number when an EOL is found, and only then process the string.

 You must provide a table driven implementation using C or C++. The useage of regular expression libraries is not allowed for this project.

If you like to think of programs as being something useful (beyond the learning experience), then you can imagine your program is part of a package which is used to train students in Computer Science: your program will then do part of the training which refers to number formats.

What you'll turn in
1. A floppy disk (3.5") which contains:
• the source file(s) for your program. Note that grading, as described below, considers both the functionality and the readability of your code. You must follow the coding style and documentation standards used in the Computer Science Department.
• DOS executable named assign2. If you prefer to use UNIX instead, then you shall turn in an executable made for one of the following, Solaris 8, Irix 6.3, or Linux.
• README file indicating what the program does, how to build the executable, the platform it's been tested on, and how to run it, known limitations, plus any other information you consider useful - like the name of the author, etc.
• a memo describing your work. You will indicate what you have looked for and how you solved the problem. Direct the memo to your class instructor. Attached to the memo will be a document that introduces the necessary theoretical background.

2. Hardcopies:
• the memo with the attached theoretical background.
• a listing of the source code.
• the state transition diagram of the FA you have used to solve the problem.

A professional look of your work is expected. Loose items will be rejected. A binder (or an envelope) to hold your work together is required.

1. A mark between 0 and 10 for functionality. The mark basically indicates in what measure your program works properly and how well you have followed the initial specification.
2. A mark between 0 and 10 for readability. This mark indicates how well documented your program is; it also considers the general appearance of your final report.
3. Multiply the above two marks to get the mark for this programming assignment.