i am not able to print discount value ; is my program correct

#include <iostream>
#include <stdlib.h>
using namespace std;
class customer
{
private :
int customer_no;
char customer_name[20];
int qty;
float price,totalprice,discount,netprice;
public:
customer(){customer_no=111;customer_name[20]='leena';qty=0;price=0;netprice=0;}
void input();
void caldiscount();
void show();
};
void customer ::input()
{
cout<<"ENTER CUSTOMER NAME - ";
cin>>customer_name;
cout<<"ENTER QUANTITY OF GOODS - ";
cin>>qty;
cout<<"ENTER PRICE OF GOODS - ";
cin>>price;
system("CLS");
}
void customer ::caldiscount()
{
totalprice = price*qty;
if(totalprice>=50000)
{
discount = (25/100)*totalprice;
}
else if(totalprice>=25000&&totalprice<50000)
{
discount = (15/100)*totalprice;
}
else if(totalprice<25000)
{
discount = (10/100)*totalprice;
}
netprice = totalprice-discount;
}
void customer :: show()
{
cout<<"CUSTOMER_NAME - ";
cout<<customer_name<<endl;
cout<<"QUANTITY OF GOODS - ";
cout<<qty<<endl;
cout<<"PRICE OF GOODS - ";
cout<<price<<endl;
cout<<"TOTAL PRICE - ";
cout<<totalprice<<endl;
cout<<"DISCOUNT AMOUNT - ";
cout<<discount<<endl;
cout<<"NET PRICE OF GOODS - ";
cout<<netprice;

}
int main()
{
customer info;
cout<<"WELCOME TO KAUSTUBH STORES"<<endl;
info.input();
cout<<"DETAILS"<<endl;
info.caldiscount();
info.show();
}
(25/100)

If you carry out an integer division, you get an integer. In this case, a rounded zero.

Hints:
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
#include <iostream>
// #include <stdlib.h>     C header
#include <cstdlib>      // C++ header
#include <cstring>

class customer
{
private:
    int customer_no;
    char customer_name[20];
    int qty;
    double price, totalprice, discount, netprice;

public:
    customer()
    {
        customer_no = 111;
        std::strcpy(customer_name, "leena");
        qty = 0;
        price = 0;
        netprice = 0;
    }
    void input();
    void caldiscount();
    void show();
};

void customer::input()
{
    std::cout << "ENTER CUSTOMER NAME - ";
    std::cin >> customer_name;
    std::cout << "ENTER QUANTITY OF GOODS - ";
    std::cin >> qty;
    std::cout << "ENTER PRICE OF GOODS - ";
    std::cin >> price;
//    system("CLS");    Ms Windows only
}

void customer::caldiscount()
{
    totalprice = price * qty;
    if     (totalprice >= 50000)                       { discount = (25.0/100) * totalprice; }
    else if(totalprice >= 25000 && totalprice < 50000) { discount = (15.0/100) * totalprice; }
    else if(totalprice <  25000)                       { discount = (10.0/100) * totalprice; }
    netprice = totalprice - discount;
}

void customer::show()
{
    std::cout << "\n     CUSTOMER_NAME - " << customer_name
              << "\n QUANTITY OF GOODS - " << qty
              << "\n    PRICE OF GOODS - " << price
              << "\n       TOTAL PRICE - " << totalprice
              << "\n   DISCOUNT AMOUNT - " << discount
              << "\nNET PRICE OF GOODS - " << netprice << '\n';

}

int main()
{
    customer info;
    std::cout << "WELCOME TO KAUSTUBH STORES\n";
    info.input();
    std::cout << "DETAILS\n";
    info.caldiscount();
    info.show();
}


Output:
WELCOME TO KAUSTUBH STORES
ENTER CUSTOMER NAME - John
ENTER QUANTITY OF GOODS - 13
ENTER PRICE OF GOODS - 57
DETAILS

     CUSTOMER_NAME - John
 QUANTITY OF GOODS - 13
    PRICE OF GOODS - 57
       TOTAL PRICE - 741
   DISCOUNT AMOUNT - 74.1
NET PRICE OF GOODS - 666.9

Topic archived. No new replies allowed.