Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * Beschreibung
- *
- * @version 1.0 vom 14.03.2019
- * @author
- */
- import java.util.*;
- public class Main {
- String[] faecher = {"Deutsch ","Englisch","Geschichte"};
- String notenTypen[] = {"1. Klausur","2. Klausur","schriftliche Note","mündliche Note","Zeugnisnote" };
- double [][] noten = new double[3][3];
- String name;
- String ausgabe = "";
- public void eingabe(){
- Scanner sc = new Scanner(System.in);
- System.out.print("Schuelername: ");
- name = sc.next();
- for (int i = 0;i<faecher.length ;i++ ) {
- System.out.println("Fach:" + faecher[i]);
- for (int j = 0;j<3 ;j++ ) {
- if (j == 2) {
- System.out.print(notenTypen[j+1] + ":");
- noten[i][j] = sc.nextInt();
- }
- else{
- System.out.print(notenTypen[j] + ":");
- noten[i][j] = sc.nextInt();
- }
- } // end of for
- } // end of for
- }
- public void verarbeitung(){
- ausgabe += "\t\t\t\t";
- for (int j = 0; j<faecher.length ;j++ ) {
- ausgabe += faecher[j] + "\t";
- }
- ausgabe += "\n";
- for (int i = 0;i < faecher.length ;i++ ) {
- ausgabe += notenTypen[i];
- for (int j = 0; j<3 ;j++ ) {
- ausgabe += " \t\t" + noten[i][j] + " ";
- } // end of for
- ausgabe += "\n";
- } // end of for
- ausgabe += notenTypen[3]+"\t";
- for (int i = 0;i < faecher.length;i++){
- ausgabe +=" \t\t"+noten[i][2] + " ";
- }
- ausgabe += "\n" + notenTypen[4]+"\t";
- for (int i = 0;i < faecher.length;i++){
- ausgabe +=" \t\t"+ (noten[i][2] / ((noten[i][1] + noten[i][0] )* 0.5)) + " ";
- }
- System.out.println(ausgabe);
- }
- public static void main(String[] args) {
- Main nt = new Main();
- nt.eingabe();
- nt.verarbeitung();
- } // end of main
- } // end of class Note
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement