COP 2000 Project 1 to 6 solutions

$120.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

COP 2000 Project 1

Write a program that displays the following pieces of information, each on a separate line:

Your name
Your address, with city, state, and ZIP code
Your telephone number
Your college major

Use only a single cout statement to display all of this information.

COP 2000 Project 2

Description

Write a C++ program that asks the user to enter their monthly costs for each of the following housing related expenses:

rent or mortgage payment
utilities
phone
cable

The program should then display the total monthly cost of these expenses and the total annual cost of these expenses.

One example:

Expense Calculator

Enter the monthly amount of your rent or mortgage payment: $ 1000
Enter the monthly amount of your utilities payment: $ 150.25
Enter the monthly amount of your phone bill: $ 100.75
Enter the monthly amount of your cable bill: $ 85.85

Your monthly costs are: $ 1336.85
Your annual costs are: $ 16042.20

COP2000 Project 3

Project 3 Description

The speed of sound varies depending on the medium through which it travels.  In general, sound travels fastest in rigid media, such as steel, slower in liquid media, such as water, and slowest of all in gases, such as air.  The following table shows the approximate speed of sound, measured in feet per second, in air, water, and steel.

Medium
Speed
Air 1100
Water 4900
Steel 16400

Write a C++ program that displays a menu allowing the user to select air, water, or steel.  After the user has made a selection, the number of feet a sound wave will travel in the selected medium should be entered.  The program will then display the amount of time it will take.  Round the answer to 4 decimal places.

Input validation:  decide how the program should handle an illegal input for the menu choice or distance.

A few examples:

The Speed of Sound

****************
Press 1 for Air
Press 2 for Water
Press 3 for Steel
****************

Your choice:  4

Invalid menu choice.

 

The Speed of Sound

****************
Press 1 for Air
Press 2 for Water
Press 3 for Steel
****************

Your choice:  3

Enter the number of feet:  -5

Invalid number of feet entered.

 

The Speed of Sound

****************
Press 1 for Air
Press 2 for Water
Press 3 for Steel
****************

Your choice:  2

Enter the number of feet:  one hundred thousand

Invalid number of feet entered.

 

The Speed of Sound

****************
Press 1 for Air
Press 2 for Water
Press 3 for Steel
****************

Your choice:  2

Enter the number of feet:  100000

It will take 20.4082 seconds for sound to travel through 100000 feet of water.

To Do:

1.  Upload your .cpp file  to the Project 3 Drop Box.

2.  Be sure to check the Rubrics before you submit your Project. Rubrics tell you exactly what must be included in each Project and how much each item is worth.

3.  Check the Calendar for the due date.

COP2000 Project 4

Project 4 Description

Write a program that produces a bar chart showing the population growth of Sparksville at 20 year intervals during the past 100 years.  The program should read in the population figures (rounded to the nearest 1000 people) for 1910, 1930, 1950, 1970, 1990, 2010 from an input file called people.txt.  For each year it should display the date and a bar consisting of one asterisk for each 1000 people.

Here’s an example of what one scenario would look like:

Sparksville Population Growth
(each * represents 1000 people)
1910:   **
1930:   ****
1950:   *****
1970:   *******
1990:   ******
2010:   *********

To Do:

1.  Upload your .cpp file  to the Project 4 Drop Box.

2.  Be sure to check the Rubrics before you submit your Project. Rubrics tell you exactly what must be included in each Project and how much each item is worth.

3.  Check the Calendar for the due date.

COP2000 Project 5

Project 5 Description

Write a C++ program that will use the input file numbers.txt to determine the number of even numbers, the number of odd numbers, and the number of zeroes that exist in the file.

In order to receive any credit for this project, the project must be broken into the following functions:

  • void openFile() – this function will open the input file in the current directory
  • void closeFile() – this function will close the input file
  • int readFile() – this function will read a number from the input file and return that number to the calling function
  • void determine() – this function will determine if the number is odd, even, or zero.
  • void display() – this function will display the total number of odd numbers, the total number of even numbers, and the total number of zeroes found in the input file.

Any project submitted with all code written in main will receive a grade of 0.

To Do:

1.  Upload your .cpp file  to the Project 5 Drop Box.

2.  Be sure to check the Rubrics before you submit your Project. Rubrics tell you exactly what must be included in each project and how much each item is worth.

3.  Check the Calendar for the due date.

COP2000 Project 6

Project 6 Description

Write a C++ program that will use a class called Rectangle that has the following member variables:

  • length:  a float
  • width:  a float

The class should have the following member functions:

  • constructor – sets the length and width values to 0.0.
  • setLength() – sets the value of the length variable.
  • setWidth() – sets the value of the width variable.
  • getLength() – returns the value of the variable length.
  • getWidth() – returns the value of the variable width.
  • getArea() – returns the area of a rectangle, which is calculated as:

                    area = length * width

  • getPerimeter – returns the perimeter of a rectangle, which is calculated as:

                    perimeter = 2 * (length + width)

Write a program that demonstrates the Rectangle class by asking the user for the rectangle’s length and width, creating a Rectangle object, and then reporting the rectangle’s area and perimeter with 2 decimal places each.

Be sure to validate all input values.

A program will all code written in main() or not using a class and object will result in a grade of 0.

To Do:

1.  Upload your .cpp file  to the Project 6 Drop Box.

2.  Be sure to check the Rubrics before you submit your Project. Rubrics tell you exactly what must be included in each project and how much each item is worth.

3.  Check the Calendar for the due date.