UMBC CS 104
UMBC CMSC 104 * CSEE | 104 | current 104

Project 2 - Algorithms and C Programming Basics

CMSC 104, Fall 2002

Due Date: 5:30 pm, Thursday September 26th.

Point Value:

This project is graded with a 20 point max score.

Objectives:

To become more with


Problems 1-3 are problem solving and algorithm problems. For each of these three problems, complete two parts:
  1. solve the problem as stated, and
  2. give a generic algorithm for solving the problem.


The answers to problems 1-3 should be typed, printed on plain white paper, and turned in on 9/26.


  1. (3 points) Determine the value of a coin collection that contains 13 pennies, 2 nickels, 4 dimes, 7 quarters, and 5 silver dollars.

  2. (3 points) You have been saving dimes and nickels in your piggy bank (everything counts). After counting 150 total coins, you know that you have $9.45. How many of each coin do you have?

  3. (4 points) Tom loans Tim $0.01 (one penny) under the condition that for every day that Tim does not pay Tom back, the amount that Tim owes Tom doubles (x2). If Tim does not pat Tom back, how many days go by before Tim owes Tom over $1,000,000.00?

  4. (10 points) Write a C program, called "hello.c", that prompts the user to input three initials, scans the three initials, and then outputs "Hello, XYZ!", where X,Y, and Z are the three input initials, respectively. Your program should be well formatted and documented with the necessary information to identify it as yours in the header comment. See the C Coding Standards for more details.

    Compile hello.c with the "gcc" compiler. Execute your program to verify that it works correctly. Once you have verified you program, email the source file, "hello.c", to the CMSC 104, 0801 TA, Pengyu Lie, pliu2@cs.umbc.edu.



Last Modified: Monday, 23-Sep-2002 08:53:13 PM EDT