Computer Programming Projects

Look up the price/performance history of various computer products. For each product, graph price and performance over time. Also graph price vs. performance. What conclusions can you make from these three graphs? Hint: check the ads in old Computer Shoppers or other computer magazines.

Write a program to draw and label the above graphs. Data may be placed in data statements or files.

Make a flowchart to describe the process of feeding a cat. Allow for the possibility that the cat may not be around or not hungry or thirsty, that you may be out of canned food (main supply) or dry food (backup supply), that the dishes may be dirty.

Internet Teacherstuff glossary search (see worksheet). Starting at internet address geocities.com/Athens/Acropolis/3840/mathnotes/mathgloss/mathglosa.html, identify at least twenty linked sites or glossary terms.

Make a flowchart to describe the solution to the following problem:
You have 12 marbles. One has a slightly different weight from the others (you cannot tell by feeling). Using an equal-arm pan balance, determine which marble is unequal and whether it is heavier or lighter. The problem can be solved in three weighings. If you can't do it in three, flowchart your best solution. Be sure to cover all possible situations.

Supplemental problem: Make a flowchart to show that the unique marble can be identified as above from 3n marbles in n+1 weighings; n>0.

Write a program to print a picture composed of characters. Example: a scene with evergreen trees and a house by a pond with waves and a boat.

Animate the above scene. Hint: Use a loop to repeat two or more frames sparated by delays. The entire scene does not have to be refreshed, only the parts that change.

Application: Produce a text animation that tells a story or shows some definite progressive action, such as a sports scene or science topic. A sports scene may include a play-by-play commentary. A science topic may include a narration explaining the principles involved.

Write a program to display a map. Use the number keypad keys to move a character (cursor) around the screen. Prevent the character from passing through walls.

Make a game using the above program. For example: move through a maze, pursue or escape robot characters (they have to move according to some procedure), find treasure, pick up a series of objects (objects are tallied but not displayed after being picked up), etc. You may make it dangerous or fatal to run into walls. For example, each collision may cost strength or life points. One of the objects you find could protect your character in the event of a collision.

Write a graphics program to display a working analog clock. On the same screen, display a matching digital clock with seven-segment style numerals.

Write a graphics program to show a dart board. Make the appearance as realistic as possible. Included point-scoring labels.

Challenge: Write a dart game using the above graphic. Allow for some randomness in player accuracy. Hint: Depending on your presentation, parts of the board may need to be refreshed during play. Make sure to have the program keep and display the score as the game progresses.

Write a program to input three numbers from the keyboard, then output each of the three possible pairs of these numbers along with the sum, difference and average of that pair.

Expand the previous program to output the three rows of information in order by greatest average.

Write a program to input how many numbers are in a list to be entered from the keyboard. As each number in the list is entered, output a running sum and average of all numbers entered into the list up to that point.

Application: Write a gradebook program capable of keeping track, as scores are entered, of the marking-period averages for at least two classes of at least two students each. It is not necessary, at this stage, to preserve a list of the actual scores entered, only the averages and the number of scores entered for each student.

Expansion: Support multiple marking periods, final averages and weighted scores, marking periods or exams. Allow the user to add make-up scores to previous marking periods. Note that, without storing individual grades, it would be more difficult to edit scores already entered. Consider that option for after the section on arrays.

Write a program to input a quantity, then generate a set of that many random integers. Display the odd and even values in different colors, fonts and/or styles. If the language will not support these functions, display the odd and even numbers in different columns or some other distinction. Output the quantity and percent of odd and even numbers generated.

Write a guess-the-number program. Generate a random number without displaying it. (Be fair--use integers!) Let the user guess the value until the correct answer is found. Tell the user if each guess is high or low. Count the number of tries it takes to find the answer.

Write a trivia-quiz program. Allow users to select a category, then ask a question or series of questions within that category. For each category and overall, keep track of number of questions asked and number right, also calculate current percent score.

Write a program to input a list of numbers ending with -9999, then output the value and position in the list of the greatest and least numbers entered and how many numbers in the list are positive, zero and negative. (The entry -9999 is not to be used in any of the calculations.)

Application: You are an Olympic scorekeeper. The events you are scoring are high jump, long jump, 400 meter race and 100 meter sprint. You may also include other events such as shot put and pole vault. Each contestant may enter any or all events and must be allowed to attempt each event more than once, but other contestants will be competing in between. Write a program to input the name of the contestant currently competing, the event being attempted and the result (distance or time). Display the results after each attempt: show the best and worst result for that event for all contestants and all events for that contestant up to that point. Use a menu structure to allow efficient entry of events, contestants and scores.

Write a program to encode or decode a string entered from the keyboard, based on a numerical rule or function. For example, use a Ceasar cypher to add or subtract a constant from the ASCII value of each character. For more advanced codes, add or subtract a function of the character's position, perform a function based on the value of each character or comparison (difference) of consecutive characters (or some other interval) or use a combination of these and other techniques. Note the phrase-substitution program further along in the list.

Write a program to output the addition and multiplication tables for a range of numbers (starting and ending value) to be input by the user. Title each page. Label rows and columns. Make sure that columns are straight.

Write a program to input a list of numbers from the keyboard. Find which numbers are prime. (See Sieve of Eratosthenes).

Write a program to solve the quadratic formula. Input the three coefficients, then output all possible roots or the message, "No real roots." For additional credit, replace the message with an output, in complex form, of any imaginary roots.

Write a program to solve an application of the quadratic formula or other nonlinear function. Examples include: trajectories (projectiles, space vehicles, sports equipment), timed acceleration (drag racing, sprint races), trends (continuous compound interest, global warming, etc). Use your imagination!

Write a program to identify the first 24 integer right triangles. Display the values of the sequence number, base, height, hypotenuse and area.

Write a program to calculate any side of a right triangle, given either the lengths of the other two sides or the coordinates of their endpoints or a combination of lengths and coordinates. Conversely, find the coordinates of the endpoint of a leg, given the length of the hypotenuse and either the length of the other leg and the coordinates of one endpoint or the coordinates of both endpoints. Also perform the same type of calculations for a rectangular solid where the hypotenuse corresponds to the diagonal distance through the solid. See notes on Finding Distance.

Write a program to input two numbers from the keyboard. Output the factorial of each number, the product and quotient of the factorials, and the permutation and combination of the numbers.

Write an application program showing the probability of a specified outcome for a given random or pseudorandom situation.

Write a program to input a date (such as your birthday) from the keyboard. Output the number of years and days from that date to the present. Note that the months have different numbers of days. Allow for leap years. Expand the program to allow two dates to be entered and determine the interval between them.

Write a program to convert between Roman and base-ten numerals. Include an option to print a table of Roman numerals from a given starting point. Check for out-of-range input values and illegal Roman-numeral combinations.

Write a program to encode or decode a message entered from the keyboard according to a predetermined set of equivalent characters, words or phrases. (See Caesar ciphers and the Navajo Code Talker code for examples.) Hint: This project is different from the character-substitution code previously described in that a table of equivalent strings is needed, rather than a numerical function. Watch for phrases of different lengths that start the same--test for the longer phrase first.

Write a program to generate an array of ten random integers in the range -99 through +99. Output the array in original, ascending and descending order. Do the same for an array of randomly generated strings.

Write a program to generate an array of eight random ordered pairs in the range -9 through +9. Output the ordered pairs in original order, ascending order by x-coordinate and descending order by y-coordinate. Do the same for an eight-by-two array of randomly generated strings. Do the same for an array of eight random numbers in the range -9 through +9 paired with an array of eight random strings.

Application: Expand the gradebook program described earlier to store individual scores and allow them to be changed. Be sure to recompute a student's average after changes are completed for that student.

Write a program to read two sets of numbers from data statements, then output the sets and their union and intersection. The sets should be of different lengths for at least one test run, and the same length at least once. Allow for the possibility that either set and/or their intersection may be empty.

Add a menu to the previous program to also allow sets of names to be used, or a name/number pair keyed by either numbers or by names.

Application: Arrange sports-team rosters into two lists: one by last name/first name, one by uniform number. The program should check to make sure that no player is enrolled with more than one team (assume that all players have unique names).

Write a program to generate an array of six random ordered triplets in the range -9 through +9 representing the coordinates of points in space. Output the array, then output the distance between each possible pair of points in ascending order, along with their associated ordered triplets.

You are the manager of a space taxi service connecting from three to ten space stations. Every station is connected directly to each other station. You need to find the most efficient way to service those routes. Write a program to input the number of stations, then generate the locations of the stations at random in three-dimensional space. Calculate the distance between each possible pair of stations and sort the stations in order of shortest distance (hint: use an index to sort the stations). Output the number and location of each station along with the distance to each higher-numbered station. See notes on Finding Distance.

Time four different bubble sort techniques plus the Shell sort on an array of random numbers in 1000 rows by five columns. This project can only be done in a language that can access the system time. The accuracy of internal counters will be affected by concurrent computer operations (background printing, windowed tasks, etc.)

Write a program to generate an array of six random ordered triplets in the range -1 through +1. Output the array in original order, then sorted by nested keys in order of priority x, y, z.

Write a program to generate an array of ten rows by five columns of random integers in the range -2 through +2. Output this array. Input an index from the keyboard specifying the order in which the five columns are to be used as key fields. Sort the array by nested keys, then print the rearranged array. Read a second key-field index, then sort and output the array in the new order.

Write a program to input business records (last name, first name, middle initial, address (zip code), phone number, account balance and credit rating). Generate an index for each field, the first five in ascending order, the last two in descending order, also one index for full names (nested last/first/M.I.) in ascending order and one for remaining credit (credit rating - balance) in descending order. Be able to display the entire database according to any field or in original (journal) order on demand without sorting the original records.

Expand the previous program to save and retrieve the database from a file (so you don't have to keep typing it in). Enable the user to add and delete records and re-enter a field within a record. Added records are placed at the end of the file in order to preserve journal order. Regenerate the index arrays after changing the database.

Expand the previous program to read a data file containing information on customers as follows: account #, name, address, phone # and credit rating. Input payments and charges identifying customers by account number until "done" is entered for the account #, then output a customer balance sheet showing all data from the original list plus the remaining credit and balance due for each customer.

Expand the previous program to store all records of payments and charges as they occur. Print a master balance sheet showing all transactions, either in journal order or by specified field (for example, by customer), subtotals by specified field and the total balance.

Expand the previous program to allow subtotals by specified nested fields.

Find the values of the following functions:
1. Sum of n2-5n-7 for n=1 through 100
2. Sum of n! for n=1 through 100

Find the limits of the following functions:

3.   2n                    4.          1                   5.           1
   ------                     Sum of  ---                     Sum of  -----
    3n+5                               n                                n2

6.           1             7.           1                  8.           2n
   Sum of  -----              Sum of  -----                   Sum of  -----
             n!                         2n                              n!

9.            4            4                  10.           4          4
   Sum of  --------  -  --------                  Sum of  ------  -  ------
             22n-2         22n-1                             4n-3       4n-1

Write a program to find the quotients of consecutive terms of a series where each element is the sum of the previous two, for example the Fibonacci or Lucas numbers. Try several different starting values.

Write a program to simulate a savings account. Input the initial balance, compounding period, regular deposit (may be zero) per compounding period, the yearly rate of interest and the length of time (in years) the account is to be active. Output, for each compounding period, the total elapsed time, the compounding-period and total interest and the current balance.
Hint: Since decimal calculations are subject to binary rounding errors, the modern banking standard is to represent all money amounts as integers and divide results by 100 for output. Make sure that all money amounts are rounded to the nearest cent (one cent = 1, one dollar = 100). Note that the exponential formula often used as a single-calculation solution will produce rounding errors.

Write a program to simulate a loan repayment. Input the amount borrowed, the yearly rate of interest and the monthly installment. Output, for each month, the total elapsed time, the monthly and total amounts for both the interest and the remainder of the installment paid on the principal and the current balance. Note that when the balance becomes less than the installment, pay only the principal remaining. At the end, output the total time to pay off the loan, the final payment (remaining balance plus the last month's interest on that balance) and the total cost of the loan (initial principal borrowed plus total interest).
See the hint for the savings-account project.

A student drives from the school entrance at a varying rate of t3-3t2-2t+8 mph where t is the number of hours he has been driving. How far was he from school when he received a speeding ticket for 65 mph in a 55 mph zone? Also, how long had he been driving? (Give answers to the nearest .01 mile and .001 hour using time divisions of .001 hour. Only one run needed for this project.)

A roller coaster has a track of height h=(sin(pi*d/1000)+sin(pi*d/250)+1)*50 meters where d is the distance along the track from its starting point. The total horizontal length of the track is 1000 meters. What is the cross-section area under the track? How high is the track at its highest point? Where is the highest point? What and where are the greatest uphill and downhill slopes? Where is the steepest point? How steep is it? (Steepness is the absolute value of the slope.) Test the program with an interval of one meter, then decrease the interval by a factor of ten until your answers stop changing. Only one run needed for this project.

Write a program to input several sentences from the keyboard. After each sentence is entered, output a cumulative, alphabetized list of all the words entered since the beginning of the run along with the total number of occurrences for each word in the list.

Write a program or set of programs using a menu to create, store, retieve and output two sequential string files (alphabetized address lists of the same form as in the previous project) and two random-access files (virtual arrays) containing the same type of information. Allow for any number of files of each kind to be processed. Note that each file existing at a given time must have a different name.

Write a program to analyze a set of two-variable data input from the keyboard or a numerical data file. Output the number of scores, the original and sorted data, the sum and sum of squares of the data for each variable, the sum of products of each data pair, the mean, mean of squares, for each variable, the mean of data-pair products, the median, mode, maximum, minimum, range, variance, standard deviation and normalized scores for each of the two coordinates. Also output the correlation coefficient, the slope of the best-fit linear funtion and the best-fit formula for the data in linear, exponential and power form along with the least-squares fit of each. See the Curvefit worksheet.

Write a program to read a set of text files containing a simulated video image obscured by noise, smooth the noise, sharpen the edges of the depicted object and draw a vector map of the orientation of the object's features. Identify each of the hidden shapes.

Write a program to process a numerical array file as in the preceding program.

Write a program to emulate another computer processor (for example, a PDP-8), using a data file containing code written for the other computer.

Write a simulation to find the most efficient layout for fuel pumps at a gas station based on average rate of random customer arrival. Customer time at the pump varies randomly from two to six minutes. Customers will leave without pumping if there are more than three cars at each pump on arrival or if they have to wait more than ten minutes. Layouts can vary from a single, one-sided pump to multiple rows of multiple, two-sided pumps. All pump lanes are one-way. Passing to reach a pump and backing in or out are not allowed. Customers may pull out whenever they are finished.
Possible testing methods:
A) For each number and arrangement of pumps, find the greatest average number of customers that can be serviced. Gradually increase the rate until the number serviced levels off or drops.
B) For a given customer rate, increase the number of pumps and alter the layout until no further improvement is noted in number of customers serviced.
C) Set up a cost of operation for each type of pump or pump island as well as the gas station itself. Find the number and arrangement of pumps that brings maximum profit for a given customer level.
D) Find the number of customers that yields maximum profit for the costing method of solution C.
Try comparing methods. Which one(s) work best? Results can be shown as tables, graphs or both.

Write a text-adventure game (see teacher for ideas). Make it possible for users to save games in progress.

Design a sampling experiment or simulation and interpret the results, including the effects of your sampling method.

Write a game or simulation on any topic (see teacher for ideas).

Write a program to perform any specific application (see teacher for ideas).

Rewrite any program (project or handout example) into a different computer language, for example, Power BASIC, Pascal, C, TI-83, Java.



Notice: the above file exists as freeware and may be copied and distributed without modification in any quantity provided that no fee is charged for them. Any other use requires prior permission. The author retains all rights to the material.

Created by T.E. Greene 9/1971. Last updated 12/20/2005.



You are visitor # Counter to teacherstuff since 7/23/2003.



This page hosted by GeoCities Get your own Free Home Page


1