Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This project will consist of creating a presentation for your classmates. It may

ID: 3854484 • Letter: T

Question

This project will consist of creating a presentation for your classmates. It may be about any topic, but include five major competencies of this course.

1a. Explain the development of Java applications.
2a. Explain the control structures in Java.
3a. Utilize Methods and Arrays in Java.
4a. Utilize string and character manipulation in Java.
5a. Utilize Object-Oriented programming concepts in Java.
6a. Utilize Basic and Advanced Graphical User Interface Components.
7a. Identify and debug common mistakes in programs written in Java.

The preferences are you demonstrate a working knowledge of control structures, error handling, classes, methods, recursion, and array processing.

This project will consist of two parts. The two parts will be a working program to show your classmates and a written guide/presentation that covers the usage/creation of the program.

Task:

1b. Five major competencies demonstrated

Working application with the following:

1c. Five major competencies clearly demonstrated and shown in the comments

2c. The application is flawless

3c. The commenting is complete and professionally done

4c. The program is easy to use, or there are clear instructions covering how to use the program.

The lesson you write will include the following:

1d. The lesson will cover the program written.

2d. The program and the lesson should be well matched

3d. The operating instructions for the program will be in the lesson

4d. The lesson will be clear and polished.

5d. The lesson should be a minimum of 3 pages long, double-spaced 12 point font.

6d. The lesson will completely and clearly explain the program.

Explanation / Answer

1.Developing General Java Applications In Net Beans IDE:
The following are the basic steps of developing a Java SE application
in NetBeans IDE.
=>Project Setup
=>Creating and Editing Java Source Code
=>Compiling and Running the Application
=>Testing and Debugging the Application
=>Building, Running, and Distributing the Application.
*Project Setup
To Create application you will contain two projects:
1.A Java Class Library project in which you will create a utility class.
2.A Java Application project with a main class that implements a
method from the library project's utility class.

=> For Creating a Java Class Library Project
We Follow Below Steps:
1.Choose File New Project (Ctrl-Shift-N).
Under Categories, select Java. Under Projects, select Java Class
Library. Click Next.
2.Under Project Name, type MyLib.
Change the Project Location to any directory on your computer.
3.Click Finish. The MyLib project opens in both the Projects window
and the Files window.

=>Creating a Java Application Project
1. Choose File > New Project. Under Categories, select Java.
Under Projects, select Java Application. Click Next.
2.Under Project Name, type MyApp. Make sure the Project Location is
set to NetBeansProjects.
3.Enter acrostic.Main as the main class.Ensure that the Create Main
Class checkbox is checked.
4.Click Finish. The MyApp project is displayed in the Project window
and Main.java opens in the Source Editor
*Creating and Editing Java Source Code
Now We Have to create a Java package
=> For Creating a Java Package and Class File
1.Right-click the MyLib project node and choose New > Java Class.
Type LibClass as the name for the new class, type org.name.mylib in
the Package field, and click Finish.
Now MyClass.java opens in the Source Editor.
In MyClass.java,
public class LibClass
{
public static String acrostic(String[] args)
{
System.out.printf("Hello world");
}
}
=>Compiling and Running the Application
By default, the projects have been created with the Compile on Save
feature enabled,
so we do not need to compile code first in order to run the
application in the IDE.
=>Running the Application
To run the application in the IDE:
Right-click the MyApp project node and choose Clean and Build.
Choose Run > Run Project (F6).
=>Building, Running, and Distributing the Application
The main build command in the IDE is the Clean and Build command.
To build the application:
->Choose Run > Clean and Build Project (Shift-F11).
->Output from the Ant build script appears in the Output window.
=>Distributing the Application to Other Users
To distribute the application:
->On your system, create a zip file that contains the application JAR
file (MyApp.jar) and the accompanying lib folder that contains
MyLib.jar.
->Send the file to the people who will use the application.

II.Control Structure in JAVA.
control structures to organise the execution of the program. A control
structure might cause a statement to be executed once,
several times, or not at all.
The Control Structure of java Contains Following Statements:
1.Assignment Statement
An assignment statement in Java has two parts. It has a variable on
the left-hand sideand an expression on the right.
The expression is first evaluated to yield a value. That value is then
used as the new value of the variable.
Example :int a=30,b;
b=a+12;
2.Conditional statements in JAVA:
A conditional statement allows a choice from a selection of
statements. It first evaluates an expression to decide between the
possibilities.
The Control Structure have The Following Statement;
3.Selection Statements:
Selection statements allow you to control the flow of program
execution on the basis of the outcome of an expression or state of a
variable known during runtime.
There are Different types of Selection Staments:
if and if-else statements
if-else statements
if-else-if statements
Switch Statement Used For Selcting List of Expressions.Based on
Integer or Charcter Baesd Expression.
The switch statement introduces four new keywords,switch, case,
default and break.
Which follows Syntax as:
Switch(expression)
{
case 1:
//statements;
break;
case 2:
//Statements;
break;
case n:
break;
}
4.The Loop Stements:
The Loop or Iteration Statments Are Used For Executing No Of
Statements in Single Block.There are Three Types Of Loop/Iteration
Statements.
Here Loop Means Repeatedly Excutes Same Number of Instructions Until
Condition is Satisfied.
1.For Loop
2.While Loop.
3. Do-While Loop.
5.Jump Statements
Jump statements are used to unconditionally transfer the program
control to another part of the program.
Java provides the following jump statements:
break statement
continue statement
return statement
for Example we want to Perform The All Arithmetic Operations by Using
All The Control Structure.
package venkanna;
import java.util.Scanner;
public class ExceptionClasss {

public static void main(String[] args)
{
int num1=0,num2=0,result=0; //Initially Assign All Variables to Zero
By using Assignment Statement
Scanner sc = new Scanner(System.in);
System.out.println("------------------");
System.out.println("Demonstration on Control Structure:");
while(true) //Infinite While Loop
{
System.out.println("*********MENU***************");
System.out.println("1.Addition");
System.out.println("2.Substractiion");
System.out.println("3.Multipliaction");
System.out.println("4.Division");
System.out.println("5.Exit");
System.out.println("Select Any One Option");
int opt=sc.nextInt();
switch(opt) //Switch Statement Used for Selecting List Of Expressions
{
case 1:
System.out.println("enter Any Two Number:");
num1=sc.nextInt();
num2=sc.nextInt();
try
{
result=addition(num1,num2);
System.out.println("The Result is:"+result);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
break; //Break Statement used For Skip The Particular Block of Code
case 2:
System.out.println("enter Any Two Number:");
num1=sc.nextInt();
num2=sc.nextInt();
try
{
result=substraction(num1,num2);
System.out.println("The Result is:"+result);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
break;
case 3:
System.out.println("enter Any Two Number:");
num1=sc.nextInt();
num2=sc.nextInt();
try
{
result=multiplication(num1,num2);
System.out.println("The Result is:"+result);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
break;
case 4:
System.out.println("enter Any Two Number:");
num1=sc.nextInt();
num2=sc.nextInt();
try
{
result=division(num1,num2);
System.out.println("The Result is:"+result);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
break;
case 5:
System.exit(0);
default:
System.out.println("Wrong Choice! Select Correct");
}
}
}
private static int division(int num1, int num2)
{
int res=num1/num2;
return res; // Return Statement Used For Return Values to Calling Method
}
private static int multiplication(int num1, int num2)
{
int res=0;
res=num1*num2;
return res;
}
private static int substraction(int num1, int num2)
{
int res=0;
res=num1-num2;
if(num1==num2) //used for Checking The Number1 equal to Number 2
System.out.println("Both Numbers are Equal:");
else //Else Block Will Be Executed if Condition is Failed
System.out.println("Not Equal:");
return res;
}
private static int addition(int num1, int num2)
{
int res=0;
res=num1+num2;
return res;
}

}

III.Utilizing Methods And Arrays in Java:

Where Array is Set of an Identical Elements referenced By same Name.
That is Used for Sharing The Common Name.
Java array is an object the contains elements of similar data type. It
is a data structure where we store similar elements.
We can store only fixed set of elements in a java array
it Follows The Syntax as;
int array[]=new Int[];will Refer The Memory For PArticalur Array Elements.
For Example,
package venkanna;
import java.util.Scanner;
public class Max_Min
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter The Size of Array");
int size=sc.nextInt();
int arr[]=new int[size]; // Creating Array Object;
System.out.println("Enter "+size+" Elements:");
for(int i=0;i<arr.length;i++)
{
arr[i]=sc.nextInt();
}
Method(arr); //Calling Method for Finding The Maximum And Minimum
Element From The Array
sc.close();
}

private static void Method(int[] arr)
{
int large=arr[0];
int small=arr[0];
for(int k=0;k<arr.length;k++)
{
if(large<arr[k])
{
large=arr[k];
}
else if(small>arr[k])
{
small=arr[k];
}
}
System.out.println("The Largest Element in The List is:"+large);
System.out.println("The Smallest Element in The List is:"+small);
}
}
IV.Utilizing The String and Charcter Manipulation JAVA:
The java String is immutable Object i.e. it cannot be changed.
Whenever we change any string, a new instance is created.
For mutable string, you can use StringBuffer and StringBuilder classes.
Generally The String is Group of Characters Enclosed In Double Quotes.
JAVA provides wrapper class Character for primitive data type char.
The Character class offers a number of useful class (i.e., static)
methods for manipulating characters.
You can create a Character object with the Character constructor
Character ch = new Character('a');
The Java compiler will also create a Character object.
For example, if you pass a primitive char into a method that expects an object,
the compiler automatically converts the char to a Character.This
feature is called autoboxing or unboxing, if the conversion goes the
other way.
Example
// Here following primitive char 'a'
// is boxed into the Character object ch
Character ch = 'a';
// Here primitive 'x' is boxed for method test,
return is unboxed to char 'c'
char c = test('x');
There Are Different Methods Available for Implemting Charcter Class.
For Example,
package venkanna;
import java.util.Scanner;
public class StringPalindrome {
public static void main(String[] args)
{
System.out.println("Method For Implementing String is palindrome or not");
Scanner sc = new Scanner(System.in);
System.out.println("Enter Any String:");
String str=sc.next(); //String is Immutable Object Will Never Modified
boolean result=isPalindrome(str); //Method Calling for Performing
String Palindrome
if(result==false)
{
System.out.println("The String "+str+" is Not a Palindrome");
}
else
{
System.out.println("The String "+str+" is aPalindrome");
}
}
}
private static boolean isPalindrome(String str)
{
int length=str.length();
int i,j;
for(i=0,j=length-1;i<j;i++,j--)
{
if(str.charAt(i)!=str.charAt(j))
{
return false;
}
}
return true;
}
V.Utilize The Object Oriented Programming Concepts in Java.
Java Supports Differnt Types of Object Oriented Features:
1.Encapsulation.
The Encapsulation is a Mechanism that is used for wraping of data And
Binds the data together.Mainly it is used for Providing Security to
The Data.
We Using Private Access Modifier.
2.Inheritance:
The Concept of Inheritance is Mainly Used for Reusing of The
Data.Inheritance is Process of Acquiring the Properties from Base
Class to Derived Class.
The Inheritance is Mainly Achieved by Using The Public Access Modifier.
For Example,
class SuperClassA {
public void foo(){
System.out.println("SuperClassA");
}
}
class SubClassB extends SuperClassA{
public void bar(){
System.out.println("SubClassB");
}
}
public class Test {
public static void main(String args[]){
SubClassB a = new SubClassB();
a.foo();
a.bar();
}
}
3.Abstraction:
The Abstraction is the Process of hiding the Internal Details Of The
Particular System.
Shows Only The Necessary Details.This is Achieved by Using Abstract
Keyword in JAVA.
4.PolyMorphism:
PolyMorphism is Nothing But One Thing Many Other Forms.
This is done by using Method Overloading And Method Overiding Concepts in JAVA.
For Example,
public class Circle {
public void draw(){
System.out.println("Drwaing circle with default color Black and
diameter 1 cm.");
}
public void draw(int diameter){
System.out.println("Drwaing circle with default color Black and
diameter"+diameter+" cm.");
}
public void draw(int diameter, String color){
System.out.println("Drwaing circle with color"+color+" and
diameter"+diameter+" cm.");
}
}
VI. Utilize Basic And Advanced GUI(Graphical User Interface) Components.
A program's GUI (graphical user interface) presents an easy-to-use
visual display to the user. It is made up of graphical components.
for example,buttons, labels, windows,text fields, text areas etc
The user can interact with the page or application by using these components.
To make GUI(graphical user interfaces) in Java, use either Swing or JavaFX.
=>Swing is a set of program component s for Java programmers that
provide the ability to create graphical user interface ( GUI )
components,
such as buttons and scroll bars, that are independent of the
windowing system for specific operating system .
Swing has a wide range of various components:
*buttons
*check boxes
*sliders
*list boxes

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote