Doç. Dr. GÜRAY SONUGÜR

Doç. Dr. Güray SONUGÜR – Öğrenci Bilgi Paylaşım Platformu

3. Soru

import java.util.Random; public class diziler { public static void main(String[] args) { int[] dizi = new int[30]; Random rnd= new Random(); int sayac=0; int toplam=0; for (int i = 0; i < 30; i++) { dizi[i]= rnd.nextInt(300)+100;                 //100 ile 400 arası rasgele sayı üretimi System.out.println(“dizi[” + i […]

2. Soru

Soru 2     import java.util.Scanner; public class daireUcgen { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print(“a değerini giriniz:”); double a = sc.nextDouble(); System.out.print(“b değerini giriniz:”); double b = sc.nextDouble(); System.out.print(“c değerini giriniz:”); double c = sc.nextDouble(); double s=(a+b+c)/2; double R = (a*b*c)/(Math.sqrt((s*(s-a)*(s-b)*(s-c)))*4); System.out.println(“Sonuç: ” + R); } }   […]

1. Soru

    String[] dizi = new String[2]; //combobox dolduruluyor. dizi[0] = “Santigrat”; dizi[1] = “Fahrenayt”; ComboBoxModel comboModel = new DefaultComboBoxModel(dizi); cmbCikis.setModel(comboModel); JButton btnCevir = new JButton(“\Cevir”); btnCevir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (txtSckGiris.getText().isEmpty()) //boş giriş kontrolü { txtSckSonuc.setText(“Alanlar boş geçilemez!”); } else { double sckGiris=Double.parseDouble(txtSckGiris.getText()); double sckSonuc=0; txtSckSonuc.setText(“”); if (rdySantigratIlk.isSelected()&& cmbCikis.getSelectedItem()==”Santigrat”) { […]

Oto Fiyat Hesaplama

                            import java.awt.EventQueue; import javax.swing.ComboBoxModel; import javax.swing.DefaultComboBoxModel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JComboBox; import javax.swing.JCheckBox; import javax.swing.JPanel; import java.awt.FlowLayout; import javax.swing.UIManager; import javax.swing.JRadioButton; import javax.swing.JTextField; import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.ButtonGroup; import java.awt.Color; import java.awt.Font; public class OtoFiyat { private […]

2. soru ve yanıtı

import java.awt.EventQueue; import javax.swing.ComboBoxModel; import javax.swing.DefaultComboBoxModel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JRadioButton; import javax.swing.JButton; import javax.swing.JTextField; import javax.swing.JComboBox; import javax.swing.JPanel; import javax.swing.UIManager; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.ButtonGroup; import java.awt.Color; import java.awt.Font; import javax.swing.event.ChangeListener; import javax.swing.event.ChangeEvent; public class UrunSatis { private JFrame frmrnSat; private JTextField txtUrunAdi; private JTextField txtUrunFiyati; private JTextField txtUrun; private JTextField txtToplam; […]

Previous Posts Next posts