Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 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 mission19
  8. {
  9.     class Program
  10.     {
  11.         static string TulostaJaLue(string ohje)
  12.         {
  13.             Console.Write(ohje);
  14.             return Console.ReadLine();
  15.         }
  16.         static void KysyTiedot(ref string nimi, ref int ika, ref string henkiloTunnus, ref float pituus, ref float paino)
  17.         {
  18.             nimi = TulostaJaLue("Syötä nimesi: ");
  19.             ika = Int32.Parse(TulostaJaLue("Syötä ikäsi: "));
  20.             henkiloTunnus = TulostaJaLue("Syötä henkilötunnuksesi: ");
  21.             pituus = float.Parse(TulostaJaLue("Syötä pituutesi: "));
  22.             paino = float.Parse(TulostaJaLue("Syötä painosi: "));
  23.         }
  24.         static void Main(string[] args)
  25.         {
  26.             string nimi = "";
  27.             int ika = 0;
  28.             string henkiloTunnus = "";
  29.             float pituus = 0;
  30.             float paino = 0;
  31.             KysyTiedot(ref nimi, ref ika, ref henkiloTunnus, ref pituus, ref paino);
  32.             Console.WriteLine(nimi + ika + henkiloTunnus + pituus + paino);
  33.             Console.ReadLine();
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement