Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

Students also viewed these Databases questions

Question

If ( A^2 - A + I = 0 ), then inverse of matrix ( A ) is?

Answered: 1 week ago

Question

What is computer neworking ?

Answered: 1 week ago

Question

=+ What are the information and consultation requirements?

Answered: 1 week ago