de.thaw.ps1.blatt1
Class Aufgabe1_4

java.lang.Object
  extended by de.thaw.ps1.blatt1.Aufgabe1_4

public class Aufgabe1_4
extends Object

Blatt 1, Aufgabe 4: Fakultät berechnen.

See Also:
1. Übungsblatt PS1

Constructor Summary
Aufgabe1_4()
           
 
Method Summary
static long faculty(long number)
          Berechnet die Fakultät einer Zahl.
static void main(String[] args)
          Liest eine Zahl ein und gibt deren Fakultät aus.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Aufgabe1_4

public Aufgabe1_4()
Method Detail

faculty

public static long faculty(long number)
Berechnet die Fakultät einer Zahl. Die Zahl, deren Fakultät berechnet werden soll, darf nicht negativ sein, da Fakultäten nicht für negative Zahlen definiert sind.

Parameters:
number - Die Zahl, deren Fakultät berechnet werden soll.
Returns:
Die berechnete Fakultät.
Throws:
NegativeArgumentException - falls number negativ ist.

main

public static void main(String[] args)
Liest eine Zahl ein und gibt deren Fakultät aus.