Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main()
- {
- double[,] taulukko = new double[5, 2];
- double summa = 0;
- for (int i = 0; i < 5; i++)
- {
- Console.Write("Anna tuotteen nimi: ");
- nimet[i] = Lue.rivi();
- //
- Console.Write("Anna tuotteen " + nimet[i] + " määrä: ");
- taulukko[i, 1] = Lue.dluku();
- Console.Write("Anna tuotteen " + nimet[i] + " hinta: ");
- taulukko[i, 0] = Lue.dluku();
- //
- }
- for (int i = 0; i < 5; i++)
- {
- Console.WriteLine(taulukko[i, 1] + " kpl " + nimet[i] + " maksaa " + taulukko[i, 0] * taulukko[i, 1] + " euroa.");
- summa = summa + taulukko[i, 0] * taulukko[i, 1];
- }
- Console.WriteLine("Tilauskustannus on " + summa);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement