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

Hata
  • XML Parsing Error at 1:82. Error 9: Invalid character


Akrep ?le Yelkovan Aras?ndaki Aç?y? Hesaplama

Java ile yaz?lm?? olan bu programda akrep ile yelkovan aras?ndaki aç? hesaplanmaktad?r. Burada saat girilirken A.M modunda girilmelidir örnek olarak (6:30 , 7:45 , 11:23 ?eklindeki veriler gibi girilmelidir. Buradaki aç? hesaplama i?lemi ikisi aras?nda kalan küçük aç?n?n hesaplanmas? i?lemidir.

 

  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package javaapplication6;
  6.  
  7. import java.awt.Container;
  8. import java.awt.FlowLayout;
  9. import java.awt.event.ActionEvent;
  10. import java.awt.event.ActionListener;
  11. import javax.swing.*;
  12.  
  13. /**
  14.  *
  15.  * @author NEO
  16.  */
  17. public class NewJApplet extends JApplet implements ActionListener{
  18.  
  19.     /**
  20.      * Initialization method that will be called after the applet is loaded into
  21.      * the browser.
  22.      */
  23. JTextField akrepci;
  24. JTextField yelkovanci;
  25. JButton hesapla;
  26.    
  27. public void init()
  28. {
  29. Container pencere=getContentPane();
  30. pencere.setLayout(new FlowLayout());
  31. JLabel akrep=new JLabel("Akrep De?eri");
  32. pencere.add(akrep);
  33. akrepci=new JTextField(20);
  34. pencere.add(akrepci);
  35. JLabel yelkovan=new JLabel("Yelkovan De?eri");
  36. pencere.add(yelkovan);
  37. yelkovanci=new JTextField(20);
  38. pencere.add (yelkovanci);
  39. hesapla= new JButton("Aralar?ndaki Aç?y? Hesapla");
  40. pencere.add(hesapla);
  41. hesapla.addActionListener(this);
  42. }
  43. public void actionPerformed(ActionEvent olay)
  44. {
  45. double akrep=Double.parseDouble(akrepci.getText());
  46. double yelkovan=Double.parseDouble(yelkovanci.getText());
  47. double aciciakrep=0;
  48. double aciciyelkovan=0;
  49. aciciyelkovan+=(((yelkovan)*360)/360)*6;
  50. aciciakrep+=akrep*30+((yelkovan*6))*30/360;
  51. double fark=aciciyelkovan-aciciakrep;
  52. fark=Math.abs(fark);
  53. JOptionPane.showMessageDialog(null,fark,"Aç? Fark?",JOptionPane.PLAIN_MESSAGE);
  54. }
  55. }

Yorumlar (0)
Sadece kayıtlı kullanıcılar yorum yazabilir!
 
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.