CMIS102 Homework Assignment 1 (Worth 13% of your grade)
CMIS102, Section 6388
Assignment due date:
Problem definition: Calculate the total value of a group of coins. Assume that the coins are the standard American coins: penny, nickel, dime, quarter.
Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. a)
What is the required output?
Total value of a group of joins
Name of the coins
Value of the coins
What is the necessary input?
In order to output the item’s Value, the program must know the value of the coin. (Dime = 10 cents, Quarter = 25 cents, etc…) o
The program must also know what coins I am grouping together o
In order for the program to calculate the total value of a group of coins, it must know the Value of each coin itself and it must know the group of joins I choose. After choosing the coins, it should calculate the total based on Value and Name of the coin c)
How you will obtain the required output from the given input? o
To compute the “GroupValue” (total value of a group of coins) we need to know the “CoinValue”(the individual value, in cents, of the coin itself) and the “CoinName” (to separate each coin with its CoinValue, we need to know the name of each coin). It will also need to know the “AmountOfEach” in order to know how many times it should calculate each “CoinValue”. o
An example of the process of finding the total value of a group of coins would be: Say you input 2 Dimes, 1 Penny and 3 Nickels. The program will process the value of the dime, penny and nickel. As it finds the value of each coin, it will process the input of how many times the coin was requested. 2(0.10)+1(.0.01)+3(0.05) = 0.36
Program Design – Following the directions in the assignment, clearly write up your problem design in this section and...
Please join StudyMode to read the full document