All the exercises below are selected from the textbook: Thinking in C++ (volume 1).
1. [Exercise-2 on Page 120] Using Stream2.cpp and Numconv.cpp as guidelines, create a program that asks for theĀ radius of a circle and prints the area of that circle. You can just use the ā*ā operator to square the radius. Do not tryĀ to print out the value as octal or hex (these only work with integral types). [25 points]
2. [Exercise-1 on Page 226] Create a header file (with an extension of ā.hā). In this file, declare a group of functionsĀ by varying the argument lists and return values from among the following: void, char, int, and float. Now createĀ a .cpp file that includes your header file and creates definitions for all of these functions. Each definition shouldĀ simply print out the function name, argument list, and return type so you know itās been called. Create a second .cppĀ file that includes your header file and defines int main( ), containing calls to all of your functions. Compile and runĀ your program. [35 points]
3. [Exercise-3 on Page 227] Write a program that uses a while loop to read words from standard input (cin) into aĀ string. This is an āinfiniteā while loop, which you break out of (and exit the program) using a break statement. ForĀ each word that is read, evaluate it by first using a sequence of if statements to āmapā an integral value to the word,Ā and then use a switch statement that uses that integral value as its selector (this sequence of events is not meant toĀ beĀ goodĀ programmingĀ style;Ā itāsĀ justĀ supposedĀ toĀ giveĀ youĀ exerciseĀ withĀ controlĀ flow).Ā InsideĀ eachĀ case, printĀ something meaningful. You must decide what the āinterestingā words are and what the meaning is. You must alsoĀ decideĀ whatĀ wordĀ will signal theĀ endĀ ofĀ theĀ program.Ā TestĀ theĀ programĀ byĀ redirectingĀ aĀ fileĀ intoĀ theĀ programāsĀ standard input (if you want to save typing, this file can be your programās source file). [40 points]
Requirements:
* Usage of spaces, blank lines, indention, and comments for readability
* Descriptive names of variables, functions, structs, classes, and objects (if any)
* Appropriate usage of structs, classes, and objects (if any)
Penalties:
* Zero if you have possession of a copy of online solutions or work done by someone else.
* 5-point deduction per day late






