C
C#8mo ago
k3v.n

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
Jimmacle
Jimmacle8mo ago
have you tried to compile this code yet? you should probably test that
mtreit
mtreit8mo ago
Use $code to share code
MODiX
MODiX8mo ago
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/
Jimmacle
Jimmacle8mo ago
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
k3v.n
k3v.n8mo ago
$code
MODiX
MODiX8mo ago
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/
k3v.n
k3v.n8mo ago
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
Jimmacle
Jimmacle8mo ago
you probably need to follow $vscode
MODiX
MODiX8mo ago
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