ASSIGNMENT 1CAssignment 1C tests your knowledge of input and output in C++ (Chapters 3). For the assignment you are going to develop a
specific C++ program similar to the one from Assignment 1B however it is going to have a more detailed input/output to
practice the concepts from the chpater.
Part 1. Design a program called YourNameAssignment1C (replace YourName with your actual name) with the following
exact/precise steps (should be in this order) and the variable names, messages, computation messages should be exact/as
requested) and exact/precise input/output formatting:
1.
2.
3.
4.
Output a message “Enter a Number: ” that asks the user to enter a number.
Input a value from the user into a floating-point variable called Number.
Compute the area of the square with the side Number and store it in a floating-point variable called AreaSquare.
Compute the area of the rectangle with the length Number and width 2*Number and store it in variable
AreaRectangle.
5. Output the data from the table below (use the exact text and replace the yellow text/data with the values from variables) in a
table format with 2 columns and with the format from the blue boxes bellow; table lines/borders are not required:
Shape
Square
Rectangle
Area
AreaSquare
AreaRectangle
The table should be formatted this way:
▪
▪
The Shape column (column 1) should have a width of 10, left alignment, and should be filled with spaces.
The Area column (column 2) should have a width of 7, right alignment, fixed-floating point format, 2 decimal precision, and
show the decimal point.
For example, if the user enters 3.3 for the Number, the output should look like this:
Enter a Number: 3.3
The areas of the shapes are:
Shape
Square
Rectangle
Area
9.90
19.80
Part 2. Implement the program in Visual Studio 2022: Create a CPP project called YourNameAssignment1C (same name
as the driver class) and add your code to YourNameAssignmen1C main method. Your program should be user-friendly
(prompt the user for the input using a descriptive message) and be well-documented/commented (have comments for
every line of code). Your program should be general and work on any number, and you should not hardcode the Number
or the 2 Areas– your algorithm should input the Number from the user and compute the areas based on the Number.
Also, your algorithms should not input, output, or compute more than requested (e.g. do input side, length, width, etc,
you should only input the Number).
Part 3. Create the screenshot document for your code and output: Create a Microsoft Word document from the
YourName-Assignment.docx template and call it YourName-Assignment1C.docx (replace YourName with your actual
name) Add to the document your complete screenshots of the Visual Studio editor window showing the complete C++
source code for YourNameAssignment1C class and complete screenshots of the complete output. If the entire class C++
source code or the output does not fit in one screenshot or the screenshots cannot be easily read, create multiple
screenshots and add multiple screenshots to the document. Please keep the screenshots in order (look at the line
numbers). If your output is longer than a line and does not fit on one screen, Wrap Text in your output panel.
Part 4. Submit your work: Submit YourName-Assignment1C.docx document 1 on eCampus under the Assignment 1C. Do
not archive the files (e.g. no RAR, ZIP, etc.) or submit other types/formats of files (e.g. no CLASS, PDF, CPP, etc.). Please
take time after submitting to review the file and check it is correct and resubmit it if there are any errors.
1
The DOCX screenshots documents will show me that your program compiles correctly (hence the screenshots of the complete code
in editor) and runs correctly for you (hence the screenshots of the complete output in output window).