Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am m Programming Exercise 2-10 X LT) Instructions MakeChange.cs + + >_ Terminal Enter the number of dollars: Write a program named MakeChange that
I am m
Programming Exercise 2-10 X LT) Instructions MakeChange.cs + + >_ Terminal Enter the number of dollars: Write a program named MakeChange that calculates and displays the conversion of an entered number of dollars into currency denominations-twenties, tens, fives, and ones. 1 using System; 2 3 class MakeChange 4 { 5 static void Main() 6 7 //variable to stores the denominations 8 int twenties, tens, fives, ones; 9 For example, if 113 dollars is entered, the output would be twenties: 5 tens: 1 fives: O ones: 3. 10 11 12 13 //getting the user input Console.WriteLine("Enter the number of dollars:"); int dollars = Convert.ToInt32(Console.ReadLine()); Grading 14 15 // calculating the number of twenties twenties - dollars / 20; dollars = dollars % 20; 16 When you have completed your program, click the Submit button to record your score. // calculating the number of tens tens = dollars 10; dollars = dollars % 10; 17 18 19 20 21 22 23 24 25 26 1/ calculating the number of fives fives = dollars / 5; dollars = dollars % 5; // calculating the number of onesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started