Question

In: Computer Science

C++ Project Organization Create a project called Project1 and then name and organize the following programs...

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~

Solutions

Expert Solution

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:-


Related Solutions

Complete the following. Describe how to a) establish, b) create, and c) organize project requirements. Explain...
Complete the following. Describe how to a) establish, b) create, and c) organize project requirements. Explain how to locate and identify a) sources of supply, b) suppliers, c) market places, and d) competition.
Create a structure in C called BarcelonaPlayer with the following members. struct BarcelonaPlayer { char name[20];...
Create a structure in C called BarcelonaPlayer with the following members. struct BarcelonaPlayer { char name[20]; int age; char country[20]; char Position[20]; double Salary; double Rating; }; First, create an array of BarcelonaPlayer structures. Now, write a function that takes an array of BarcelonaPlayer structures as input and find out the highest paid player among all the players. void highestPaidPlayer(struct BarcelonaPlayer *pl, int size); Create another function that finds all the players from Argentina. void findPlayers(struct BarcelonaPlayer *pl, int size);
Write a C++ programs to: 1. Create a class called Student with four (4) private member...
Write a C++ programs to: 1. Create a class called Student with four (4) private member variables, name (string), quiz, midterm, final (all double type); 2. Include all necessary member functions for this class (at least 1 constructor, 1 get function, and 1 grading function – see #6); 3. Declare three (3) objects of Student type (individual or array); 4. Read from the keyboard three (3) sets of values of name, quiz, midterm, final and assign them to each object;...
This project requires the student to create a record (in C++ called a struct). The record...
This project requires the student to create a record (in C++ called a struct). The record should contain several fields of different data types and should allow the user to search the records to find the student with the highest grade. In this project the student should gain an understanding of the nature of records with multiple data types, how to save the records, search the records and retrieve them.  The special problems of maintaining records of multiple data types on...
Problem 1 Create a new project called Lab7 Create a class in that project called ListORama...
Problem 1 Create a new project called Lab7 Create a class in that project called ListORama Write a static method in that class called makeLists that takes no parameters and returns no value In makeLists, create an ArrayList object called avengers that can hold String objects. Problem 2 Add the following names to the avengers list, one at a time: Chris, Robert, Scarlett, Clark, Jeremy, Gwyneth, Mark Print the avengers object. You will notice that the contents are displayed in...
HW_6a - Read a text file Create a new C++ project and name it as:   Numbers...
HW_6a - Read a text file Create a new C++ project and name it as:   Numbers Create a text file and     save it as:   data.txt Create and save the file      in a C++ project      in the Resource folder. Enter the following numbers:        3                                                              4                                                              5       Note:   After you enter the 5, don’t press the enter key. Save and close the file. Add another file and name it:   Source.cpp Write one statement that declares a file...
In the root of the project create a folder called res. In that folder create a...
In the root of the project create a folder called res. In that folder create a file called DemoFile.txt Create a class with a static main that tests the ability to resolve and print a Path: Create an instance of a FileSystem class. Create an instance of the Path interface for the DemoFile.txt file. Print the constructed Path with System.out.println() method. Create a class that does the following: Using a pre-Java 7 solution, create a class that tests streams in...
Create a class called Student. Include the following instance variables: name, address, phone, gpa Create all...
Create a class called Student. Include the following instance variables: name, address, phone, gpa Create all of the methods required for a standard user defined class: constructors, accessors, mutators, toString, equals Create the client for testing the Student class Create another class called CourseSection Include instance variables for: course name, days and times course meets (String), description of course, student a, student b, student c (all of type Student) Create all of the methods required for a standard user defined...
In BlueJ, create a project called Lab6 Create a class called LineSegment –Note: test changes as...
In BlueJ, create a project called Lab6 Create a class called LineSegment –Note: test changes as you go Copy the code for LineSegment given below into the class. Take a few minutes to understand what the class does. Besides the mutators and accessors, it has a method called print, that prints the end points of the line segment in the form: (x, y) to (x, y) You will have to write two methods in the LineSegment class. There is information...
In STS, create Java Project, called java_generics_yourNameLastname that; (Under source directory called, src, create a package...
In STS, create Java Project, called java_generics_yourNameLastname that; (Under source directory called, src, create a package csci3444.generics and put all code in it) Create a generic interface called “MyGenInterface” that takes 2 generic types K,V with below methods; public K getKey(); public V getValue(); Create a generic class called “MyGenClass” that implements “MyGenInterface” interface. has attributes “K key” and “V value” that can be inherited has a constructor that takes “K _key”, “V _value” inputs and initializes “key”, “value” attributes...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT