In: Computer Science
C++
Project Organization
Create a project called Project1 and then name and organize the following programs under it.
Part 1 CircleArea
You are going to write a program to compute and output the area of a circle with a radius of 2.5.
Think through what you need to do:
Create a variable for radius
set it to 2.5
Create a variable for area
set it to 3.14159 * radius * radius
output the value of area
Challenge (not required)
Generalize this so that you can input any radius and the program will output the area for it.
Part 2 TicTacShmoe
Write a program that prints out three different tic tac toe winning results. Make each one bigger than the last, separated by more spaces and lines:
1 0 0
0 1 0
0 0 1
0 0 1
0 1 0
1 0 0
The goal is to give you practice with the cout statements in C++
Part 3 TriangleArea
Write a program called TriangleArea, which calculates and outputs the Area of a triangle with a Base value of 3.5 and a Height value of 4.85. The formula for the area of a triangle is: 1/2 ×???? × ????ℎ?.
Your program should output correct answer.
Part 4 MilesToKilometers
Write a program that will tell me the conversion of 60 miles, into kilometers. Remember that 1 mile is 1.60934 kilometers.
Part 5 MyInitials
Write a sequence of cout statements to display your initials (2 – 3 letters) using a cool pattern for each letter.
>My Initial is BL
For example, here is a simple pattern for the initials IL:
II LL
II LL
II LL
II LL
II LL
II LL
II LL
II LL LL LL LL
Use around 8 cout statements to complete this exercise.
Part 6 DoubleUp
Write a program that ask the user to input a number. Then tell them, What double up is. For example, if the user inputs a 7, the program should output ~Double up is 14~
Following are the codes and there outputs of the project Project1:-
(1.) The C++ code for the first part is as follows:-
The output of the above code is as follows:-
(2.) The C++ code for the second part is as follows:-
The output of the above code is as follows:-
1 0 0
0 1 0
0 0 1
1 1 1 1
0 0 0 0
0 0 0 0
0 0 0 0
0 1 0 0 0
0 1 0 0 0
0 1 0 0 0
0 1 0 0 0
0 1 0 0 0
(3.) The C++ code of the third part is as follows:-
The output of the above code is as follows:-
(4.) The C++ code for the fourth part is as follows:-
The output of the above code is as follows:-
(5). The C++ code of the fifth part is as follows:-
The output of the above code is as follows:-
Enter initial MR
MM RR
MM RR
MM RR
MM RR
MM RR
MM RR
MM RR
MM RR RR RR RR
(6.) The C++ code of the sixth part is as follows:-
The output of the above code is as follows:-