/
age_dis.txt
51 lines (43 loc) · 1.49 KB
/
age_dis.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AgeDis
{
class Program
{
static void Main(string[] args)
{
int age;
int i;
int a = 0;
int b = 0 ;
int c = 0;
int d = 0;
int e = 0;
for (i = 1; i <= 10; i++)
{
Console.WriteLine("");
Console.WriteLine("How old are you?");
age = Convert.ToInt32(Console.ReadLine());
if (age > 16 && age <= 24) { System.Console.Write("You are a Millenial ");
a += 1;}
else if (age > 24 && age <= 35) { System.Console.Write("You are a part of GEN X ");
b += 1;}
else if (age > 35 && age <= 46) { System.Console.Write("You are in the G.I. Generation ");
c += 1;}
else if (age > 46 && age <= 57) { System.Console.Write("You are a Younger Baby Boomer ");
d += 1;}
else if (age > 57 && age <= 70) { System.Console.Write("You are a Older Baby Boomer ");
e += 1;}
}
System.Console.WriteLine(a);
System.Console.WriteLine(b);
System.Console.WriteLine(c);
System.Console.WriteLine(d);
System.Console.WriteLine(e);
System.Console.ReadLine();
}
}
}