Notes
Notes - notes.io |
import java.util.Scanner;
class CircleDemo
{
static Scanner sc = new Scanner(System.in);
public static void main(String args[])
{
System.out.print("Enter the radius: ");
double radius = sc.nextDouble();
//sip = PI*rreze*rreze
double area = Math.PI * (radius * radius);
System.out.println("sip eshte: " + area);
//perimetri = 2*PI*rreze
double circumference= Math.PI * 2*radius;
System.out.println( "Perimetri:"+circumference) ;
}
}
konvertimi i temp nga farfenheight ne celcius
import java.util.*;
class FahrenheitToCelsius {
public static void main(String[] args) {
float temperature;
Scanner in = new Scanner(System.in);
System.out.println("Vendos temp ne farfenheit");
temperature = in.nextInt();
temperature = ((temperature - 32)*5)/9;
System.out.println("temperature ne Celsius = " + temperature);
}
}
MAX I tre NUMRAVE
import java.lang.Math;
import java.util.Scanner;
public class maksimum {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println("Vendos 3 numra: ");
int x = Integer.parseInt(keyboard.nextLine());
int y = Integer.parseInt(keyboard.nextLine());
int z = Integer.parseInt(keyboard.nextLine());
int max = Math.max(x,y);
if(max>y){ //suppose x is max then compare x with z to find max number
max = Math.max(x,z);
}
else{ //if y is max then compare y with z to find max number
max = Math.max(y,z);
}
System.out.println("The max of three is: " + max);
}
}
trego nese nr 9 eshte cift apo tek
import java.util.Scanner;
class tekapocift
{
public static void main(String args[])
{
int x=9;
x = in.nextInt();
if (x % 2 == 0)
System.out.println("The number is even.");
else
System.out.println("The number is odd.");
}
}
Krijo nje program ku te vendosesh emrin e studentit, moshen dhe notat
public class Student{
public String emri;
public int mosha;
public String nota;
/** Constructs a Student object with the given values */
public Student(String emri, int mosha, String nota){
this.emri = emri;
this.mosha = mosha;
this.nota = nota;
this.year = year;
}
public String getEmri(){
return emri;
}
/** Returns the age of this Student */
public int getMosha(){
return mosha;
}
/** Returns the course of this Student */
public String getNota(){
return nota;
}
}
Llotaria
public static void main(String[] args) {
int[] lottery = new int[6];
int randomNum;
for (int i = 0; i < 6; i++) {
randomNum = (int) (Math.random() * 50); // gjenerimi i nje numri random
for (int x = 0; x < i; x++) {
if (lottery[x] == randomNum) // Here, code checks if same random number generated before.
{
randomNum = (int) (Math.random() * 50);// If random number is same, another number generated.
x = -1; // restart the loop
}
}
lottery[i] = randomNum;
}
for (int i = 0; i < lottery.length; i++)
System.out.print(lottery[i] + " ");
}
|
Notes.io is a web-based application for 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 12 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