CMPSC 201 Fall 2016
To be done individually
Due by end of your recitation section on 9/9/16.
Goals: Practicing variable definitions (declarations) and arithmetic operations.
Implement one of the 3 problems given the Algorithms 1 assignment into C+.
Due as stated on CANVAS
Create a NOTEPAD or PDF file that restates the problem in your own words, specifies what
input is needed from whomever is using the process, what output is expected, the step by step
process (algorithm) to get
The following are some example algorithms for problems (see also the first program in the demo
folder in the General Material Module).
Example 1: Suppose you were asked to calculate the area of a triangle.
Purpose: Calculate the area of
1. Purpose: To determine how many cases company XYZ would produce with the same number
of candy bars produced by company ABC
Input needed: Number of cases produced by company ABC
Output expected: Number of cases produced by company XYZ with that same numb
1. Purpose: To determine the force between two bodies using the formula F= (G * M1 * M2) / d *
d where G is the gravitational constant 6.673 * 10 ^ -11
Input : the masses of the bodies and the distance between them
Output: The force acting between the bod
Form 2848 (Rev. 7-2014)
b Specific acts not authorized. My representative(s) is (are) not authorized to endorse or otherwise negotiate any check (including directing or
accepting payment by any means, electronic or otherwise, into an account owned
(Rev. July 2014) of the
Power of Attorney and
Declaration of Representative
OMB No. 1545-0150
For IRS Use only
Information about Form 2u8 and its nstructions is at www.Fs.
Power of Attorney
HAND TRACE #5
int main() cfw_
for (int x = 0; x < 9; x+) cfw_
randoms[x] = rand();
cout < "Random number " < x < ": " < randoms[x] < endl;
for (int x = 0; x < 3; x+) cfw_
for (int y = 0; y < 3; y+) cfw_
if (randoms[(x * 3) + y] % 2)
Hand Trace #9
double func1(int q, int w) cfw_
if (q+w > 100)
int main() cfw_
double num = 1.0;
for (int x = 0; x < 100; x += 7) cfw_
int r = rand();
num -= func1(x, r % 34);
cout < num < ", ";
CMPSC 121 Assignment 6
Modify your solution to assignment 5B as follows:
1. Create a function called initBoard which is called once from main and which
initializes all of the cells on the board to and underscore ('_').
2. Create a fun
CMPSC 121 Assignment 5
Ask the user for numbers (integers); stop asking when the user enters 0. Display the highest and
lowest numbers on the screen.
using namespace std;
int main () cfw_
HAND TRACE #7
Hand trace the following program and determine what the output would be. The output
means all of the output including prompts, etc.
const int MAX_ROW = 2;
const int MAX_COL = 3;
const int MAX_HEIGHT = 14;
void init(int MyArray[MAX_ROW]
CMPSC 203 FA 2013
I. Objects: Is a main component that is created to make a database function
Tables: The foundation of every database. Is a collection of related records
o Fields: The smallest data element in a table
o Records: A complete set