Programlama | Programlama Dilleri | C Programlama Dili |C++

Hata
  • XML Parsing Error at 1:82. Error 9: Invalid character
Anasayfa Programlama Java Ortalama Bul


Ortalama Bul

AIKLAMA

Kullan?c?dan al?nan 10 adet say?n?n ortalamas?n? bulan koddur.

Program Kodu:

  1. import java.awt.Graphics;
  2. import javax.swing.*;
  3. public class OrtalamaBul extends JApplet {
  4. int sayici=0,toplam=0;
  5. public void init()
  6. {
  7. while(sayici<10)
  8. {
  9. sayici++;
  10. int girilen=Integer.parseInt(JOptionPane.showInputDialog(sayici+". Sayiyi Girin"));
  11. toplam+=girilen;
  12. }
  13. double sonuc=(double) toplam/10;
  14. JOptionPane.showMessageDialog(null,"Ortalama: "+sonuc);
  15. }
  16. public void paint(Graphics g)
  17. {
  18. super.paint(g);
  19. }
  20. }

Yorumlar (0)
Sadece kayıtlı kullanıcılar yorum yazabilir!
Son Güncelleme ( Cuma, 08 Nisan 2011 00:14 )  
404 Not Found

404

Not Found

The resource requested could not be found on this server!


Proudly powered by LiteSpeed Web Server

Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.