import java.util.Scanner; //importing scanning library
int date = 0; //variable for date of brith


public class astrologicalSign { 

    public static void main(String[] args) {
    
    Scanner input = new Scanner(System.in); //function needed for scanning

    System.out.println("https://www.allure.com/story/zodiac-sign-personality-traits-dates is the source for all this info");

while(true) { //in a while loop, if correct input given then break from loop.if date between certain numbers, then prints out sign and info regarding it
    System.out.println("Please enter the Month and day that you were born! Example - March 31st = 331"); //entering date of birth
    int date = input.nextInt(); //scanns input

    if (date >= 321 && date <= 419) { //if between March 21 and April 19
        System.out.println("Congratulations, you are a Aries!");
        System.out.println("Represented by ram,loves to be on top, Bold and ambitious!");
        break;
    }
    else if (date >= 420 && date <= 520) { //if between April 20 and May 20
        System.out.println("Congratulations, you are a Taurus!");
        System.out.println("Represented by bull, loves luxury and comfort");
        break;
    }
    else if (date >= 521 && date <= 620) { //if between May 21 and June 20
        System.out.println("Congratulations, you are a Gemini!");
        System.out.println("Represented by Castor and Pollox, playful,spontaneous,curious");
        break;
    }
    else if (date >= 621 && date <= 722) { //if between June 21 and July 22
        System.out.println("Congratulations, you are a Cancer!");
        System.out.println("Represented by crab, emotionally invested and protective");
        break;
    }
    else if (date >= 723 && date <= 822) { //if between July 23 and August 22
        System.out.println("Congratulations, you are a Leo!");
        System.out.println("Represented by lion, loyal dramatic and fiery");
        break;
    }
    else if (date >= 823 && date <= 922) { // if between August 23 and September 22
        System.out.println("Congratulations, you are a Virgo!");
        System.out.println("Represented by godess of agriculture, smart logical and practical");
        break;
    }
    else if (date >= 923 && date <= 1022) { // if between September 23 and October 22
        System.out.println("Congratulations, you are a Libra!");
        System.out.println("Represented by scale, balanced harmonious and a holder of justice");
        break;
    }
    else if (date >= 1023 && date <= 1121) { // if between October 23 and November 21
        System.out.println("Congratulations, you are a Scorpio!");
        System.out.println("Represented by Scorpion, strong will and are reborn a lot");
        break;
    }
    else if (date >= 1122 && date <= 1221) { // if between November 22 and December 21
        System.out.println("Congratulations, you are a Sagittarius!");
        System.out.println("Represented by archer, adventorous and seeking of glory");
        break;
    }
    else if (date >= 1222 && date <= 1231) { //if between December 22 and December 31
        System.out.println("Congratulations, you are a Capricorn!");
        System.out.println("Represented by sea-goat, patient efficient and dedicated to finishing the job");
        break;
    }
    else if (date >= 101 && date <= 119) { //if between January 1 and January 19
        System.out.println("Congratulations, you are a Capricorn!");
        System.out.println("Represented by sea-goat, patient efficient and dedicated to finishing the job");
        break;
    }
    else if (date >= 120 && date <= 218) { // if between January 20 and February 18
        System.out.println("Congratulations, you are a Aquarius!");
        System.out.println("Represented by the water, innovative and revolutionary");
        break;
    }
    else if (date >= 219 && date <= 320) { // if between February 19 and March 20
        System.out.println("Congratulations, you are a Pisces!");
        System.out.println("Represented by two fish, intuitive sensitive and empathetic");
        break;
    }
    else { //if input not right, then restarts proccess
        System.out.println("Error in input, please enter again!");
    }
}
}
}
astrologicalSign.main(null);
https://www.allure.com/story/zodiac-sign-personality-traits-dates is the source for all this info
Please enter the Month and day that you were born! Example - March 31st = 331
Congratulations, you are a Aries!
Represented by ram,loves to be on top, Bold and ambitious!

Explaination

The point of if statements are to do certain commands if certain parameters are met. For example in this code, A person inputs the date of their birth, and the if and else if statements check whether that input meets the requirements of the statemen. If it does, then the code goes into the code and does whatever needs to be done if the conditions are met; In this case, the star sign of the person is outputed. The else statement tells what to do if the input is not right, and acts accordingly. In this case, the else statement forces the user to input a correct value after printing error.

import java.util.Scanner; //importing scanning library
int date = 0; //variable for date of brith
int value = 0;


public class astrologicalSign2 { 

    public static void main(String[] args) {
    
    Scanner input = new Scanner(System.in); //function needed for scanning

    System.out.println("https://www.allure.com/story/zodiac-sign-personality-traits-dates is the source for all this info");

    System.out.println("Please enter the Month and day that you were born! Example - March 31st = 331"); //entering date of birth
    int date = input.nextInt(); //scanns input

    if (date >= 321 && date <= 419) { //if between March 21 and April 19
        value = 1;
    }
    else if (date >= 420 && date <= 520) { //if between April 20 and May 20
        value = 2;
    }
    else if (date >= 521 && date <= 620) { //if between May 21 and June 20
        value = 3;
    }
    else if (date >= 621 && date <= 722) { //if between June 21 and July 22
        value = 4;
    }
    else if (date >= 723 && date <= 822) { //if between July 23 and August 22
        value = 5;
    }
    else if (date >= 823 && date <= 922) { // if between August 23 and September 22
        value = 6;
    }
    else if (date >= 923 && date <= 1022) { // if between September 23 and October 22
        value = 7;
    }
    else if (date >= 1023 && date <= 1121) { // if between October 23 and November 21
        value = 8;
    }
    else if (date >= 1122 && date <= 1221) { // if between November 22 and December 21
        value = 9;
    }
    else if (date >= 1222 && date <= 1231) { //if between December 22 and December 31
        value = 10;
    }
    else if (date >= 101 && date <= 119) { //if between January 1 and January 19
        value = 11;
    }
    else if (date >= 120 && date <= 218) { // if between January 20 and February 18
        value = 12;
    }
    else if (date >= 219 && date <= 320) { // if between February 19 and March 20
        value = 13;
    }
    else { //if input not right, then restarts proccess
        value = 0;
    }

    switch (value) { //switch case with values
        case 1: //if value equals particular case, then commands printed
            System.out.println("Congratulations, you are a Aries!");
            System.out.println("Represented by ram,loves to be on top, Bold and ambitious!");
            break;
         case 2:
            System.out.println("Congratulations, you are a Taurus!");
            System.out.println("Represented by bull, loves luxury and comfort");
            break;
        case 3:
            System.out.println("Congratulations, you are a Gemini!");
            System.out.println("Represented by Castor and Pollox, playful,spontaneous,curious");
            break;
        case 4:
            System.out.println("Congratulations, you are a Cancer!");
            System.out.println("Represented by crab, emotionally invested and protective");
            break;
        case 5:
            System.out.println("Congratulations, you are a Leo!");
            System.out.println("Represented by lion, loyal dramatic and fiery");
            break;
        case 6:
            System.out.println("Congratulations, you are a Virgo!");
            System.out.println("Represented by godess of agriculture, smart logical and practical");
            break;
        case 7:
            System.out.println("Congratulations, you are a Libra!");
            System.out.println("Represented by scale, balanced harmonious and a holder of justice");
            break;
        case 8:
            System.out.println("Congratulations, you are a Scorpio!");
            System.out.println("Represented by Scorpion, strong will and are reborn a lot");
            break;
        case 9:
            System.out.println("Congratulations, you are a Sagittarius!");
            System.out.println("Represented by archer, adventorous and seeking of glory");
            break;
        case 10:
            System.out.println("Congratulations, you are a Capricorn!");
            System.out.println("Represented by sea-goat, patient efficient and dedicated to finishing the job");
            break;
        case 11:
            System.out.println("Congratulations, you are a Capricorn!");
            System.out.println("Represented by sea-goat, patient efficient and dedicated to finishing the job");
            break;
        case 12:
            System.out.println("Congratulations, you are a Aquarius!");
            System.out.println("Represented by the water, innovative and revolutionary");
            break;
        case 13:
            System.out.println("Congratulations, you are a Pisces!");
            System.out.println("Represented by two fish, intuitive sensitive and empathetic");
            break;
        case 0:
            System.out.println("Error in input, please enter again!");
        //add defaut

  }
}
}
astrologicalSign2.main(null);
https://www.allure.com/story/zodiac-sign-personality-traits-dates is the source for all this info
Please enter the Month and day that you were born! Example - March 31st = 331
Congratulations, you are a Cancer!
Represented by crab, emotionally invested and protective

Explaination

The point of switch cases statements are to do certain commands if certain parameters are met. For example in this code, A person inputs the date of their birth, and if the date of birth falls within a certain range, the swtich command respective to that range is activated and returns the output, in this case a print function telling the star sign and the values of it. It is similar to if and else statements, but instead of having an else statement just executes the commands which are defined under the switch ranges. As switch cases do not support ranges, an if statement with a new variable called value is needed in order to give the ranges a particlar value, something which can be called into the switch case.

De Morgan's law

According to cuemath.com, "According to De Morgan's Law, the complement of the union of two sets will be equal to the intersection of their individual complements. Additionally, the complement of the intersection of two sets will be equal to the union of their individual complements." One example of De Morgan's law would be saying that you like both Infinity War and Endgame, or saying that you like Infinity War and you like Endgame. These two statements express the same thought. De Morgan's law will be expressed in code below, which uses two conditions to check input; essentially the same as checking each condition one at a time. De Morgan's law in code can be exemplified with %% (and) and || (or) conditions, to check whether conditions are correct

import java.util.Scanner;
int value = 0;

public class feeling { 

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);
    System.out.println("Enter how youre feeling today from 1-10!");
    int value = input.nextInt();

    if(value  >= 1 && value <=3 )
    {
        System.out.println("Aww, I hope youre feeling better!");
    }
    else if(value >=4 && value <=6)
    {
        System.out.println("Its fine to have a normal day!");
    }
    else if(value >=7 && value <=10)
    {
        System.out.println("Thats good that you are having a good day!");
    }
            
}
}
feeling.main(null);
Enter how youre feeling today from 1-10!
Its fine to have a normal day!