-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patholcumSayilari.java
More file actions
43 lines (28 loc) · 993 Bytes
/
olcumSayilari.java
File metadata and controls
43 lines (28 loc) · 993 Bytes
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
package projeler2;
import java.util.Scanner;
public class olcumSayilari {
public static void main(String[] args) {
/*
SORU 31 :
OLÇÜM SAYISI VE OLÇÜM GİRİLEN BİR UYGULAMA ÖLÇÜM 0 GİRİLİNCE BİTİYOR.
OLCUM SAYISI BİTTİKTEN SONRA ARA TOPLAM TÜM OLCUMLER BİTTİKTEN SONRA GENEL TOPLAM VERİLİR.
*/
Scanner input = new Scanner(System.in);
double araToplam = 0;
double genelToplam = 0;
double olcumSayisi = 1;
while (olcumSayisi != 0) {
System.out.printf("\n\nOLCUM SAYISI : ");
olcumSayisi = input.nextInt();
for (int counter = 0; counter < olcumSayisi; counter++) {
System.out.printf("olcum giriniz : ");
Double olcum = input.nextDouble();
araToplam += olcum;
}
System.out.printf("\nAra toplam = %.2f", araToplam);
genelToplam += araToplam;
araToplam = 0;
}
System.out.println("\n\nGENEL TOPLAM = " + genelToplam);
}
}