1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
anyanavicka [17]
3 years ago
10

Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per l

ine. 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++.
Computers and Technology
1 answer:
Pie3 years ago
6 0

Answer:

001122334455667788991010111213141516171819

Explanation:

You might be interested in
PLSSSSS HELPP!! Tropical rainforests are home to many kinds of birds, including parrots, toucans and eagles. Each different spec
Elanso [62]

Answer:

C I believe

Explanation:

5 0
3 years ago
Read 2 more answers
97. How many bits is a ki obyte?<br> a. 1000<br> b. 1024<br> c. 8192<br> d. 8124<br> 5
Basile [38]

Answer:

b

1024

is the correct answer

6 0
3 years ago
Read 2 more answers
Write an if/else statement that compares the value of the variables soldYesterday and soldToday, and based upon that comparison
jenyasd209 [6]

Answer:

if(soldYesterday > soldToday){

salesTrend = -1;

} else if(soldToday > soldYesterday){

salesTrend = 1;

}

Explanation:

The if/else statement is more explicit. The first if condition check if soldYesterday is greater than soldToday, if true, then -1 is assigned to salesTrend.

Else if soldToday is greater than soldYesterday, if true, then 1 is assigned to salesTrend.

7 0
3 years ago
Illl give brainliest plzzzzzzzzzz
salantis [7]

The one paste symbol name is : paste settings

it consist of 'paste special' and 'set default paste if im not wrong'

3 0
3 years ago
In C language
devlian [24]

Answer:

The program in C is as follows:

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

int main(){

   int dice [1000];

   int count [6]={0};

   srand(time(0));

   for (int i = 0; i < 1000; i++) {

       dice[i] = (rand() %(6)) + 1;

       count[dice[i]-1]++;

   }

   for (int i = 0; i < 6; i++) {

       printf("%d %s %d %s",(i+1)," occurs ",count[i]," times");

       printf("\n");

   }

   return 0;

}

Explanation:

This declares an array that hold each outcome

   int dice [1000];

This declares an array that holds the count of each outcome

   int count [6]={0};

This lets the program generate different random numbers

   srand(time(0));

This loop is repeated 1000 times

   for (int i = 0; i < 1000; i++) {

This generates an outcome between 1 and 6 (inclusive)

       dice[i] = (rand() %(6)) + 1;

This counts the occurrence of each outcome

       count[dice[i]-1]++;    }

The following prints the occurrence of each outcome

   for (int i = 0; i < 6; i++) {

       printf("%d %s %d %s",(i+1)," occurs ",count[i]," times");

       printf("\n");    }

8 0
3 years ago
Other questions:
  • The ________ is the heart of the operating system and controls its most critical processes.
    9·1 answer
  • For connection to place on any network you must have a set of standards?<br> O True<br> O False
    8·1 answer
  • How do you do these two questions? The first might have multiple answers and the second will have only one answer.
    14·1 answer
  • Select the different network functions from the list below.
    10·1 answer
  • Multisensory input/output devices, such as data gloves or jumpsuits, are commonly used with _______________ systems.
    12·1 answer
  • Dell, previously the world’s number one PC manufacturer, has seen its market share shrink because of rivals copying its value ch
    7·1 answer
  • Write a program that prompts the user for an integer, then asks the user to enter that many values. Store these values in an arr
    14·1 answer
  • Which is better PS4 or Xbox 1?
    13·2 answers
  • Complete the procedure for creating a new appointment by selecting the correct answers from the drop-down menus.
    11·1 answer
  • Will Give Brainiest to the first correct answer!!!!
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!