Git Product home page Git Product logo

soponpotsit's Projects

basic-oop icon basic-oop

package total; import java.util.Scanner; public class Total { public static void main(String[] args) { Scanner s = new Scanner(System.in); int number=0; for(int i=0;i!=7;i=number){ System.out.print("Input Menu"); number = s.nextInt(); switch (number) { case 1:{ main01(); break;} case 2: { main02(); break;} case 3:{ main03(); break;} case 4:{ main04(); break;} case 5:{ main05(); break;} default: System.out.println("That's not 1, 2, or 3!"); } } } public static void main01() { int i = 10; for(i=1;i<=10;i++) System.out.print("\n"+i+". Yes I'm Sopon Potsit."); } public static void main02() { double b,h,area; Scanner s = new Scanner(System.in); System.out.print("\nInput base = "); b = s.nextDouble(); System.out.print("\nInput high = "); h = s.nextDouble(); area = 0.5*b*h; System.out.print("\nTotal Area = "+area); } public static void main03() { int i=0,p=3; for(i=1;i<=10;i++) { System.out.print("\nPow "+i+" ^ "+p+" = "+Math.pow(i,p)); } } public static void main04() { Scanner s = new Scanner(System.in); int i,max=0; int []n = new int[2]; for(i=0;i<2;i++) { System.out.print("\nEnter --> "); n[i]=s.nextInt(); System.out.print("No. "+(i+1)+" = "+n[i]); if(max <= n[i]) max=n[i]; else max=max; } System.out.print("\nMax = "+max); } public static void main05() { Scanner s = new Scanner(System.in); int i; int []n = new int[1]; System.out.print("\nEnter --> "); i=s.nextInt(); if (i%2==0){ System.out.print("\nThis Number is "+" Even"); }else { System.out.print("\nThis Number is "+" Odd"); } } }

hello-world-java icon hello-world-java

Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.