This is the assignment
Write a program that will calculate the number of cents in a specific number of nickels,dimes and quarters. The program will perform the following tasks: Display “Welcome to ’s cents calculator” Ask the user to enter the number of nickels Ask the user to enter the number of dimes. Ask the user to enter the number of quarters. Calculate the total number of cents. Display to the monitor the number of cents.
and this is what I've got so far. When I debug the file it says there are no errors in the code, but there are other types of errors. It let me input the number of nickels, dimes and quarters, but then the program exits and I don't get any results.
If you guys could help me with this I'd appreciate it.
Code:
#include <iostream>
using namespace std;
int main ()
{
int numberofnickels, numberofdimes, numberofquarters, totalnumberofcents;
cout << "Welcome to Sofia's cents calculator \n ";
cout<<"Enter the number of nickels: " ;
cin>> numberofnickels;
cout<<"Enter the number of dimes: " ;
cin>> numberofdimes;
cout<<"Enter the number of quarters: " ;
cin>> numberofquarters;
totalnumberofcents = numberofnickels * 5 + numberofdimes * 10 + numberofquarters * 25;
cout << "Your total number of cents is: " << totalnumberofcents << endl;
return 0;
}