JcGaming

Activity Week 4 by John Carl Quieta

Oct 4th, 2022
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.34 KB | Source Code | 0 0
  1. /**
  2.  * Activity week 4 intro to java CCS1E
  3.  *
  4.  */
  5. public class main {
  6.  
  7.     public static void main(String[] args) {
  8.         // primitive data types
  9.         int Senna = 20;
  10.         short teemo = 1;
  11.         long cassiopeia = 5;
  12.         double varus = 2.54;
  13.         float yasuo = 5.454f;
  14.         int feeder = 5;
  15.  
  16.         // pseudocodes and flowcharts
  17.         /**
  18.          * My personal based code flowchart design:
  19.          * https://bit.ly/3e2rlSc
  20.          */
  21.  
  22.         String correct = "Correct";
  23.         String wrong = "Wrong";
  24.         String equal = "Equal";
  25.         String notequal = "Not Equal";
  26.         String nh = "Nothing Happened";
  27.  
  28.         if (Senna < teemo) {
  29.             System.out.println(correct);
  30.             // prints correct if the senna is less than teemo
  31.  
  32.         } else {
  33.             System.out.println(wrong);
  34.             // prints wrong because senna is larger (20) than teemo (1)
  35.  
  36.             // output should be wrong
  37.  
  38.         }
  39.  
  40.         if (cassiopeia == varus) {
  41.             System.out.println(equal);
  42.  
  43.         }
  44.         if (cassiopeia != feeder) {
  45.             System.out.println(notequal);
  46.         }
  47.         // output will be nothing happened becuase both are false
  48.         else {
  49.             System.out.println(nh);
  50.  
  51.         }
  52.  
  53.     }
  54. }
  55.  
  56. // Submitted by : John Carl Quieta
  57. // October 4, 2022
Add Comment
Please, Sign In to add comment