Advertisement
Guest User

Untitled

a guest
May 12th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.13 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 LearnC
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             bool isMale = true;
  14.  
  15.             //intro
  16.             Console.WriteLine("Welcome to the men only club");
  17.             Console.WriteLine("Create an account to continue");
  18.  
  19.             //username input
  20.             Console.Write("Pick a username: ");
  21.             string username = Console.ReadLine();
  22.  
  23.             //password input
  24.             Console.Write("Pick a Password: ");
  25.             string password = Console.ReadLine();
  26.            
  27.             //gender CheckUp
  28.             Console.WriteLine("What is your gender? ");
  29.             string gender = Console.ReadLine();
  30.             if (gender == "male")
  31.             {
  32.                 Console.WriteLine("You are good to go");
  33.             }
  34.             else if (gender == "Male")
  35.             {
  36.                 Console.WriteLine("You are good to go");
  37.             }
  38.             else
  39.             {
  40.                 Console.WriteLine("Invalid argument");
  41.             }
  42.  
  43.             //Using bools to verify if male or female
  44.             if (gender == "male")
  45.             {
  46.                 isMale = true;
  47.             }
  48.             else if (gender == "Male")
  49.             {
  50.                 isMale = true;
  51.             }
  52.             else if (gender == "Female")
  53.             {
  54.                 isMale = false;
  55.             }
  56.             else if (gender == "female")
  57.             {
  58.                 isMale = false;
  59.             }
  60.              
  61.             //path of male and path of female
  62.             if (isMale == false)
  63.             {
  64.                 Console.WriteLine("This is a men's club, you are not eligible to sign up");
  65.             }
  66.             else
  67.             {
  68.                 Console.WriteLine("Welcome to the club! Your account is " + username + " and your password is " + password);
  69.             }
  70.              
  71.  
  72.             //equivalent to a loop, just to keep the program running
  73.             Console.ReadLine();
  74.         }
  75.  
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement