@JOmbra/

TwinAcademicHarpseal

Java

No description

fork
loading
Files
  • Main.java
  • file1.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
class Main {
  public static void main(String[] args) {
  
    double maths = 97.5;
    double english = 98;
    double science = 60.6;
    double drama = 70;
    double music = 96;
    double sum = maths + english + science + drama + music;
    double average = sum / 5;
    
    System.out.println("The student has avg = " + average);
    
     double register = 10.0;
    register = register + 5;
    register = register - 2.5;
    register = register + 10;
    register = register - 3;
    
    
    System.out.println("The register will give " + register + ".");
    
    int bankBalance = 500;
    bankBalance = bankBalance + 250;
    bankBalance = bankBalance - 100;
    
    System.out.println("Your account balace is " + bankBalance + ".");
    
    int day = 11;
    String month = "Octuber";
    
    System.out.println("My birthday is " + day + "/" + month + ".");
    
    String name = "Luiz";
    String lastName = "Silva";
    String fullName = name + " " + lastName;
    System.out.println("My FullName is " + fullName + "." );
    System.out.println("There are " +fullName.length()+ " letters in my name.");
    
    double fahrenheit = 75.0;
    double celsius;
    celsius = (fahrenheit - 32) * 5 / 9;
    
    System.out.println("The Temperature in celsius is " + celsius);
    
    //Traffic light code
    boolean isLightGreen = false;
    boolean isLightYellow = false;
    
    if(isLightGreen) {
      // traffic light is green
      System.out.println("Go a head!");
    } else if(isLightYellow) {
      // traffic light is yellow
      System.out.println("Slow down!");
    } else {
      // traffic light is Readable
      System.out.println("Stop the car!");
    }
    
    //tickets to Museum
    int ticketsPrice = 10;
    int age = 20;
    boolean isStudent = true;
    
    if(age <= 15){
      // age is less than or equal to 15
      ticketsPrice = 5;
      System.out.println("You have $5 dollar discount.The Ticket price is " + ticketsPrice);
    }else if(age >= 60){
      // age is greater or equal to 60
        ticketsPrice = 5;
      System.out.println("Sior you have $5 dollar discount.The Ticket price is " + ticketsPrice); 
    }else if(isStudent){
      // Person has student ID
      ticketsPrice = 5;
      System.out.println("You have student discount.The Ticket price is " + ticketsPrice); 
    }else{
      System.out.println("The tickets is $10");
    }
    
    //using logical operators
    
    int ticketsPrices = 10;
    int ages = 20;
    boolean isStudents = true;
    
    if(ages <= 15 && ages >= 60 && isStudents){
      //all variables attendent the expression
      ticketsPrices = 5;
      System.out.println("You have $5 dollar discount!");
    }else{
      System.out.println("Ticket is $10!");
    }
  
  class test {
    public void chorus(){
      // we will print something here
      System.out.println("First function");
  }
    
  }
  }
}