Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
package hesapmakinesi;
import java.util.Scanner;
public class HesapMakinesi {
public static int karsilama()
{
System.out.println("1 ile 8 Arasında Bir Veri Giriniz"+
"n1 - Toplaman"+
"2 - Çıkarman" +
"3 - Çarpman" +
"4 - Bölmen" +
"5 - Modn" +
"6 - Üs Alman" +
"7 - Faktoryeln" +
"8 - Çıkışn" );
Scanner oku=new Scanner(System.in);
int m=oku.nextInt();
if(m<1 || m>8)
System.out.println("Hatalı Giriş Yaptınız");
else
System.out.println("Girdiğiniz Sayı: "+m);
return m;
}
public static void topla(int s1, int s2)
{
System.out.println(s1+" + "+s2+" = "+(s1+s2));
}
public static void cikar(int s1, int s2)
{
System.out.println(s1+" - "+s2+" = "+(s1-s2));
}
public static void carpma(int s1, int s2)
{
System.out.println(s1+" * "+s2+" = "+(s1*s2));
}
public static void bolme(int s1, int s2)
{
System.out.println(s1+" / "+s2+" = "+((double)s1/s2));
}
public static void mod(int s1, int s2)
{
System.out.println(s1+" % "+s2+" = "+(s1%s2));
}
public static int usAlma(int s1, int s2)
{
int us=1;
for (int i=0; i<s2; i++)
us *=s1;
System.out.println(s1+" ^ "+s2+" = "+(us));
return us;
}
public static void fak(int s1)
{
int fak=1;
for(int i=s1; i>0; i--)
fak *=s1;
}
public static void main(String[] args)
{
boolean kontrol=true;
while (kontrol)
{
int z =karsilama();
System.out.println("1. Sayiyi Giriniz:");
Scanner oku=new Scanner(System.in);
int s1=oku.nextInt();
System.out.println("2. Sayiyi Giriniz:");
int s2=oku.nextInt();
switch(z)
{
case 1:topla(s1, s2);
break;
case 2:cikar(s1, s2);
break;
case 3:carpma(s1, s2);
break;
case 4:bolme(s1, s2);
break;
case 5:mod(s1, s2);
break;
case 6:usAlma(s1, s2);
break;
case 7:fak(s1);
break;
case 8: kontrol=false;
break;
default:System.out.println("Yanlış değer girdiniz");
break;
}
}
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team