subject

Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is:
0
or less, the output is:
no change
Ex: If the input is:
45
the output is:
1 quarter 2 dimes
Your program must define and call the following function. Positions 0-4 of coinVals should contain the number of dollars, quarters, dimes, nickels, and pennies, respectively.
void ExactChange(int userTotal, vector& coinVals)
#include
#include
using namespace std;
void ExactChange(int userTotal, vector& coinVals) {
if (penny == 1) {
cout << penny << "penny" << endl;
}
if (penny > 1) {
cout << penny << "pennies" << endl;
}
if (penny == 0) {
cout << "no change" << endl;
}
}
/* Define your function here */
int main() {
int inputVal;
vector changeAmount(5);
cin >> inputVal;
ExactChange(inputVal, changeAmount);
/* Type your code here. Your code must call the function. */
return 0;
}
Please help me with this problem using c++.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
Research data that is presented using descriptive language is said to be
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
You know the right answer?
Write a program with total change amount as an integer input that outputs the change using the fewes...
Questions
question
Biology, 15.12.2020 01:00
question
Chemistry, 15.12.2020 01:00
question
English, 15.12.2020 01:00
Questions on the website: 13722359