Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
rekenmachine in c#
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { double getal1; double getal2; double oplossing; string bewerking; //Your code goes here Console.WriteLine("Voer het eerste getal in: "); getal1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Voer het tweede getal in: "); getal2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Geef je bewerking op"); bewerking = Console.ReadLine(); switch(bewerking) { case "*": oplossing = vermenigvuldigen(getal1,getal2); break; case "+": oplossing = optellen(getal1,getal2); break; case "-": oplossing = aftrekken(getal1,getal2); break; case "/": oplossing = delen(getal1,getal2); break; default: oplossing = 0; break; }} public static Double vermenigvuldigen(Double getallen1,Double getallen2) { Double x; x = getallen1 * getallen2; return x; } public static Double optellen(Double getallen1,Double getallen2) { Double x; x = getallen1 + getallen2; return x; } public static Double delen(Double getallen1,Double getallen2) { Double x; x = getallen1 / getallen2; return x; } public static Double aftrekken(Double getallen1, Double getallen2) { Double x; x = getallen1 * getallen2; return x; } } }
run
|
edit
|
history
|
help
0
a
u
*271*271#
Fórum SO ➡ Merging 2 lists by Name and adding their Values, using LINQ ♦
Task 1_3
Binary Hex Decimal Systems
Split and Join
show IP
Lab8
math 5.74