CSCI 261 - Programming Concepts (C++)

Fall 2016 - Lab 02A

Quick Links: Blackboard | EECS | Mines | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |
This lab is due by September 07, 2016 08:00am.

Pair Programming



For this lab, you will be working with a partner to practice pair programming and proper programming design.

Last week, you thought of equations relevant to your major that can be solved using a computer program. Below are a list of three equations provided from different sections. You and your partner will implement two of these three equations.

Major Equation Formula Variables
Chemistry Ideal Gas Law Ideal Gas Law V - volume
P - pressure
n - # of moles
R - gas constant
T - temperature
Engineering Physics Newton's Law of Universal Gravitational Newton's Law of Universal Gravitational FG - Force of gravity
G - gravitational constant
m1 - mass of body 1
m2 - mass of body 2
(x1, y1) - location of body 1
(x2, y2) - location of body 2
Mechanical Engineering Escape Velocity Escape Velocity vesc - escape velocity
G - gravitational constant
mE - mass of Earth
rE - radius of Earth

For each equation, you must:
  • Define the appropriate variables that are needed giving them the proper data type, a proper identifier, and a sensible initial value
  • Declare constants as needed
  • You must prompt the user to enter all non-constant values for the equations
  • Calculate the right hand side of the equation solving for the left hand side
  • Print out the final computed value of the equation
  • And as always, be sure to be providing helpful output to the user so the user provides the correct values and knows what is being returned

Now before you get started doing any coding, take out a piece of paper and write out the pseudocode to solve this task. Put your names (first & last) at the top as you will be turning in your pseudocode as part of your grade. Once you have your pseudocode, determine who is going to drive first and get to coding! We will switch drivers every 5 minutes so listen for the cue to switch positions.


Lab Submission



To receive full credit for this lab, you must do the following:
  • Turn in a hardcopy of your pseudocode to the instructor at the end of class on Wed. Aug. 31
  • Both members of your pair must turn in the same main.cpp
  • Both of your names should be in the comments in the header of your file
You will submit your solution to this lab with the rest of Week02. Detailed instructions for doing this are posted in Assignment 02.


This lab is due by September 07, 2016 08:00am.
Last Updated: 01/01/70 00:00


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0