Hello folks. I am possibly the most inexperienced person right now in the forum when it comes to writing codes and understanding most of it. I have been reading a book and so far have made it through to operators.
What basically is the idea that I am trying to test myself by allowing the user to enter a random amount and I would like to program it in a way that the result, depending on the input value, shows the denominations of the amount. To make it simpler, say I have 1270 USD. This is the amount the user inputs. The program should then be able to identify and inform the user how many 10s or 20s or 50s or 100s the amount will be comprising making up to the total value entered by the user.
I just started typing the code (again, I am a starter and I have only a bleak idea). This is what I typed.
So i tested it. I entered 1200 as a test and it shows;
Your total amount: 1200
49
1000 x 0
Press any key to continue...
I am lost. Absolutely lost. I would request whosoever can help me out here, please explain it to me in the most basic way possible
I really wish to enter the field and your assistance would do me great help.
What basically is the idea that I am trying to test myself by allowing the user to enter a random amount and I would like to program it in a way that the result, depending on the input value, shows the denominations of the amount. To make it simpler, say I have 1270 USD. This is the amount the user inputs. The program should then be able to identify and inform the user how many 10s or 20s or 50s or 100s the amount will be comprising making up to the total value entered by the user.
I just started typing the code (again, I am a starter and I have only a bleak idea). This is what I typed.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Task_1 { class Program { static void Main(string[] args) { Console.Write("Your total amount: "); int amount = Console.Read(); Console.WriteLine(amount); int Thousand = amount / 1000; Console.Write("1000 x "); Console.WriteLine(Thousand);
So i tested it. I entered 1200 as a test and it shows;
Your total amount: 1200
49
1000 x 0
Press any key to continue...
I am lost. Absolutely lost. I would request whosoever can help me out here, please explain it to me in the most basic way possible