package javaapplication16; import java.util.Scanner; public class JavaApplication16 { public static void main(String[] args) { int month; System.out.println("Enter the number of mounth from 1 to 12"); Scanner months=new Scanner(System.in); month=months.nextInt(); switch (month) { case 1: System.out.println("jan"); break; case 2: System.out.println("feb"); break; case 3: ...
Posts
- Get link
- X
- Other Apps
//Q 3 Write a Java program that reads a number and prints "zero" if the number is zero. Otherwise, //print "positive" or "negative". And if the number is greater than 100 print the number is to large positive System.out.println("Enter a number"); Scanner input =new Scanner(System.in); int num=input.nextInt(); if (num<1) { System.out.println("The Number is Too Small"); } else if(num>100) { System.out.println("The Number is Too large positive "); } else { System.out.println("The Number is positive"); } } }
- Get link
- X
- Other Apps
package javaapplication14; import java.util.Scanner; public class Javaapplication14 { public static void main(String[] args) {double n1,n2,n3; System.out.println("Enter number 1"); Scanner n11 =new Scanner(System.in); n1=n11.nextDouble(); System.out.println("Enter number 2"); Scanner n12 =new Scanner(System.in); n2=n12.nextDouble(); System.out.println("Enter number 3"); Scanner n13 =new Scanner(System.in); n3=n13.nextDouble(); double result = n2*n2 - 4*(n1*n3); if(result>0) { double r1=(-n2+Math.pow (result,0.5))/2*n1; ...
- Get link
- X
- Other Apps
package javaapplication14; public class JavaApplication14 { public static void main(String[] args) { //Write a Java program to get a number from the user and print whether it is positive or negative. int a = 10; if (a>0) { System.out.println("The number is positive"); } else { System.out.println("The number is negative"); } } }
- Get link
- X
- Other Apps
package javaapplication8; import java.util.Scanner; class method { public class JavaApplication8 { public static void main(String[] args){ int name; Scanner In =new Scanner(System.in); System.out.println("Enter your name digits ="); name= In.nextInt(); swich (name) { case 1: System.out.println(" **** * * * * * ***** *****"); System.out.println(" * * * * * * *...
- Get link
- X
- Other Apps
package javaapplication9; import java.util.Scanner; public class JavaApplication9 { public static void main(String[] args) { int NA; Scanner In =new Scanner(System.in); System.out.println("Enter your accademy Name Digits ="); NA= In.nextInt(); int xz = 9; if(xz == NA) { System.out.println("* * * * * * * ** ** **** ***** **** ***** "); System.out.println("* * * * * * * * * ** ** ...