Question













ELEC 1520 Homework - Integer Operations, Selection Statements Instructions Write C++ programs to solve the following two prob
2. A company gives a bonus to all its employees. A 2% bonus on salary is given to employees who have been with the company fo
Grading Problem 1 Problem 2 Description Program Variable declaration/setup Input Process Output Documentation & Style Total N
Learning Outcomes (for instructor use) Problem 1 Problem 2 Learning Outcome LOI - Understand and use the basic programming pr
0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE IN C++:

#include <iostream>

using namespace std;

int main()
{
int cents,quarters,dimes,nickles,pennies;
cout<<"Enter cents value:";
cin>>cents;
int temp = cents;
quarters = cents/25;
cents = cents % 25;
dimes = cents/10;
cents = cents % 10 ;
nickles = cents / 5 ;
cents = cents % 5;
pennies = cents ;
cout << "Change for "<<temp<<" cents"<<endl;
cout<<"\t\t"<<quarters<<" quarters"<<endl;
cout<<"\t\t"<<dimes<<" dimes"<<endl;
cout<<"\t\t"<<nickles<<" nickles"<<endl;
cout<<"\t\t"<<pennies<<" pennies"<<endl;
cout<<"------------------------"<<endl;

return 0;
}
OUTPUT:

input Enter cents value:99 Change for 99 cents 3 quarters 2 dimes O nickles 4 pennies - - - - - - - - ... Program finished wi

Add a comment
Know the answer?
Add Answer to:
ELEC 1520 Homework - Integer Operations, Selection Statements Instructions Write C++ programs to solve the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given a value V in cents, you need to make change using a minimum number of...

    Given a value V in cents, you need to make change using a minimum number of coins. Assume you have an infinite supply of quarters, nickels, dimes, and pennies. Find the minimum number of coins. Display the quantity of each coin and the total number of coins, similar to the example output below. Use global constant identifiers, of type unsigned int, for the values of quarters, nickels, dimes, and pennies. Example: const unsigned int QUARTER = 25: Do not use...

  • in c code x Global Soccer 1.docx x Acceleration Due to 6 x M Inbox (5,949)...

    in c code x Global Soccer 1.docx x Acceleration Due to 6 x M Inbox (5,949) - joshfor x M Inbox (4,224) - joshuar X ® AC ads/ACFrOgA6UB 1k4Z1i1xGLNQ1Lntj510 lutEUaA..pdf ECE 175: Computer Programming for Engineering Applications Lab Assignment #2 (Thursday sessions) Relevant Programming Concepts: • Branch Structure • Loop Problem 1 (15 points): Develop a C program that asks a user to enter a total change amount in cents) and outputs the change using the fewest coins. The coin...

  • Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10...

    Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. 2. Repeatedly prompt the user for a price in the form xX.xx, where X denotes a digit, or to enter q' to quit 3. When a price is entered a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a 'q)...

  • Can you please help me with creating this Java Code using the following pseudocode? Make Change C...

    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...

  • Please use C# For this project, we will see what it's like to write a simple...

    Please use C# For this project, we will see what it's like to write a simple windows application program that we can perform easily in our heads. You'll find that writing programs is similar to explaining things to a 5-year-old. You are to make this program "user friendly". In other words, make sure valid data has been entered. You are to create a simple change program. The user enters the amount due and the amount tendered. You are to calculate...

  • in C please! Proiect Overview: A business owner is unhappy with the services provided by the...

    in C please! Proiect Overview: A business owner is unhappy with the services provided by the government and has chosen to pay the tax using a combination of coins including quarters, dimes, nickels, and pennies. In this project, you are asked to write a program to analyze the tax payment in coins. Th nickels and pennies the owner has paid. It then computes the total amount of tax paid in dollars and cents, and computes the weight of all the...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

  • I have this case study to solve. i want to ask which type of case study...

    I have this case study to solve. i want to ask which type of case study in this like problem, evaluation or decision? if its decision then what are the criterias and all? Stardust Petroleum Sendirian Berhad: how to inculcate the pro-active safety culture? Farzana Quoquab, Nomahaza Mahadi, Taram Satiraksa Wan Abdullah and Jihad Mohammad Coming together is a beginning; keeping together is progress; working together is success. - Henry Ford The beginning Stardust was established in 2013 as a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT