/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */
package javaapplication1;
/** * * @author 14712024 */import java.util.Scanner;public class JavaApplication1 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Scanner tara = new Scanner (System.in); double sayi, kare =0; System.out.println(“Bir Sayı Giriniz:”); sayi = tara.nextInt(); if(sayi<0) { kare = sayi*sayi; System.out.println(“Karesi: ” +kare); } else if (sayi>0) { System.out.println(“Karesi: ” +kare); } } }
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dersnot;
/**
*
* @author 14712024
*/
import java.util.Scanner;
public class dersnot {
public static void main(String[] args) {
Scanner tara = new Scanner(System.in);
int not;
System.out.println(“Sayı Gir:”);
not = tara.nextInt();
System.out.println(not>50 ? “Geçitiniz:”: “Kaldınız!”);
}
}
Java Script 2.Dönem Ders 1,