/***************************************************************/ /* Verfasser: Prof. Dr. Gregor Büchel */ /* Source : MessAnw1.java */ /* Zweck : Verarbeitung einer Messreihe (Spannungsmessung) */ /* Stand : 15.11.2013 */ /***************************************************************/ import java.io.*; class MessAnw1 { public static void main(String args[]) {double messw[], mima[], amw, rohm, strom[]; int i,n; System.out.println("Wieviele Spannungswerte erwarten Sie?"); n=einnat(); messw=einSpannFolge(n); System.out.println("Die Folge der Spannungswerte:"); wFolgeAus(messw); amw=mittel(messw); System.out.println("Das arithmetische Mittel: "+amw); mima=minmax(messw); System.out.println("Minimum: "+mima[0]+" Maximum: "+mima[1]); System.out.println("Welcher Widerstand liegt vor?"); rohm=IO1.eindouble(); strom=ohmschGesetz(messw,rohm); System.out.println("Die Folge der Stromstaerken:"); wFolgeAus(strom); } static int einnat() {int m; do {System.out.println("Eingabe einer ganzen Zahl m > 0:"); m=IO1.einint(); if (m<=0) System.out.println("Fehler: Ihre Zahl ist: "+m+" <=0 !"); } while (m<1); return m; } static double[] einSpannFolge(int n) {double u[]; int i; u=new double[n]; for (i=0; imima[1]) mima[1]=x[i]; } return mima; } static double[] ohmschGesetz(double x[], double rohm) {double st[]; int i,n; n=x.length; st=new double[n]; for (i=0; i