6.4.. Za upisanu stranicu kocke izračunati obim kocke.

Listing programa :

// 06411062
import java.util.Scanner;

public class P06411062 {
	public static void main(String[] args)	{
	Scanner input = new Scanner (System.in);
    System.out.print("Vrijednost stranice kocke ");
    int a = input.nextInt();
    System.out.println("Obim je " + 12*a);
}}
II Varijanta
// 06411062
import java.util.Scanner;

public class P06411062 {
	public static void main(String[] args)	{
	Scanner input = new Scanner (System.in);
    System.out.print("Vrijednost stranice kocke ");
    int a = input.nextInt();
    double o= 12*a ;
    System.out.print("obim kocke je " +o);
}}

Ispis na ekranu:

Index