Visar inlägg med etikett Java program. Visa alla inlägg
Visar inlägg med etikett Java program. Visa alla inlägg

fredag 13 januari 2012

Min första egen Java app!

13 januari 2012


Jippi! Jag har lyckas skriva en egen fungerande Java app! Här är koden:
"

/* This is another scale program.
* This time I aim to convert from fot to cm.
* To keep things simple, one foot equels thirty cm
* So the value of 1 foot should = 30 cm or 1 = 30
* Author: Leopold H. Birkholm
* Date: January 13:th 2012
* Homepage: http://leopoldbirkholm.blogspot.com/
* Support java app: Keyboard.java
*/

public class FootToCM{

public static void main(String[] args){
System.out.println("\nHello and welcome to the program Foot to CM\n");
System.out.print("Please, enter value of foot here: \t ");
int tal1 = Keyboard.readInt();
int tal2 = tal1*30;
System.out.println("\nThe value is in cm:\t" + tal2);
System.out.println("\nNo more function is present.\n\nThank you and have a pleasent day.\n");
}
}
"
Så här ser det ut när man kör programmet:
//Leopold