-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCusto.java
More file actions
63 lines (61 loc) · 2.08 KB
/
Custo.java
File metadata and controls
63 lines (61 loc) · 2.08 KB
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
52
53
54
55
56
57
58
59
60
61
62
import java.util.*;
public class Custo {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String gender[] = new String[10];
String name[] = new String[10];
int age[] = new int[10];
int choice[] = new int[10];
System.out.println("Enter the no of Customers:");
int n=sc.nextInt();
System.out.println("1.color pencil");
System.out.println("2.pen");
System.out.println("3.diary");
System.out.println("4.kettle");
System.out.println("5.toys");
System.out.println("6.umbrella");
System.out.println("7.socks");
System.out.println("8.coolers");
for (int i=0;i<n;i++)
{
System.out.println("Enter the name of the customer:");
name[i]=sc.next();
System.out.println("Enter the age of the customer:");
age[i]=sc.nextInt();
System.out.println("Enter the gender of the customer:");
gender[i]=sc.next();
System.out.println("Enter your Item choice:");
choice[i]=sc.nextInt();
}
for (int i=0;i<n;i++)
{
if (age[i]<=10 && gender[i]=="female")
System.out.println("Customer like colour pencils"+"Name of the customer:"+name[i]+"Choice of the item:"+choice[i]);
}
for (int i=0;i<n;i++)
{
if(age[i]<=10 && gender[i]=="male")
System.out.println("Customer like toys"+"Name of the customer:"+name[i]+"Choice of the item:"+choice[i]);
}
for (int i=0;i<n;i++)
{
if(age[i]>10 && age[i]<=30 && gender[i]=="female")
System.out.println("Customer like diary,socks"+"Name of the customer"+name[i]+"Choice of the item:"+choice[i]);
}
for (int i=0;i<n;i++)
{
if(age[i]>10 && age[i]<=30 && gender[i]=="male")
System.out.println("Customer like umbrella"+"Name of the customer"+name[i]+"Choice of the item:"+choice[i]);
}
for (int i=0;i<n;i++)
{
if(age[i]>30 && age[i]<=50 && gender[i]=="female")
System.out.println("Customer like pen,kettle"+"Name of the customer"+name[i]+"Choice of the item:"+choice[i]);
}
for (int i=0;i<n;i++)
{
if(age[i]>30 && age[i]<=50 && gender[i]=="male")
System.out.println("Customer like coolers"+"Name of the customer"+name[i]+"Choice of the item:"+choice[i]);
}
}
}