course.wilkes.edu/CS125Labs
Welcome to the site for CS 125 labs!

 

Hands On C++: Project 1

Prev | Next | Lab 1

Objectives

1. Practice designing a program.
2. Practice implementing a program design in C++.
3. Practice testing a program.

Introduction

Your instructor will assign you one of the problems below. To solve your problem, write a program that reads the necessary information to compute and output the indicated values, as efficiently as possible. Following the pattern in the lab exercise, first, design your program by specifying its behavior, identifying the objects and operations it needs to solve the problem, and then organizing the objects and operations into an algorithm. Then code your design in C++ using stepwise translation. Finally, test your program thoroughly.

In the descriptions below (and elsewhere in this manual), we use the notation x^y to denote x raised to the power of y, even though C++ does not have an exponentiation operator.

Projects

1.1. Write a program to find the circumference and area of any circle. The formulas for these quantities are as follows:

   circumference = 2 * p * radius.
   area = p * radius^2.

1.2. Write a program to find the side surface area and volume of any regular cylinder. The formulas for these quantities are as follows:

   sideSurfaceArea = 2 * p * radius * height.
   volume = p * radius^2 * height.

1.3. Write a program to find the circumference and area of any regular ellipse. The formulas for these quantities are as follows:

   circumference = 2 * p * the square root of (((height/2)^2 + (width/2)^2)/2).
   area = p * height/2 * width/2.

1.4. Write a program to find the surface area and volume of any sphere. The formulas for these quantities are as follows:

   surface area = 4 * p * radius^2.
   volume = 4/3 * p * radius^3.

Don't forget to clean up your directory when you are all finished...


Prev | Next | Lab 1

 
  Home

Help

Lab 0

Lab 1

Lab 2

Lab 3a

Lab 3b

Lab 4

Lab 5

Lab 6

Lab 7

Lab 8

Lab 9

Lab 10

Lab 11

Lab 12

Lab 13



Membership

Login




Last update: Wednesday, January 31, 2001 at 2:47:30 PM.
visitors to this page.