Function, Loop, and String Exercise: Table of Contents Display
$30-250 USD
Paid on delivery
Need to submit snapshots of your code for all 5 steps (but not helper steps). This assignment is about using variables and passing parameters. Only the code in main() knows book details like title, chapter number, and page number. All the other functions do not assume any particular title, chapter number, or page number. Those values are passed as inputs to produce the table of contents for any book. The resulting output is shown at the end, below.
In order to use both cout and the string variable type, your cpp file will need lines at the top for both #include <iostream> and #include <string>.
The overall project is to create an app to print the table of contents for a book. Create a main() function with 5 string variables, three of which are called sCh1Name, sCh2Name and sCh3Name and two which are called sSec3_1Name and sSec3_2Name. Use the chapter names: “Introduction”, “Using Variables”, and “Using If Statements”. The sections in the last chapter (chapter 3) are “If” and “Else”. Here is an example:
The final result after step 7 should look like:
Chapter 1: Introduction .................................... 1
Chapter 2: Using Variables ................................ 18
Chapter 3: Using If Statements ............................ 29
Section 1: If ........................................... 30
Section 2: Else ......................................... 37
12345678901234567890123456789012345678901234567890123456789012
Project ID: #6069289