Hello. I am using Visual Studio 2019 and am not sure why it is telling me I have 5 errors when I BUILD my code in C++. Can someone please take a look? #include using namespace std; int main() { int number_of_quarters, total_value_of_quarters; int number_of_dimes, total_value_of_dimes; int number_of_nickels, total_value_of_nickels; int number_of_pennies, total_value_of_pennies; int total_value_of_coins, total_dollars, total_cents; cout<<"Please enter the # of quarters: "<>number_of_quarters; cout<<"Please enter the # of dimes: "<>number_of_dimes; cout<<"Please enter the # of nickels: "<>number_of_nickels; cout<<"Please enter the # of pennies: "<> number_of_pennies; total_value_of_quarters = number_of_quarters * 25; total_value_of_dimes = number_of_dimes * 10; total_value_of_nickels = number_of_nickels * 5; total_value_of_pennies = number_of_pennies * 1; total_value_of_coins = total_value_of_quarters + total_value_of_dimes + total_value_of_nickels + total_value_of_pennies; total_dollars = total_value_of_coins / 100; total_cents = total_value_of_coins % 100; cout << "The total is " << total_dollars << " dollars and " << total_cents << " cents." << endl; return 0;
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Here a new c++ program with name "main.cpp" is created, which contains following code.
main.cpp :
#include <iostream>
using namespace std;
int main() { //main method
int number_of_quarters, total_value_of_quarters;
int number_of_dimes, total_value_of_dimes;
int number_of_nickels, total_value_of_nickels;
int number_of_pennies, total_value_of_pennies;
int total_value_of_coins, total_dollars, total_cents;
cout<<"Please enter the # of quarters: ";
cin>>number_of_quarters;
cout<<"Please enter the # of dimes: ";
cin>>number_of_dimes;
cout<<"Please enter the # of nickels: ";
cin>>number_of_nickels;
cout<<"Please enter the # of pennies: ";
cin>>number_of_pennies;
total_value_of_quarters = number_of_quarters * 25;
total_value_of_dimes = number_of_dimes * 10;
total_value_of_nickels = number_of_nickels * 5;
total_value_of_pennies = number_of_pennies * 1;
//find total value of coins
total_value_of_coins = total_value_of_quarters +
total_value_of_dimes + total_value_of_nickels +
total_value_of_pennies;
total_dollars = total_value_of_coins / 100; //calcualte number of
dollars
total_cents = total_value_of_coins % 100; //calculate cents
//display dollars and cents
cout << "The total is " << total_dollars << "
dollars and " << total_cents << " cents." <<
endl;
return 0;
}
======================================================
Output : Compile and Run above main.cpp to get the screen as shown below
Screen 1 :main.cpp

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
Hello. I am using Visual Studio 2019 and am not sure why it is telling me...
HELP ( i get these comment for this assignment please help me to fixed Please do not ask user to enter cents. Amount due and received should be in dollars such as 2.35 and 5.) Business P2.8Giving change. Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount received from the customer. Display the dollars, quarters, dimes, nickels, and pennies that the customer should receive in return. #include <iostream>...
This is a C++ Program I created in Visual Studio for class. The problem I am having is I get an error msg that says, "no matching token found for line 8." What am I missing? I see an opening bracket and a closing bracket. But, the program will not build because it says more or less the bracket is missing. FYI....Line 8, is the bracket directly under int main (). Can someone help me understand where I am going...
Can someone help me . This program needs to run in visual studio and written in c++. I want to call to the function string eraseChar in the main function to use the variables str and ch. I cannot use global variables. #include<iostream> #include <string> using namespace std; string eraseChar(char ch = 'e', string str = "the bike fell in the water"); int main() { int pos; pos = str.find(ch); while (pos != string::npos) {...
I have this code for python: num = int(input()) if num == 0: print('No change') else: dol = num // 100 num %= 100 Quarters = num // 25 num %= 25 Dimes = num // 10 num %= 10 Nickels = num // 5 num %= 5 Pennies = num if dol > 0: if dol == 1: print('1 Dollar') if Dollars > 1: print(dol,'Dollars') if Quarters > 0: if Quarters == 1: print('1 Quarter') if Quarters > 1:...
I made this C program to count change and make a slip saying the exact dollar and change amount given. every time I run the program it says the change given is 477256577 and i'm not sure what I have done wrong? #include<stdio.h> int main(void) { char first, last; int pennies; int nickels; int dimes; int quarters; int loonies; int change; int t_dollars; int t_cents; printf("Type in your 2 initials and press return> "); scanf("%c%c",&first,&last); printf("%c%c please enter in your...
C++ I am using visual studio for it. Make a copy of the Rational class you created in the previous Lab. Modify the class. Replace all your mathematical, input, and output functions with overloaded operators. Overload the following 12 operators: + - * / < > = = ! = <= >= >> << In order to test your class in your main function, prompt the user for a numerator and a denominator for your first object. Repeat the prompt...
Hello everyone! I am working on my assignment for C++ and I'm having a bit of trouble on the value producing functions, I am creating a program wherein I have to input a value and I need to create a function called square value where in it will square the value I have input. I cannot seem to figure out this part. Here is the code that I have so far, and thank you for any help. I greatly appreciate...
I am trying to run this program in Visual Studio 2017. I keep getting this build error: error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". 1>Done building project "ConsoleApplication2.vcxproj" -- FAILED. #include <iostream> #include<cstdlib> #include<fstream> #include<string> using namespace std; void showChoices() { cout << "\nMAIN MENU" << endl; cout << "1: Addition...
Am I using the right cin statement to take in values for my array? If I print them out it prints "0x61fea0" with the input 1 2 3 4 5 ///////////////////////////////// #include <iostream> using namespace std; const int ARRAY_LENGTH = 5; int main(){ int numbers[ARRAY_LENGTH]; int threshold; //@todo prompt user to enter array values cout << "Please input 5 numbers: " << endl; for(int i = 0; i < ARRAY_LENGTH; i++){ //@todo add cin statement to read in values for...
Can you please help me with creating this Java Code using the following pseudocode? Make Change Calculator (100 points + 5 ex.cr.) 2019 In this program (closely related to the change calculator done as the prior assignment) you will make “change for a dollar” using the most efficient set of coins possible. In Part A you will give the fewest quarters, dimes, nickels, and pennies possible (i.e., without regard to any ‘limits’ on coin counts), but in Part B you...