Write a program that requires you to calculate a shop’s total money in a specific register. All
the different notes should be added to calculate how much money is in the register. The coins
are added together manually and then added to the total. Required input values are:
o The amount of 10 rand notes.
o The amount of 20 rand notes.
o The amount of 50 rand notes.
o The amount of 100 rand notes.
o The amount of 200 rand notes.
o The total of the coins.
The output is the total cash in the register.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace ShopTotalMoney
{
class Program
{
static void Main(string[] args)
{
int total = 0;
//The amount of 10 rand notes.
Console.Write("Enter the number of 10 rand coins: ");
int coins = int.Parse(Console.ReadLine());
total += coins * 10;
//The amount of 20 rand notes.
Console.Write("Enter the number of 20 rand coins: ");
coins = int.Parse(Console.ReadLine());
total += coins * 20;
//The amount of 50 rand notes.
Console.Write("Enter the number of 50 rand coins: ");
coins = int.Parse(Console.ReadLine());
total += coins * 50;
//The amount of 100 rand notes.
Console.Write("Enter the number of 100 rand coins: ");
coins = int.Parse(Console.ReadLine());
total += coins * 100;
//The amount of 200 rand notes.
Console.Write("Enter the number of 200 rand coins: ");
coins = int.Parse(Console.ReadLine());
total += coins * 200;
//display the total of the coins.
Console.WriteLine("The total is: {0}", total.ToString());
Console.ReadLine();
}
}
}
Comments
this was very helpful ,thank you
Leave a comment