❔ Can anyone help me out with a calculation project?

using System; namespace UppgiftVäxel { class Program { static void Main(string[] args) { Console.WriteLine("Welcome to the app where we calculate " + "the change for one/ several goods when buying and pay for it"); Console.WriteLine("Enter the paid: "); int paid = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter the cost money: "); float cost = Convert.ToSingle(Console.ReadLine()); float change = paid - cost; int num1000Bills = (int)change / 1000; change %= 1000; int num500Bills = (int)change / 500; change %= 500; int num100Bills = (int)change / 100; change %= 100; int num50Bills = (int)change / 50; change %= 50; int num20Bills = (int)change / 20; change %= 20; } } }
Was this page helpful?