├── tic-tac-toe ├── win.png ├── README.md └── tic_tac_toe.py ├── chatbot-blumen-verkaufer ├── chatbot.png ├── README.md └── chatbot.py └── softwareDevelopment1 ├── dcoder ├── README.md └── Dcoder.java ├── canteen ├── README.md └── CanteenSL.java ├── beachBot ├── README.md └── BeachBot.java └── sleepingHours ├── README.md └── sleepingHours.java /tic-tac-toe/win.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drFabio/Munich-Demo-Day-Spring-2020/master/tic-tac-toe/win.png -------------------------------------------------------------------------------- /chatbot-blumen-verkaufer/chatbot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drFabio/Munich-Demo-Day-Spring-2020/master/chatbot-blumen-verkaufer/chatbot.png -------------------------------------------------------------------------------- /softwareDevelopment1/dcoder/README.md: -------------------------------------------------------------------------------- 1 | # Dcoder 2 | 3 | By Abraham Festus 4 | 5 | ### Example 6 | 7 | ``` 8 | Java Calculator 9 | Enter First Number: 10 | 1 11 | Enter Second Number: 12 | 3 13 | Enter operator(+,-,×,÷): 14 | - 2 15 | ``` 16 | -------------------------------------------------------------------------------- /tic-tac-toe/README.md: -------------------------------------------------------------------------------- 1 | This project was executed by students Rafaela and Silva from the Digital Women's Program for the course Intro to Programming and supervised by teachers Paula and Mariem. 2 | The tic tac toe game has been modeled in a way that allows two persons to play with each other. 3 | The programming language used is python. 4 | Here is an example after playing a few rounds: 5 | 6 | 7 | ![Example of a winning player](https://github.com/ReDI-School/Munich-Demo-Day-Spring-2020/blob/master/tic-tac-toe/win.png?raw=true) 8 | -------------------------------------------------------------------------------- /chatbot-blumen-verkaufer/README.md: -------------------------------------------------------------------------------- 1 | This project was executed by students Joy and Nadia from the Digital Women's Program for the course Intro to Programming and supervised by teachers Laura and Magdalena. 2 | The chatbot allows a customer to order flowers. 3 | The programming language used is python. 4 | Here is an example of communication between the customer and the chatbot: 5 | 6 | 7 | ![Example of a communication with the chatbot](https://github.com/ReDI-School/Munich-Demo-Day-Spring-2020/blob/master/chatbot-blumen-verkaufer/chatbot.png?raw=true) 8 | -------------------------------------------------------------------------------- /softwareDevelopment1/canteen/README.md: -------------------------------------------------------------------------------- 1 | # Canteen 2 | 3 | By Slobodan Loncar 4 | 5 | ## Example 6 | 7 | ``` 8 | Welcome to Canteen, please add some credit on your Canteen Card! 9 | 100 10 | 11 | \_**\_TODAY'S MENU\_\_** 12 | 13 | 0.Beef steak......7.5\$ 14 | 15 | 1.Pasta......6.0\$ 16 | 17 | 2.Chicken nuggets......5.0\$ 18 | 19 | 3.Burger......4.0\$ 20 | 21 | 4.Pizza......4.0\$ 22 | 23 | 5.Salad......3.5\$ 24 | 25 | 6.Coca-Cola......2.0\$ 26 | 27 | 7.Water......1.5\$ 28 | 29 | Pick the item number for making your order! (for submitting or quiting type 10) 30 | 6 31 | Coca-Cola......2.0$ 32 | Enter quantity: 33 | 2 34 | Your order costs: 2 x Coca-Cola(2.0$) = 4.0\$ 35 | 36 | Pick the item number for making your order! (for submitting or quiting type 10) 37 | 4 38 | Pizza......4.0$ 39 | Enter quantity: 40 | 1 41 | Your order costs: 1 x Pizza(4.0$) = 4.0\$ 42 | 43 | Pick the item number for making your order! (for submitting or quiting type 10) 44 | 10 45 | Your order has been placed! Your new card balance is: 92.0\$ 46 | ``` 47 | -------------------------------------------------------------------------------- /softwareDevelopment1/beachBot/README.md: -------------------------------------------------------------------------------- 1 | # Beach Bot 2 | 3 | by Dubravka Ilijasevic and Marjana Znideric. 4 | 5 | ## Example 6 | 7 | ``` 8 | Welcome to BeachBot. What is your name? 9 | JohnDoe 10 | Hi JohnDoe, let us find out your Body Mass Index. 11 | Please enter your weight in kg: 12 | 90 13 | Please enter your height in meters: 14 | 1.7 15 | Your BMI is 31.14186851211073. 16 | You are overweight!!! Start burning calories!!! 17 | Do you want to stay fit? 18 | yes 19 | Which exercises will you do today? 20 | squats 21 | Nice, squats 1 what else? 22 | squats 23 | Nice, squats 2 what else? 24 | squats 25 | Nice, squats 3 what else? 26 | push up 27 | Nice, push up 1 what else? 28 | running 29 | Nice, running 1 what else? 30 | jogging 31 | Nice, jogging 1 what else? 32 | done 33 | Here is the list of exercises you are planning to do today: 34 | 35 | - #1 : squats x (3) 36 | - #2 : push up x (1) 37 | - #3 : running x (1) 38 | - #4 : jogging x (1) 39 | 40 | You could do better!! 41 | Here are some additional exericises for you: 42 | 20 push-ups, 20 pull-ups and 20 squats!! 43 | ``` 44 | -------------------------------------------------------------------------------- /softwareDevelopment1/dcoder/Dcoder.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.util.Scanner; 3 | 4 | // Compiler version JDK 11.0.2 5 | 6 | class Dcoder 7 | { 8 | public static void main(String args[]) 9 | { 10 | 11 | System.out.println(" Java Calculator "); 12 | // Declairing input numbers as floats 13 | 14 | float num1; 15 | float num2; 16 | String operator; 17 | // making scanner 18 | 19 | Scanner in = new Scanner(System.in); 20 | 21 | // taking input from user 22 | 23 | System.out.println(" Enter First Number: "); 24 | num1 = in.nextFloat(); 25 | System.out.println(" Enter Second Number: "); 26 | num2 = in.nextFloat(); 27 | //T The int.nextLine(); is used as java ignores operator input 28 | in.nextLine(); 29 | System.out.println(" Enter operator(+,-,×,÷): "); 30 | operator = in.nextLine(); 31 | 32 | // making if statements 33 | 34 | if (operator.equals("+")){ 35 | System.out.println(num1 + num2); 36 | }else if (operator.equals("-")){ 37 | System.out.println(num1 - num2); 38 | }else if (operator.equals("×")){ 39 | System.out.println(num1 * num2); 40 | }else if (operator.equals("÷")){ 41 | System.out.println(num1 / num2); 42 | }else { 43 | System.out.println(" Invalid Operator or Input "); 44 | } 45 | 46 | 47 | 48 | 49 | } 50 | } -------------------------------------------------------------------------------- /tic-tac-toe/tic_tac_toe.py: -------------------------------------------------------------------------------- 1 | # Umgebung 2 | x= ["*"," ", "*", " ","*"," ", "*"," ", "*", " ","*"," ", "*","\n"] 3 | y1= ["*"," ", "."," ", "*"," ","."," ", "*"," ", "."," ", "*","\n"] 4 | y2= ["*"," ", "."," ", "*"," ","."," ", "*"," ", "."," ", "*","\n"] 5 | y3= ["*"," ", "."," ", "*"," ","."," ", "*"," ", "."," ", "*","\n"] 6 | 7 | print(''.join(x)) 8 | print(''.join(y1)) 9 | print(''.join(y2)) 10 | print(''.join(y3)) 11 | print(''.join(x)) 12 | 13 | # Beginn der Spiel 14 | Spieler = "1" 15 | 16 | for i in range (0,9): 17 | #Frage an Benutzer 18 | frage1 = int(input(" Welche Liste moechte sie aenderen?")) 19 | frage2 = int(input(" Welche Stelle moechte sie aenderen?")) 20 | 21 | #Welche Spieler 22 | if Spieler == "1": 23 | mark = "X" 24 | Spieler = "2" 25 | else: 26 | mark = "O" 27 | Spieler = "1" 28 | 29 | #Grid Aenderung 30 | if frage1==1: 31 | y1[frage2] = mark 32 | elif frage1==2: 33 | y2[frage2] = mark 34 | else: 35 | y3[frage2] = mark 36 | 37 | #Zeige geaenderte Umgebung 38 | print(''.join(x)) 39 | print(''.join(y1)) 40 | print(''.join(y2)) 41 | print(''.join(y3)) 42 | print(''.join(x)) 43 | 44 | #Ueberpruefung 45 | #Waagerecht 46 | if y1[2] == y1[6] == y1[10] == "X" or y2[2] == y2[6] == y2[10] == "X" or y3[2] == y3[6] == y3[10] == "X": 47 | print('Spieler 1 hat gewonnen!') 48 | break 49 | elif y1[2] == y1[6] == y1[10] == "O" or y2[2] == y2[6] == y2[10] == "O" or y3[2] == y3[6] == y3[10] == "O": 50 | print('Spieler 2 hat gewonnen!') 51 | break 52 | 53 | #Senkrecht 54 | if y1[2] == y2[2] == y3[2] == "X" or y1[6] == y2[6] == y3[6] == "X" or y1[10] == y2[10] == y3[10] == "X": 55 | print('Spieler 1 hat gewonnen!') 56 | break 57 | elif y1[2] == y2[2] == y3[2] == "O" or y1[6] == y2[6] == y3[6] == "O" or y1[10] == y2[10] == y3[10] == "O": 58 | print('Spieler 2 hat gewonnen!') 59 | break 60 | 61 | #Diagonal 62 | if y1[2]==y2[6]==y3[10]=="X" or y1[10]==y2[6]==y3[2]=="X": 63 | print('Spieler 1 hat gewonnen!') 64 | break 65 | elif y1[2]==y2[6]==y3[10]=="O" or y1[10]==y2[6]==y3[2]=="O": 66 | print('Spieler 2 hat gewonnen!') 67 | break 68 | -------------------------------------------------------------------------------- /softwareDevelopment1/sleepingHours/README.md: -------------------------------------------------------------------------------- 1 | # Sleeping hours 2 | 3 | By Eman Anwer abdelgawwad 4 | 5 | ## Example 6 | 7 | ``` 8 | Welcome in sleeping hours tracker 9 | heey, did you know that the best sleeping hours are 7 hours per day for adults 10 | please enter you planned hours of sleeping to track 11 | 7 12 | great now let us track it together 13 | Cheer up it is Monday. charge the battery and be full of enthusiasm 14 | please enter how many hours you slept today 15 | 5 16 | you slept less than it is planned try to adjust it next time 17 | 18 | ************************************************ 19 | 20 | Cheer up it is tuesday. we are still with full of enthusiasm 21 | please enter how many hours you slept today 22 | 4 23 | you slept less than it is planned try to adjust it next time 24 | 25 | ************************************************ 26 | 27 | Cheer up it is Wednesday.the battery still full and we can do it 28 | please enter how many hours you slept today 29 | 8 30 | you slept more than it is planned try to reduce it next time 31 | 32 | ************************************************ 33 | 34 | it is Thursday. wish you a colorful sunny day 35 | please enter how many hours you slept today 36 | 8 37 | you slept more than it is planned try to reduce it next time 38 | 39 | ************************************************ 40 | 41 | Friday. you can do it this week 42 | please enter how many hours you slept today 43 | 8 44 | you slept more than it is planned try to reduce it next time 45 | 46 | ************************************************ 47 | 48 | youpiiii ..it is saturday. wish you a nice weekend.keep the balance to get the habit. 49 | please enter how many hours you slept today 50 | 8 51 | you slept more than it is planned try to reduce it next time 52 | 53 | ************************************************ 54 | 55 | smile last day of the week..it is sunday.keep the balance to get the habit and learn from the mistakes 56 | please enter how many hours you slept today 57 | 8 58 | you slept more than it is planned try to reduce it next time 59 | 60 | ************************************************ 61 | 62 | {Monday=5.0, Friday=8.0, Sunday=8.0, Wednesday=8.0, thursday=8.0, Tuesday=4.0, Saturday=8.0} 63 | the percentage of your actual sleeping hours up to target is as here declared 64 | {Monday=71.42857142857143, Friday=114.28571428571428, Sunday=114.28571428571428, Wednesday=114.28571428571428, thursday=114.28571428571428, Tuesday=57.14285714285714, Saturday=114.28571428571428} 65 | total percentage of slept hours up to the target100.0 66 | total percentage of slept hours up to the whole week hours29.166666666666668 67 | ``` 68 | -------------------------------------------------------------------------------- /softwareDevelopment1/canteen/CanteenSL.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class CanteenSL { 4 | static double cardBalance; 5 | static Scanner scan; 6 | public static void main(String[] args) { 7 | scan = new Scanner(System.in); 8 | getCardBalance(); 9 | Double costOfOrder = ordering(); 10 | if (canUserPay(costOfOrder)) { 11 | cardBalance -= costOfOrder; 12 | System.out.println("Your order has been placed! Your new card balance is: " + cardBalance + "$"); 13 | } else { 14 | System.out.println("Sorry, you don't have enough money, order will not be placed. Bye!"); 15 | } 16 | } 17 | public static boolean canUserPay(double orderCost) { 18 | if (orderCost <= cardBalance) { 19 | return true; 20 | } 21 | double remainder = (orderCost - cardBalance); 22 | System.out.println("You don't have enough money, would you like to add extra " + remainder + "$" + "?" + "(type YES/NO)"); 23 | String addToBalance = scan.nextLine().toLowerCase(); 24 | if (addToBalance.equals("yes")) { 25 | cardBalance += remainder; 26 | return true; 27 | } 28 | return false; 29 | } 30 | public static double ordering() { 31 | String menu[] = { 32 | "Beef steak", 33 | "Pasta", 34 | "Chicken nuggets", 35 | "Burger", 36 | "Pizza", 37 | "Salad", 38 | "Coca-Cola", 39 | "Water" 40 | }; 41 | double prizes[] = { 42 | 7.50, 43 | 6.00, 44 | 5.00, 45 | 4.00, 46 | 4.00, 47 | 3.50, 48 | 2.00, 49 | 1.50 50 | }; 51 | double costsOfOrder = 0; 52 | System.out.println("\n____TODAY'S MENU____"); 53 | for (int i = 0; i < menu.length; i++) { 54 | System.out.println("\n" + i + "." + menu[i] + "......" + prizes[i] + "$"); 55 | } 56 | while (true) { 57 | System.out.println("\nPick the item number for making your order! (for submitting or quiting type 10)"); 58 | int choice = Integer.parseInt(scan.nextLine()); 59 | if (choice < menu.length) { 60 | System.out.println(menu[choice] + "......" + prizes[choice] + "$"); 61 | costsOfOrder += getTotal(getQuantity(), prizes, choice, menu); 62 | } else if (choice != menu.length && choice != 10) { 63 | System.out.println("Please type right number of your item or type 10 for quiting!"); 64 | } else if (choice == 10) { 65 | break; 66 | } 67 | } 68 | return costsOfOrder; 69 | } 70 | public static double getCardBalance() { 71 | System.out.println("Welcome to Canteen, please add some credit on your Canteen Card!"); 72 | cardBalance = Double.parseDouble(scan.nextLine()); 73 | return cardBalance; 74 | } 75 | public static int getQuantity() { 76 | System.out.println("Enter quantity: "); 77 | int quantity = Integer.parseInt(scan.nextLine()); 78 | return quantity; 79 | } 80 | public static double getTotal(int getQuantity, double prizes[], int choice, String menu[]) { 81 | double total = getQuantity * prizes[choice]; 82 | System.out.println("Your order costs: " + getQuantity + " x " + menu[choice] + "(" + prizes[choice] + "$" + ")" + " = " + total + "$"); 83 | return total; 84 | } 85 | } -------------------------------------------------------------------------------- /chatbot-blumen-verkaufer/chatbot.py: -------------------------------------------------------------------------------- 1 | # Variablen 2 | liste_schnittblumen = ["Rosen", "Tulpen", "Sonnenblumen"] 3 | preisliste_schnittblumen = [10,12,14] 4 | 5 | liste_gartenpflanzen = ["Pfingstrosen", "Sonnenblumen", "Geranien"] 6 | preisliste_gartenpflanzen = [20,30,40] 7 | 8 | liste_farben = ['rot', 'weiß', 'gelb', 'blau'] 9 | liste_groesse = ['gross', 'klein'] 10 | liste_anlaesse = ['Geburtstag', 'Valentinstag', 'Muttertag', 'Trauertag'] 11 | liste_liefern_zeit = ['Mo 10-6', 'Di 10-4', 12 | 'Mi 9-13', 'Do 10-15', 13 | 'Fr 9-14', 'Sa 8-12', 14 | 'Feiertag 10-12'] 15 | 16 | fehl_eingabe = "not error" 17 | 18 | ### Begrüßung 19 | print ('Hallo') 20 | 21 | ### Welche Blumen? 22 | print('Welche Blumen moechten Sie bestellen? Schnittblumen oder Gartenpflanzen?') 23 | pflanzenart = input('Wähle zwischen 1 und 2: ') 24 | 25 | if pflanzenart == "1": 26 | print('Okay, Sie möchten Schnittblumen') 27 | print("Welche Schnittblumen möchtest Du bestellen? ") 28 | print(liste_schnittblumen) 29 | auswahl_blumen = input("Wähle zwischen 1-3: ") 30 | int_index = int(auswahl_blumen)-1 31 | print('Okay, Sie möchten', liste_schnittblumen[int_index]) 32 | preis_blumen = preisliste_schnittblumen[int_index] 33 | 34 | print('Der Preis beträgt',preis_blumen,'€') 35 | 36 | elif pflanzenart == "2": 37 | print('Okay, Sie möchten Gartenpflanzen') 38 | print("Welche Gartenpflanzen moechtest Du bestellen?") 39 | print(liste_gartenpflanzen) 40 | auswahl_blumen = input("Wähle zwischen 1-3: ") 41 | int_index = int(auswahl_blumen)-1 42 | print('Okay, Sie möchten', liste_gartenpflanzen[int_index]) 43 | preis_blumen = preisliste_gartenpflanzen[int_index] 44 | 45 | print('Der Preis beträgt',preis_blumen,'€') 46 | 47 | else: 48 | fehl_eingabe = 'error' 49 | print('Wir haben leider nur Schnittblumen oder Gartenpflanzen') 50 | 51 | ### Welche Farben & Größe? 52 | if fehl_eingabe == 'error': 53 | print('Error') 54 | 55 | else: 56 | print('Welche Farbe sollen die Blumen haben?') 57 | print('Wir haben diese Farben: ', liste_farben) 58 | eingabe_farbe = input('Wähle zwischen 1-4: ') 59 | int_index = int(eingabe_farbe)-1 60 | farbe = liste_farben[int_index] 61 | print('Du möchtest Blumen in der Farbe: ', farbe) 62 | print('Welche Größe des Strauss?', liste_groesse, '?') 63 | groesse = input('gross oder klein?') 64 | print('Du möchtest den Strauss', groesse) 65 | 66 | if groesse == "gross": 67 | groessen_faktor = 1.5 68 | elif groesse == "klein": 69 | groessen_faktor = 1 70 | 71 | ### Anlass der Blumen 72 | print('Zu welchem Anlass möchten Sie die Blumen?') 73 | print(liste_anlaesse) 74 | eingabe_anlass = input('Wähle zwischen 1 bis 4 aus: ') 75 | 76 | anlass = liste_anlaesse[int(eingabe_anlass) - 1] 77 | 78 | print('OK, Sie haben', anlass, 'gewählt') 79 | 80 | ### Lieferung 81 | ArtDerLieferung=input ('Möchten Sie die Blumen abholden oder liefern?') 82 | print('OK, Sie möchten', ArtDerLieferung) 83 | 84 | if ArtDerLieferung == 'abholen': 85 | lieferkosten = 0 86 | print('OK, Sie können die Blumen zwischen 9 und 17 Uhr abholen') 87 | 88 | elif ArtDerLieferung == 'liefern': 89 | lieferkosten = 4.0 90 | print('ok. wenn sollte es geliefert werden') 91 | print ('Wir haben diese Lieferzeit:') 92 | print(liste_liefern_zeit) 93 | eingabe_liefern_zeit = input('Wähle zwischen 1-7') 94 | int_index = int(eingabe_liefern_zeit)-1 95 | Liefern_zeit = liste_liefern_zeit[int_index] 96 | print('Du möchtest liefern in der liefern Zeit: ', Liefern_zeit) 97 | 98 | ### Berechnung der Kosten 99 | Gesamtpreis = (preis_blumen * groessen_faktor) + lieferkosten 100 | print('Vielen Dank für Ihre Bestellung. Ihre Blumen kosten',Gesamtpreis,'€.') 101 | 102 | ### Verabschiedung 103 | print ('Bis zum naechsten Mal') 104 | -------------------------------------------------------------------------------- /softwareDevelopment1/beachBot/BeachBot.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.Scanner; 3 | import java.util.HashMap; 4 | 5 | class BeachBot { 6 | 7 | public static String calculateBMI(double weight, double height) { 8 | 9 | String index = " "; 10 | double bmi = weight / (height * height); 11 | if (bmi > 0 && bmi < 18.5) { 12 | index = "Your BMI is " + bmi + ". \nYou are light as a feather. Summer wind might blow you away."; 13 | } else if (bmi > 18.5 && bmi < 25.00 ) { 14 | index = "Your BMI is " + bmi + ". \nPerfect!! You are ready for the beach!!! Have fun!!!"; 15 | } else { 16 | index = "Your BMI is " + bmi + ". \nYou are overweight!!! Start burning calories!!!"; 17 | } 18 | return index; 19 | } 20 | 21 | public static void main(String args[]) { 22 | Scanner sc = new Scanner(System.in); 23 | System.out.println("Welcome to BeachBot. What is your name?"); 24 | String name = sc.nextLine(); 25 | System.out.println("Hi "+ name + ", let us find out your Body Mass Index."); 26 | 27 | double weight = 0; 28 | double height = 0; 29 | System.out.println("Please enter your weight in kg: "); 30 | weight = sc.nextDouble(); 31 | System.out.println("Please enter your height in meters: "); 32 | height = sc.nextDouble(); 33 | sc.nextLine(); 34 | System.out.println(calculateBMI(weight,height)); 35 | while (true) { 36 | System.out.print("Do you want to stay fit?\n"); 37 | String answer = sc.nextLine(); 38 | if (answer.toLowerCase().strip().equals("yes")) { 39 | break; 40 | } 41 | } 42 | ArrayList list = new ArrayList(); 43 | HashMap listHashMap = new HashMap(); 44 | boolean isDone = false; 45 | String exercise = ""; 46 | while(!isDone) { 47 | boolean islistEmpty = list.size() == 0; 48 | if (islistEmpty) { 49 | System.out.println("Which exercises will you do today?"); 50 | } else { 51 | 52 | String lastAddedExercise = exercise; 53 | int quantity = listHashMap.get(lastAddedExercise); 54 | System.out.println("Nice, "+lastAddedExercise+" "+quantity+" what else?"); 55 | } 56 | 57 | exercise = sc.nextLine(); 58 | String anyCaseexercise = exercise.toLowerCase(); 59 | if (anyCaseexercise.equals("done") || 60 | anyCaseexercise.equals("nothing else") || 61 | anyCaseexercise.equals("finish")) 62 | { 63 | isDone = true; 64 | } else { 65 | boolean isAlreadyOnTheList = listHashMap.containsKey(exercise); 66 | if (isAlreadyOnTheList) { 67 | 68 | int previousExercise = listHashMap.get(exercise); 69 | int newExercise = previousExercise +1; 70 | 71 | listHashMap.put(exercise, newExercise); 72 | } else { 73 | list.add(exercise); 74 | listHashMap.put(exercise, 1); 75 | } 76 | } 77 | } 78 | System.out.println("Here is the list of exercises you are planning to do today:\n"); 79 | int numberOfexercises = list.size(); 80 | for (int i = 0; i < numberOfexercises;i++) { 81 | String lastAddedExercise = list.get(i); 82 | Integer quantity = listHashMap.get(lastAddedExercise); 83 | System.out.println(" - #"+(i+1)+" : "+lastAddedExercise+" x ("+quantity+")"); 84 | } 85 | if (numberOfexercises > 5) { 86 | System.out.println("\nGreat!! Calories will be melting!!\n"); 87 | } else { 88 | System.out.println("\nYou could do better!! \nHere are some additional exercises for you: \n20 push-ups, 20 pull-ups and 20 squats!!\n"); 89 | 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /softwareDevelopment1/sleepingHours/sleepingHours.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | import java.util.*; 3 | public class sleepingHours { 4 | static Scanner userWish; 5 | 6 | public static void main(String[] args) { 7 | userWish=new Scanner(System.in); 8 | System.out.println(" Welcome in sleeping hours tracker"); 9 | System.out.println(" heey, did you know that the best sleeping hours are 7 hours per day for adults"); 10 | System.out.println(" please enter you planned hours of sleeping to track"); 11 | double sleepingHoursTarget = userWish.nextDouble(); 12 | userWish.nextLine(); 13 | System.out.println(" great now let us track it together"); 14 | double actualSleepingMonday=monday(sleepingHoursTarget); 15 | double actualSleepingTuesday=tuesday(sleepingHoursTarget); 16 | double actualSleepingWednesday=wednesday(sleepingHoursTarget); 17 | double actualSleepingThursday=thursday(sleepingHoursTarget); 18 | double actualSleepingFriday=friday(sleepingHoursTarget); 19 | double actualSleepingSaturday=saturday(sleepingHoursTarget); 20 | double actualSleepingSunday=sunday(sleepingHoursTarget); 21 | double actualSum=actualSleepingMonday+actualSleepingTuesday+actualSleepingWednesday+actualSleepingThursday+actualSleepingFriday+actualSleepingSaturday+actualSleepingSunday; 22 | String [] days={"Monday","Tuesday","Wednesday","thursday","Friday","Saturday","Sunday"}; 23 | double[] actualHours={actualSleepingMonday,actualSleepingTuesday,actualSleepingWednesday,actualSleepingThursday,actualSleepingFriday,actualSleepingSaturday,actualSleepingSunday}; 24 | HashMap actual=new HashMap(); 25 | for (int i=0;i percentage=new HashMap(); 35 | for (int i=0;isleepingHoursTarget) { 55 | System.out.println("you slept more than it is planned try to reduce it next time"); 56 | } 57 | if (sleepingHoursMondaysleepingHoursTarget) { 73 | System.out.println("you slept more than it is planned try to reduce it next time"); 74 | } 75 | if (sleepingHoursTuesday sleepingHoursTarget) { 91 | System.out.println("you slept more than it is planned try to reduce it next time"); 92 | } 93 | if (sleepingHoursWednesday sleepingHoursTarget) { 109 | System.out.println("you slept more than it is planned try to reduce it next time"); 110 | } 111 | if (sleepingHoursThursday sleepingHoursTarget) { 127 | System.out.println("you slept more than it is planned try to reduce it next time"); 128 | } 129 | if (sleepingHoursFriday sleepingHoursTarget) { 145 | System.out.println("you slept more than it is planned try to reduce it next time"); 146 | } 147 | if (sleepingHoursSaturday sleepingHoursTarget) { 163 | System.out.println("you slept more than it is planned try to reduce it next time"); 164 | } 165 | if (sleepingHoursSunday