Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication2
  8. {
  9. class Program
  10. {
  11. static void Main()
  12. {
  13.  
  14. double[,] taulukko = new double[5, 2];
  15. double summa = 0;
  16.  
  17. for (int i = 0; i < 5; i++)
  18. {
  19. Console.Write("Anna tuotteen nimi: ");
  20. nimet[i] = Lue.rivi();
  21. //
  22. Console.Write("Anna tuotteen " + nimet[i] + " määrä: ");
  23. taulukko[i, 1] = Lue.dluku();
  24. Console.Write("Anna tuotteen " + nimet[i] + " hinta: ");
  25. taulukko[i, 0] = Lue.dluku();
  26. //
  27. }
  28.  
  29.  
  30.  
  31. for (int i = 0; i < 5; i++)
  32. {
  33. Console.WriteLine(taulukko[i, 1] + " kpl " + nimet[i] + " maksaa " + taulukko[i, 0] * taulukko[i, 1] + " euroa.");
  34.  
  35. summa = summa + taulukko[i, 0] * taulukko[i, 1];
  36. }
  37.  
  38.  
  39. Console.WriteLine("Tilauskustannus on " + summa);
  40.  
  41. }
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement