-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapnamall.java
More file actions
72 lines (59 loc) · 1.6 KB
/
apnamall.java
File metadata and controls
72 lines (59 loc) · 1.6 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
63
64
65
66
67
68
69
70
71
72
import java.util.Scanner;
class item
{
Scanner kb = new Scanner(System.in);
String code, name, rate, qty, dis, tax;
double value, irate, iqty;
int icode;
double taxvalue; double disvalue; double amount;
void basic() //for basic input
{
System.out.print("\n\nEnter Item Code: ");
code = kb.next();
icode = Integer.parseInt(code);
System.out.print("\nEnter Item Name: ");
name = kb.next();
System.out.print("\nEnter Item Rate: ");
rate = kb.next();
irate = Double.parseDouble(rate);
System.out.print("\nEnter Item Quantity: ");
qty = kb.next();
iqty = Double.parseDouble(qty);
}
void value() //for calculating value
{
value = irate * iqty;
System.out.print("\nItem Value: "+ value);
}
void tax() //for calculating tax value
{
System.out.print("\n\nEnter Tax(%): ");
tax = kb.next();
double itax = Double.parseDouble(tax);
taxvalue = value * (itax/100);
}
void discount() //for calculating discount value
{
System.out.print("\nEnter Discount(%): ");
dis = kb.next();
double idis = Double.parseDouble(dis);
disvalue = value * (idis/100);
}
void amount()
{
amount = value + taxvalue - disvalue;
System.out.print("\nItem Value: "+ amount+"\n");
}
}
class apnamall
{
public static void main(String[] args)
{
item i = new item();
i.basic();
i.value();
i.tax();
i.discount();
i.amount();
}
}