2021.01.05. Output formázások

using System;

namespace adatlopo
{

    class Program
    {

        static void Main(string[] args)
        {

            //Adatlopó

            //Írjunk programot, mely adatokat kér be a

            //felhasználótól, majd különböző formában

            //kiírja azokat.

            //Szorgalmi: oldd meg a soronkénti

            //kiírásokat két oszloposan.



            Console.Title = "Ez nem adatlopó program :)";



            const string hackerCode = "DEVIL"; //ez nem változik a program során: konstans érték

            Console.Write("Felhasználónév: ");

            string userName = Console.ReadLine();

            Console.Write("Jelszó: ");

            string password = Console.ReadLine();

            Console.Write("IP cím: ");

            string ip = Console.ReadLine();

            Console.Write("Kedvenc torrent server: ");

            string torrent = Console.ReadLine();

            Console.Write("Letöltések száma havonta: ");

            string downloads = Console.ReadLine();



            Console.WriteLine("\n\n");



            //Kiírjuk a hacker képernyőjére a megszerzett adatokat:

            Console.WriteLine("To: {0} ", hackerCode);

            Console.WriteLine("Username: {0} ", userName);

            Console.WriteLine("Password: {0} ", password);

            Console.WriteLine("IP: {0} ", ip);

            Console.WriteLine("Torrent: {0} ", torrent);

            Console.WriteLine("Downloads: {0} ", downloads);



            Console.ReadLine();



            //Egy kicsit szebben így néz ki (balra rendezett):

            Console.WriteLine("To:          {0}", hackerCode);

            Console.WriteLine("Username:    {0}", userName);

            Console.WriteLine("Password:    {0}", password);

            Console.WriteLine("IP:          {0}", ip);

            Console.WriteLine("Torrent:     {0}", torrent);

            Console.WriteLine("Downloads:   {0}", downloads);



            Console.ReadLine();



            //Ugyanez elegánsan megoldva (jobbra rendezett):

            Console.WriteLine("To:          {0,19}", hackerCode);

            Console.WriteLine("Username:    {0,19}", userName);

            Console.WriteLine("Password:    {0,19}", password);

            Console.WriteLine("IP:          {0,19}", ip);

            Console.WriteLine("Torrent:     {0,19}", torrent);

            Console.WriteLine("Downloads:   {0,19}", downloads);



            Console.ReadLine();

            //Ugyanez elegánsan megoldva (balra rendezett):

            Console.WriteLine("To:          {0,-19}", hackerCode);

            Console.WriteLine("Username:    {0,-19}", userName);

            Console.WriteLine("Password:    {0,-19}", password);

            Console.WriteLine("IP:          {0,-19}", ip);

            Console.WriteLine("Torrent:     {0,-19}", torrent);

            Console.WriteLine("Downloads:   {0,-19}", downloads);


            //ugyanezeket így is kiírhatnánk (balra rendezett):

            Console.WriteLine("To: {0}, Username: {1}, Password: {2}, IP: {3}, Torrent: {4}, Downloads: {5}", hackerCode, userName, password, ip, torrent, downloads);



            Console.ReadLine();



            //vagy így (jobbra rendezett):

            Console.WriteLine("To: {0,8}, Username: {1,8}, Password: {2,8}, IP: {3,19}, Torrent: {4,8}, Downloads: {5,4}", hackerCode, userName, password, ip, torrent, downloads);

            Console.ReadLine();

            //Ugyanez két oszloposan megoldva (jobbra rendezett):

            Console.ReadLine();



            Console.WriteLine("To:          {0,19} IP:          {1,19}", hackerCode, ip);

            Console.WriteLine("Username:    {0,19} Torrent:     {1,19}", userName, torrent);

            Console.WriteLine("Password:    {0,19} Downloads:   {1,19}", password, downloads);



            Console.ReadLine();

        }

    }

}

2024.02.15.-16. Helyettesítés

 Adatbázis: vizsgaremek adatbázisának befejezése teljesen készre, dokumentáció kiegészítése, befejezése. Vizsgaremek felületének megvalósítá...