
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Project; Class: CS I PROG/PROBLEM SOLVING; Subject: Computer Science; University: Kent State University; Term: Fall 2006;
Typology: Study Guides, Projects, Research
1 / 1
This page cannot be seen from the preview
Don't miss anything!

In this extra credit assignment you will have the opportunity to demonstrate the usefulness of functional abstraction by implementing a second version of a function to output the ‘get money’ prompt and take in the monetary value entered by the user as required in Project #3.
Specifically, you will need to encapsulate the part of the original Project3 that prints out:
Please enter the amount of money deposited (in dollars): 1.
and takes in the value entered by the user. For example let’s say that your original program included a function called “get_money”, then, you will need to write a new “get_money” code in a file called input2.cpp. This new function needs to accept the user input in a different type of variable than you used for your original project3 work but must return the same type of value as in your first version. Thus this new function encapsulates all of the processing that must be done to get the money amount deposited by the user and converted it into a single integer amount that is returned to the calling program (which may be another function besides “main” depending on how you implemented your original solution).
When implemented correctly your new function can be linked together with your original code by adding a new goal to your Makefile. The new goal must be called vend2 and must be implemented so that your input2.cpp file is a dependency together with any other dependencies (main.cpp, etc) as required by your particular implementation. In other words no other part of your main.cpp executable code from project #3 should be changed for this extra-credit project.
You should place your extra-credit work in a directory called Project3extra. This directory should contain the following files*:
Create and commit all files listed above to a Project3extra directory in your repository. Ensure that your code is properly commented and has good programming style.
You must have a working Project3 program in order to be eligible for this extra credit. If your original Project3 does not compile and execute correctly you must first redo Project3 before you can be eligible to turn in code for this extra-credit.
This extra-credit assignment is worth 50 points towards your course grade.