soponpotsit Goto Github PK
Type: User
Type: User
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"); } } }
Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.