Java Saved Program: fragrant-home

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
 
/* Name of the class has to be "Script" only */
class Script
{
	public static void main (String[] args)
	{
		System.out.println("Zadatak 1");
		System.out.println("Proizvoljni sadrzaj");
		System.out.println("");
		
		System.out.println("Zadatak 2");
		int broj = 5;
		System.out.println(broj);
		float velikibroj = 45345;
		System.out.println(velikibroj);
		boolean istina = true;
		System.out.println("istina");
		System.out.println("");
		
		System.out.println("Zadatak 3");
		int broj2 = 10;
		float velikibroj2 = 5555;
		boolean laz = false;
		System.out.println("broj2: " + broj2);
		System.out.println("velikibroj2: " + velikibroj2);
		System.out.println("laz: " + laz);
		System.out.println("");
		
		System.out.println("Zadatak 4");
		Scanner skener = new Scanner(System.in);
		int visina;
		int masa;
		System.out.println("Molimo Vas da upisete svoju masu u kilogramima");
		masa = skener.nextInt();
		System.out.println("Molim Vas da unesete svoju visinu u centimetrima");
		visina = skener.nextInt();
		System.out.println("Vasa visina iznosi: " + visina + " cm, a Vasa masa iznosi: " + masa + " kg.");
		System.out.println("");
		
		System.out.println("Bezveze");
		String poruka;
		poruka = skener.nextLine();
		System.out.println(poruka);
		
	}
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs