0% found this document useful (0 votes)
19 views1 page

Ushtrjv

The document contains code for two Java classes - Total4 and Total5 - that calculate the total value of coins denominated in euros and cents. Total4 outputs the total as euros and cents separately, while Total5 outputs it as a single value of euros and cents. Both classes define variables for the amounts of different coin denominations, calculate the total value by multiplying each denomination by its value and summing them, and print the total value.

Uploaded by

gonny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Ushtrjv

The document contains code for two Java classes - Total4 and Total5 - that calculate the total value of coins denominated in euros and cents. Total4 outputs the total as euros and cents separately, while Total5 outputs it as a single value of euros and cents. Both classes define variables for the amounts of different coin denominations, calculate the total value by multiplying each denomination by its value and summing them, and print the total value.

Uploaded by

gonny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

/** Total4 e llogarit vleren e parave te imta qe i kam */

public class Total4


{ public static void main(String[] args)
{ int njezeta = 5;
int dhjeta = 2;
int pesa = 0;
int qindarka = 6;
System.out.println("Per keto vlera te metelikeve:");
System.out.println("Njezetqindarka = " + njezeta);
System.out.println("Dhjeteqindarka = " + dhjeta);
System.out.println("Peseqindarka = " + pesa);
System.out.println("Qindarka = " + qindarka);
int krejt = (njezeta * 20) + (dhjeta * 10)
+ (pesa * 5) + (qindarka * 1);
System.out.println("Shuma totale eshte " + (krejt / 100) + " euro e "
+ (krejt % 100) + " cente");
}
}

/** Total5 e llogarit vleren e parave te imta qe i kam */


public class Total5
{ public static void main(String[] args)
{ int njezeta = 5;
int dhjeta = 2;
int pesa = 0;
int qindarka = 6;
System.out.println("Per keto vlera te metelikeve:");
System.out.println("Njezetqindarka = " + njezeta);
System.out.println("Dhjeteqindarka = " + dhjeta);
System.out.println("Peseqindarka = " + pesa);
System.out.println("Qindarka = " + qindarka);
int krejt = (njezeta * 20) + (dhjeta * 10)
+ (pesa * 5) + (qindarka * 1);
System.out.println("Shuma totale eshte " + (krejt / 100) + "."
+ (krejt % 100) + " euro");
}
}

,
H

F
!

!
F

L H

@6

G F

Shuma totale eshte 1.6 euro

H
!

F :#

@
%

3@

!
F
&@ %S%@ %S"@

%6

F :

G F

&
D!
@

L
3S3&

You might also like