Need help (New to coding!)
Hello guys I've been tasked to make a change calculator as in, you put in the price of a product and put in how much you pay, you will then get the change back in the different elements as in this case 1000kr bills, 500kr bills, 10kr coins, etc etc. For reference pris=price and växel=change.
Not quite sure how to get this to work but this is my progress. Any clues?
The code is below in the note file
9 Replies
have you tried to compile this code yet? you should probably test that
Use $code to share code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/specifically, you can't start variable names with a number
you also can't set properties that you defined as get-only (i guess this works if you only ever set them in the constructor)
and that's not a valid constructor...
and you can't have random loose lines of code in your class
are you using an IDE? if not you should because it will immediately give you feedback on these issues
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/Right will change the numbers to letters for the variables
How would I put together the get command?
Im using Visual Studio Code its not getting me any error codes
you probably need to follow $vscode
Follow the instructions here on getting started with DevKit for C# in VSCode: https://code.visualstudio.com/docs/csharp/get-started
Get started with C# and .NET in Visual Studio Code
Getting Started with C# and .NET Development in Visual Studio Code