0 ratings0% found this document useful (0 votes) 20 views1 pageCode 1 (I)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Q_onee 2024-Jun-16 26:11 Page 1
I
NAME:~SOURADEEP BHATTACHARYA,
CLASS: -18, SECTION: -D
ROLL NO:-46
UID :-8506391
‘ST STEPHEN'S SCHOOL
/
import [Link];// Importing Scanner
ublic class Q_onee
// Class declared
‘Scanner inp=new Scanner ([Link]) ;
J7 Prompt the user to enter customer name
[Link]("Enter customer name:
String name=[Link]() ;
// Prompt the user to enter ticket amount
[Link]("Enter ticket amount:
double a= [Link]() ;
double c= 8;
JJ Calculate discount based on ticket amount
24 |i (a>70000)
25\4
26| 0.18;
27\}
28|else if (a>=55001 && a<=70000)
29 |<
30] c=@.16;
31\}
32|else if (a>=35001 && a<=55000)
33|¢
34) 0.12;
35|}
36 |else if (a>=25001 && a<=35000)
37\t
38
39|}
40 jelse
41 /{
42
1
2
3
4
5
6
7
8
9
10
1
12
13
14/// Create a Scanner object for user input
15
16
iv
18
19
20
21
2
23
44]// calculate discount amount and net amount
45 | double
46 | double
47|/7 Display the output with appropriate spacing
48 |[Link]("S1. No.\tNane\t\tTicket Charges\tDiscount\tNet Amount");
49 |[Link]("1\t" + name + "\t" +a + “\t\t" +b + “\t\t” + 4);