Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.lang.Math;
- public class Mitternacht {
- public static void main(String[] args)
- {
- double a = 1;
- double b = 2;
- double c = 1;
- double p = b / a;
- double q = c / a;
- double disc = Math.pow(p/2,2) -q;
- if (disc > 0)
- {
- System.out.println("Das Ergebnis für x1 ist: " + ((-p/2) + Math.sqrt((disc)) ));
- System.out.println("Das Ergebnis für x2 ist: " + ((-p/2) - Math.sqrt((disc)) ));
- }
- else if ( disc < 0 )
- {
- System.out.println("Kein Ergebnis");
- }
- else if ( disc == 0 )
- {
- System.out.println("Das Ergebnis x ist: " + (-p/2));
- }
- }
- }
- public class Uhrzeit {
- public static void main(String[]args){
- double std=1;
- double min=36;
- double sek=20;
- System.out.println("Seit Mitternacht sind es " +((std*60*60)+(min*60)+sek) + " Sekunden");
- System.out.println("Die verbleibenden Sekunden vom Tag sind " +(86400 - ((std*60*60)+(min*60)+sek)));
- System.out.printf ("Es sind bereits %,.5f %% des Tages vergangen \n", ((((std*60*60)+(min*60)+sek) / 86400) * 100));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement