My favorites
▼
|
Sign in
lineadecodigo
Web Code Samples in spanish
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
lineadecodigo_java
/
src
/
com
/
lineadecodigo
/
java
/
math
/
VolumenCubo.java
r478
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.lineadecodigo.java.math;
/**
* @file VolumenCubo.java
* @version 1.0
* @author Linea de Codigo (http://lineadecodigo.com)
* @date 21-septiembre-2009
* @url http://lineadecodigo.com/java/calcular-el-volumen-de-un-cubo-con-java/
* @description Ejemplo que calcula el volumen de un cubo con Java.
*/
import java.util.Scanner;
public class VolumenCubo {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
double iArista;
double iVolumen;
System.out.println("Introduce el valor de la arista del cubo");
iArista = reader.nextDouble();
iVolumen = Math.pow(iArista, 3);
System.out.println("El volumen de un cubo de arista " + Double.toString(iArista) + " es de " + Double.toString(iVolumen));
}
}
Show details
Hide details
Change log
r181
by vcuervo on Sep 21, 2009
Diff
Volumen de un cubo en Java
Go to:
...odigo/java/math/VolumenCubo.java
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 812 bytes, 32 lines
View raw file
Powered by
Google Project Hosting