Money Examples and The Fractions Problem
Programming: Two projects. One individual and one group.
Devise such a new scheme -- one that I could program once you tell me what to do. In particular, tell me the following:
Turn In: For Part A., just turn in the two programs (no documentation is needed). For Part B., turn in an English description (with pseudo-code algorithms as needed) of what I am supposed to do. For Part B, among other things, I need to know exactly how to add to type money data elements and how to multiply a money type element times an integer (or a float) type data element.
Due Date: Tuesday, February 11 (in class).
We need to write an interactive program that prompts the young user to enter two fractions in the form n / d, where n, the numerator, and d, the denominator, are both single-digit integers. Each fraction must be entered on a separate line, and you might even give them the pleasure of typing in their initials (max of three) at the very start and welcoming them to your “All About Fractions Program.”
Once the two fractions have been entered, prompt the user to enter the sum and then the product of the two fractions. These results MUST APPEAR AS FRACTIONS REDUCED TO LOWEST TERMS -- DO NOT USE DECIMAL NUMBERS SUCH AS .5, or .333, or .1, etc. If the user gets the sum and product of the two fractions correct, congratulate them and stop execution. If not, provide an encouraging message and give the correct answer as needed.
Your program should be written to do the following:
NOTE: The fact that the n and d are single digit integers is relevant ONLY for the validation step. Otherwise, you should not take advantage of this restriction anywhere in your program.
COMMENTS: If Parts A. and B are not carefully planned out you may never get them to work. The better your decomposition, the easier the task. There is no substitute for starting early and meeting often up until all components, their responsibilities and interfaces are agreed to and documented. You will want to devise a class (for a new data type called fraction) that handles, among other things, extraction, insertion, addition, and multiplication operations defined on fractions.
Turn In: Data Requirements Tables for each component of your program, and a Program Structure Chart. Also, turn in a compiled, working program and output. A personal one page statement as discussed below (see NOTE 1).
Due Dates: By Friday, February 21 at 4:30pm. The assignments should be slid under the door of the lab assistant’s office.
NOTE 1: If things work out right, you will have some class time to work on this problem. Remember -- each of you has a substantial responsibility to the other members of your group.
If you put in some quality time as a group working on the design of the program and allocating the work on the four main components to team members, you should have a much easier time. In a sense, each member of the group is making a contractual agreement with the other members. This agreement contains a complete description of WHAT each component will do but not HOW it will do it. In other words, you each agree on the services to be provided by your component to the other members of your team. And, of course, you each will need to provide the others with complete interfaces to your functions.
THIS IS A GROUP PROJECT. WE WILL TALK FURTHER IN CLASS ABOUT HOW TO SPLIT UP THE VARIOUS TASKS, AS WELL AS ABOUT ISSUES OF COMMUNICATION AMONG THE MEMBERS OF THE GROUP. WHEN YOUR GROUP TURNS IN ITS PROJECT, EACH OF YOU WILL BE RESPONSIBLE FOR YOUR OWN PERSONAL ONE PAGE REPORT ASSESSING THE POSITIVE AND NEGATIVE ASPECTS THE GROUP APPROACH AND WHAT YOU HAVE LEARNED FROM THIS APPROACH.
You should try to be as professional yet honest as you know how to be when you write your report. You may wish to keep a log of your experiences in working with your group as use this log to help formulate you report. Please note carefully: the one page report is NOT intended as documentation of the software system you produced. Rather it is intended as a record of:
NOTE 2: By Friday, Tuesday, February 14 (in class) you should turn in to me a complete breakdown of the components of the project together with an assignment as to who is to do what and when this work is to be completed. This is essentially your contract with each other and you all need to agree to it and stick with it.