CS 120 -- Programming Assignments
General Assignment Information
Program Requirements
Source File organization
Some general coding information
Specific Assignment Information
Program 4: Statistics July 17, 2023
test1.dat
test2.dat
test3.dat
Sample Programs
Random Walk
Random Walk
simulation written in Java. This is what your walker does.
See the examples in the
Random Number
section below.
Objects/Classes
circle.cpp
--- An example that uses a class to define a circle.
Debugging Class files
debug.h
--- The interface file.
debug.cpp
--- The implementation file.
testdb1.cpp
--- Static debug object test file.
testdb2.cpp
--- Dynamic debug object test file.
CD Database
cddb.cpp
CD database program--- partially implemented.
CDDB.dat
Sample data base file
cddb_CC.notes
Notes on changes for CC.
strSort.cpp
Example program for sorting strings.
Random Numbers
Example program
Illustrates random numbers, functions, and writing to multiple files.
Distribution (0-5)
Distribution (5.0-10.0)
Estimate PI program
A program that calculates Pi using random numbers and several functions. See the link below for a graphical representation of the problem.
Estimate Pi using random numbers
A simulation written in Java. Compare this solution with the C++ program above.
Dice/Craps
Craps source file
dice.h
--- Interface for dice class.
dice.cpp
--- Implementation for dice class.
testDice.cpp
--- Test program for dice class.
Sorting
mergeSort.cpp
selSort.cpp
quickSort.cpp
Home