Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. /**
  2. *
  3. * Beschreibung
  4. *
  5. * @version 1.0 vom 14.03.2019
  6. * @author
  7. */
  8. import java.util.*;
  9. public class Main {
  10. String[] faecher = {"Deutsch ","Englisch","Geschichte"};
  11. String notenTypen[] = {"1. Klausur","2. Klausur","schriftliche Note","mündliche Note","Zeugnisnote" };
  12. double [][] noten = new double[3][3];
  13. String name;
  14. String ausgabe = "";
  15.  
  16. public void eingabe(){
  17. Scanner sc = new Scanner(System.in);
  18. System.out.print("Schuelername: ");
  19. name = sc.next();
  20. for (int i = 0;i<faecher.length ;i++ ) {
  21. System.out.println("Fach:" + faecher[i]);
  22. for (int j = 0;j<3 ;j++ ) {
  23. if (j == 2) {
  24. System.out.print(notenTypen[j+1] + ":");
  25. noten[i][j] = sc.nextInt();
  26. }
  27. else{
  28. System.out.print(notenTypen[j] + ":");
  29. noten[i][j] = sc.nextInt();
  30. }
  31.  
  32. } // end of for
  33. } // end of for
  34. }
  35. public void verarbeitung(){
  36. ausgabe += "\t\t\t\t";
  37. for (int j = 0; j<faecher.length ;j++ ) {
  38. ausgabe += faecher[j] + "\t";
  39. }
  40. ausgabe += "\n";
  41.  
  42. for (int i = 0;i < faecher.length ;i++ ) {
  43. ausgabe += notenTypen[i];
  44.  
  45. for (int j = 0; j<3 ;j++ ) {
  46. ausgabe += " \t\t" + noten[i][j] + " ";
  47. } // end of for
  48. ausgabe += "\n";
  49. } // end of for
  50.  
  51. ausgabe += notenTypen[3]+"\t";
  52.  
  53. for (int i = 0;i < faecher.length;i++){
  54. ausgabe +=" \t\t"+noten[i][2] + " ";
  55.  
  56. }
  57. ausgabe += "\n" + notenTypen[4]+"\t";
  58.  
  59. for (int i = 0;i < faecher.length;i++){
  60. ausgabe +=" \t\t"+ (noten[i][2] / ((noten[i][1] + noten[i][0] )* 0.5)) + " ";
  61.  
  62. }
  63. System.out.println(ausgabe);
  64. }
  65. public static void main(String[] args) {
  66. Main nt = new Main();
  67. nt.eingabe();
  68. nt.verarbeitung();
  69. } // end of main
  70.  
  71. } // end of class Note
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement