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;
- namespace ConsoleApplication1
- {
- class @for
- {
- static void Main() {
- int GB=0, GX=0, GY=0, GM=0,fe=0,ma=0,i=0;
- string []name=new string[20];
- int [] x= new int[20];
- Console.WriteLine("--------------------");
- Console.Write("Input you Name for loop :");
- int b = int.Parse(Console.ReadLine());
- int [] Esc = new int[b];
- Console.Write("\n====================\n");
- for (i=0; i<Esc.Length;i++ )
- {
- Console.WriteLine("\n-=:|Generation|:=-");
- Console.WriteLine("--------------------");
- Console.Write("Input you name :");
- name[i] = Console.ReadLine();
- Console.Write("Input you sex (male/female) : ");
- string sex = Console.ReadLine();
- Console.Write("Input you Birthday BE :");
- int KS = int.Parse(Console.ReadLine());
- x[i] = 2557 - KS;
- Console.WriteLine("Aeg : {0}",x[i]);
- Console.Write("\n====================\n");
- if (sex == "female" || sex == "Female" || sex == "F" || sex == "f")
- {
- fe = fe + 1;
- if (x[i] < 18)
- {
- Console.Write("No Generation < 18");
- }
- else if (x[i] <= 24)
- {
- GenerationM(ref GM);
- Console.Write("18-24 Generation M");
- }
- else if (x[i] <= 33)
- {
- GenerationY(ref GY);
- Console.Write("25-33 Generation Y");
- }
- else if (x[i] <= 39)
- {
- GenerationX(ref GX);
- Console.Write("34 - 39 Generation X");
- }
- else if (x[i] <= 63)
- {
- GenerationB(ref GB);
- Console.Write("40-63 Generation B");
- }
- else
- {
- Console.Write("old Generation >63");
- }
- }
- else if (sex == "male" || sex == "Male" || sex == "M" || sex == "m")
- {
- ma = ma + 1;
- if (x[i] < 15)
- {
- Console.Write("No Generation <15");
- }
- else if (x[i] <= 21)
- {
- Console.Write("15-21 Generation M");
- GenerationM(ref GM);
- }
- else if (x[i] <= 30)
- {
- Console.Write("22-30 Generation Y");
- GenerationY(ref GY);
- }
- else if (x[i] <= 37)
- {
- Console.Write("31-37 Generation X");
- GenerationX(ref GX);
- }
- else if (x[i] <= 60)
- {
- Console.Write("38-60 Generation B");
- GenerationB(ref GB);
- }
- else
- {
- Console.Write("old Generation >60 ");
- }
- }
- Console.Write("\n====================");
- }
- Console.Write("\nName : {0}",name[0]);
- for (int s = 1; s < i;s++)
- {
- Console.Write(",{0}",name[s]);
- }
- Console.WriteLine("\nMale = {0}",ma);
- Console.WriteLine("Female = {0}",fe);
- Console.WriteLine("Generation B = {0}",GB);
- Console.WriteLine("Generation X = {0}",GX);
- Console.WriteLine("Generation Y = {0}",GY);
- Console.WriteLine("Generation M = {0}",GM);
- Console.WriteLine("--------------------");
- Console.Write("==Enter-You-Close===");
- Console.WriteLine("\n--------------------");
- Console.ReadLine();
- }
- static int GenerationB(ref int GB)
- {
- return GB=GB+1;
- }
- static int GenerationX(ref int GX)
- {
- return GX = GX + 1;
- }
- static int GenerationY(ref int GY)
- {
- return GY = GY + 1;
- }
- static int GenerationM(ref int GM)
- {
- return GM = GM + 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement