Question

## (Assume that there are 15 customers, first customer is given the serial no (SlNo.) 1, next customer 2 … and so on.

```				```
SL.NO. Name Ticket charges Discount Net amount 1
-       -     -              -        -
```
```

# Share code with your friends

Code

```				```
import java.util.Scanner;
public class Program6
{
public static void main(String[] args)
{

String name[];
double amount[];
double discount=0,net=0;
int i=0;
Scanner sc = new Scanner(System.in);
name=new String;
amount=new double;
for(i=0;i<15;i++)
{
System.out.println("Customer:"+(i+1));

System.out.print("Enter name: ");
name[i] = sc.nextLine();
System.out.print("Enter ticket amount: ");
amount[i] = sc.nextDouble();
sc.nextLine();
}

System.out.println("Sl. No.\t Name \t Charges \t Discount \t Net Amount");

for(i=0;i<15;i++)
{
if(amount[i] > 70000)
{
discount = 0.18*amount[i];
}
else if(amount[i] >= 55001 && amount[i] <= 70000)
{
discount = 0.16*amount[i];

}
else if(amount[i] >= 35001 && amount[i] <= 55000)
{
discount = 0.12*amount[i];
}
else if (amount[i] >= 25001 && amount[i] <= 35000)
{
discount = 0.10*amount[i];
}
else if (amount[i] <= 25000)
{
discount = 0.02*amount[i];
}

net = amount[i] - discount;
System.out.println((i+1) + "\t" + name[i] +"\t" + amount[i] + "\t" + discount + "\t" + net);
}

}
}

```
```

## Coding Store

Sale ### Mastering String

50
Sale 150
Sale 200
Sale ### Mastering Recursion

50
Sale ### Mastering Numbers

50
Sale ### Mastering Matrix

50
Sale ### Mastering Array

50
Sale ### ISC QUESTION PAPERS WITH SOLUTION(PROGRAMMING ONLY)

50
Sale 50