Question: 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

I am m Programming Exercise 2-10 X LT) Instructions MakeChange.cs + +

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 ones

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!