Question: Question No.3: Write a Java program to perform all the basics programing operations such as data types, conditional statements (if, else if, switch), loops (for,

 Question No.3: Write a Java program to perform all the basicsprograming operations such as data types, conditional statements (if, else if, switch),loops (for, while, do-while) using methods. A basic example is given below:import java.util.Scanner; public class AllBasics public static void main(String args[]) int a

Question No.3: Write a Java program to perform all the basics programing operations such as data types, conditional statements (if, else if, switch), loops (for, while, do-while) using methods. A basic example is given below: import java.util.Scanner; public class AllBasics public static void main(String args[]) int a =0; while(true) { System.out.println("Enter 1 For Variables Function"); System.out.printin ("Enter 2 For Array Function"); System.out.println("Enter 3 For if Else condition "); System.out.printin("Enter 4 For Switch statement "); System.out.printin("Enter 5 For Do while Loop"); System.out.printin("Enter 6 for For Loop "); System.out.printin("Enter 7 for while loop "); System.out.printin("Enter to Exit the program "); Scanner input = new Scanner(System.in); try { a=input.nextInt(); } catch(Exception e) { System.out.println("Only Enter Integers " + e); } F Font Styles Paragraph System.out himnun enter to Exit the program Scanner input = new Scanner(System.in); try { a=input.nextInt(); } catch(Exception e) { System.out.printin("Only Enter Integers " + e); } switch (a) { case 1: f1(); break; case 2: f2(); // create a method to show how array works in java break; case 3: f3(); // Create a Method and practice some examples if/else if break; case 4: f4(); // Create a method and practice some for switch examples break; united States BE Font Paragraph Styles TZU, 77 created me LTTOU LO STIOW HOW array works 111 Java break; case 3: f3(); // Create a Method and practice some examples if/else if break; case 4: f4(); // Create a method and practice some for switch examples break; case 5: f5(); // Create a method and practice some Do while loop examples break; case 6: f6(); // Create a method and practice some for loop examples break; case 7: f7(); // Create a method and practice some while loop examples break; } if(a==0) { break; } } } } static void f1({ System.out.println("Varaible is memory location which we can store some data in it and it is changeable."); h (United States) case 7: f7(); // Create a method and practice some while loop examples break; } if(a==0) { break; } } } static void f1({ System.out.println("Varaible is memory location which we can store some data in it and it is changeable."); System.out.println("Variable Structure: datatype varname = varvalue; e.g. int age = 10; "); System.out.println(" Or Variable declaration: datatype varname; e.g. int age;"); System.out.println("Variable initialization: varanme = varvalue; e.g. age = 10;"); System.out.println("Data Types are : Integer(int) Float(float) Character(char) Double (double)"); Scanner scan = new Scanner(System.in); System.out.println("Enter a String or Name of some one here : "); String name=scan.next(); System.out.println("Enter an integer or age of someone : "); int age=scan.nextInt(); System.out.println("Your Name is "+name+" Your Age is "+age); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!