Created
February 12, 2023 16:11
-
-
Save MocaaDevv/84d58d5ab87db049fc6fa1a8848246f7 to your computer and use it in GitHub Desktop.
Bu Java programı, bir ürünün KDV'li fiyatını hesaplamak için tasarlandı. Kullanıcı, ürün fiyatını ve KDV oranını girer ve program bu bilgileri kullanarak ürünün KDV'li fiyatını hesaplar ve ekrana yazar. Eğer kullanıcı KDV oranını yüzde olarak (örneğin, 18%) girerse, program bu oranı doğru şekilde kullanacaktır. Ancak eğer kullanıcı oranı bir say…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class KdvHesaplama { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
double kdv, fiyat, toplamFiyat; | |
System.out.print("Ürün Fiyatı: "); | |
fiyat = input.nextDouble(); | |
System.out.print("KDV Oranı: "); | |
kdv = input.nextDouble(); | |
if(kdv > 1){ | |
kdv = kdv / 100; | |
} | |
toplamFiyat = fiyat + (kdv * fiyat); | |
System.out.print("Ürünün KDV'li Fiyatı: " + toplamFiyat); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment