Hello,
I am so new to QT , I wanted to create an application that calculates the salary after exclusion of taxes.The application has 1 lineedit for the user to put his salary and 1 push button so when the user click it his salary after the exclusion of taxes appears on a messagebox .There are three cases to calculate the salary after the exclusion of taxes
case 1 :
if salary is less than or equals 5000 , in this case taxes equals zero so the salary would be the same.
example:
if the user put his salary in the lineedit 5000 then clicked the push button ,a messagebox will appear showing 5000"and I have no problem with this case .

case 2 :
if salary is more than 5000 and less than or equals 10000 and in this case the taxes for the 1st 5000 of the salary = 0 but the taxes for any money above 5000 would be 5%
example :
if salary is 7000
then the taxes for the 1st 5000 =0
and the taxes for the money above 5000 is %5
7000-5000=2000*5=10000/100=100 so the taxes is 100
and the salary after taxes = 7000-100= 6900
and the problem in this case is I don't know how to write the code for it
I want a code for a messagebox showing the salary after doing all the math above

case 3 :
if salary is more than 10000 , the taxes for the 1st 5000 is zero and the second 5000 is 5% and any money above 10000 is 10%
example:
if salary is 11000
the taxes for 1st 5000 is zero
and the taxes for the 2nd 5000 is 5000*5/100=250
and the taxes for the money above 10000 which is 1000 in this example is 1000*10/100=100
so the total of taxes is 250+100=350
so the salary after taxes would be 11000-350=10650
and I have a problem with this case same as case 2 .

Qt Code:
  1. void MainWindow::on_pushButton_clicked()
  2. {
  3. long salary ;
  4. salary = ui->lineEdit->text().toLong();
  5. if (salary<=5000)
  6. {
  7. QMessageBox::information(this,"salary",QString::number(salary));
  8. }
  9. else
  10. if (salary>5000 && salary >=10000)
  11. {
  12.  
  13.  
  14. }
  15. else
  16. if (salary>10000)
  17. {
  18. }
  19. }
To copy to clipboard, switch view to plain text mode 
can someone help me with the code?
Thanks in advance