Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 65

G. VENKATASWAMY NAIDU COLLEGE(SFC), KOVILPATTI.

(An Autonomous Institution | Affiliated to Manonmaniam Sundaranar University)


(Re-Accredited with 'A' Grade by NAAC| DBT Star College Status)

Record of Advanced Java Programming Lab Practical work in


I M. Sc (Information Technology)

Register No:
Subject code: P22IT1P1

This is certified to be the Bonafide Record of the work done by


Of I M.Sc. (Information Technology).

STAFF IN CHARGE HEAD OF THE DEPARTMENT

Submitted for the practical examination held on__________________________at


G. Venkataswamy Naidu College, Kovilpatti .

PLACE: KOVILPATTI EXTERNAL EXAMINERS


DATE: 1.

2.
INDEX
S. No Date Content Page No Signature

1 27/08/2022 Create an applet that takes age of the user as a


input in a Text Field using a Scroll bar.
02/09/2022 Create an exception called Array out of bounds
2 and throw the exception.
3 09/09/2022 Execute select query using JDBC.
4 20/09/2022 Develop an Enterprise Java Bean for banking
operations.
5 26/09/2022 Develop an Enterprise Java Bean for Library
operations.
6 28/09/2022 Create JFrame class for Employee details.

7 06/10/2022 Create a Servlet to display all the headers


available from request.
8 08/10/2022 Create a Servlet which displays a message and
also displays how many times the message has
been displayed.

9 13/10/2022 Write a Program which displays cookie id.

10 15/10/2022 Write a JSP page, which uses the include


directive to show its header and footer.
11 20/10/2022 Develop Remote Interface and implement
Java/RMIServer.
Ex no: 1

Date: 27/08/2022 Create an applet that takes age of the user in a Text Field using a Scroll bar.

Aim:
To write a program an applet that takes age of the user as an input in a textfield using scrollbar.
Algorithm:
Step 1: Start the program
Step 2: Open the notepad
Step 3: Import the header file for applet program
import java. applet. *;
Step 4: Create a Label, TextField and Scrollbar controls.
Step 5: User age is getted by scrollbar.
Step 6: TextField control is used to display the value which is selected in a scrollbar.
Step 7: Save the file using java extension and run the java program in command prompt by
using the following coding:
javac Scroll.java
appletviewer Scroll.java
Step 8: End the program
Program Coding:

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
/*
<applet code="Scroll" height="300" width="300">
</applet>
*/
public class Scroll extends Applet implements AdjustmentListener
{
Label u =new Label("select your age by using Scrollbar:")
TextField t =new TextField(10);
Scrollbar s = new Scrollbar(Scrollbar.VERTICAL, 50, 0, 0, 100);
public void init()
{
add(u);
add(t);
add(s);
s.addAdjustmentListener(this);
t.setEditable(false);
}
public void adjustmentValueChanged(AdjustmentEvent e)
{
t.setText(s.getValue()+"");
}
}
Output:
Result:

Thus the program was executed successfully and the output was verified.
Ex no:2

Date:02/09/2022 Create an exception called Array out of bounds and throw the exception

Aim:
To Write a program to create an exception called Array Out of Bounds and Throw the Exception.

Algorithm:

Step 1: Start the program.


Step 2: Open the Notepad.
Step 3: Use the Necessary header files.
Step 4: Declare array [] function and get the array elements at run time.
Step 5: Print the array elements according to the index value.
Step 6: If the number of array elements are exceeded from array size, print the error
message will be displayed as “Index Overflow”.
Step 7: Save the files using Java Extension.
Step 8: And run in the command prompt by using the following codes.
Javac filename.javaJava filename
Step 9: End the program.

Program Coding:
import java.util.Arrays;
import java.util.Scanner;
public class AIOBSampleHandled
{
public static void main(String args[])
{
int[] myArray = {897, 56, 78, 90, 12, 123, 75};
System.out.println("Elements in the array are: ");
System.out.println(Arrays.toString(myArray));
Scanner sc = new Scanner(System.in);
System.out.println("Enter the index of the required element :");
try
{
int element = sc.nextInt();
System.out.println("Element in the given index is : "+myArray[element]);
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("The index you have entered is invalid");
System.out.println("Please enter an index number between 0 and 6");
throw e;
}
}
}

Output:
Result:

Thus the program was executed successfully and the output was verified.
Ex no:3

Date:09/09/2022 Execute select query using JDBC

Aim:

To Write a Program to execute select query using JDBC.

Algorithm:

Step1: Open the notepad.


Step2: Import necessary header files.
Step3: Open the SQLyog and create a database OBDC.
Step4: Give the name of the connection and save.
Step5: Now create a table and insert value.
Step6: View the values using select query.
Step7: Print the values in the table.
Step8: Close the connection.
Step9: Save the file using .java.
Step10: Run the program.
Program coding:

import java.sql.*;
public class gfg
{
public static void main(String arg[])
{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root","");
Statement stmt;
stmt= con.createStatement();
ResultSet rs;
rs=stmt.executeQuery("select* from reg");
int id;
int age;
String first;
String second;
while(rs.next())
{
id=rs.getInt("id");
age=rs.getInt("age");
first=rs.getString("first").trim();
second=rs.getString("secound").trim();
System.out.println("id: "+id + "age: "+age+"first:" +first+ "second:" + second);
}
rs.close();
stmt.close();
con.close();
}
catch (Exception exception)
{
}
}
}
Output:
Result:

Thus the program was executed successfully and the output was verified.
Ex no:4

Date:20/09/2022 Develop an Enterprise Java Bean for banking operations

Aim:

To write an enterprise java beans for Banking Operation

Algorithm:

Step 1: Open the NetBeans App.


Step 2: File – New project – select JavaEE – select Enterprise Edition.
Step 3: Go to ejp file to create a new sessionbeans give name as “banktransact.java”.
Step 4: Make the link to the sessionbeans document inside the “index.html”.
Step 5: Go to war file, to create a new servlet and give named as” transact.java”.
Step 6: To create a necessary coding to perform bank operations like deposit, withdraw.
Step 7: Save the application build and run it.
Step 8: End the program.
Program coding:

index.html

<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="transact">
Enter amount:<input type="text" name="t1"/><br>
select transaction type:<br>
<input type="radio" name="transaction" value="deposit">deposit<br>
<input type="radio" name="transaction" value="withdraw">withdraw<br>
<input type="submit"/>
</form>
</body>
</html>

Transact.java

import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jbank.banktransactLocal;

public class transact extends HttpServlet


{
banktransactLocal banktransact = lookupbanktransactLocal();
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter())
{
String s=request.getParameter("transaction");
int amount=Integer.parseInt(request.getParameter("t1"));
if (s.equals("deposit"))
{
out.println(amount+"Successfully Deposited Your balance
is:"+banktransact.deposit(amount));
}
if (s.equals("withdraw"))
{
out.println(amount+"Successfully withdraw Your balance
is:"+banktransact.withdraw(amount));
}
}
}

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);
}
@Override
public String getServletInfo()
{
return "Short description";
}
private banktransactLocal lookupbanktransactLocal()
{
try
{
Context c = new InitialContext();
return (banktransactLocal) c.lookup("java:global/jbank/jbank-ejb/banktransact!
jbank.banktransactLocal");
}
catch (NamingException ne)
{
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
throw new RuntimeException(ne);
}
}
}
Banktransact.java

package jbank;
import javax.ejb.Stateful;
@Stateful
public class banktransact implements banktransactLocal
{
int balance=1000;
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
@Override
public int deposit(int amount)
{
balance=balance+amount;
return balance;
}
@Override
public int withdraw(int amount)
{
balance=balance-amount;
return balance;
}
}
Output:
Result:

Thus the program was executed successfully and the output was verified.
Ex no:5

Date:26/09/2022 Develop an Enterprise Java Bean for Library operations

Aim:

To Develop an Enterprise Java Bean for Library operations.


Algorithm:

Step1: Open the NetBeans app.


Step2: File-new project- select javaEE-select EnterpriseEdition.
Step3: Go to ejb file,to create a newsessionbean give name as Newlibtransact.java.
Step4: Make the link to the session document inside the index.html.
Step5: Go to war file,to create a newservlet and give named as library.java.
Step6: To create a necessary coding to perform library operations like issue,return.
Step7: Save the application build and run it.
Step8: End the program.
Program Coding:

Index.html

<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="Transact">
Enter no of book:<input type="text" name="t1"/><br>
Select Operation:<br>
<input type="radio" name="transaction" value="Returnbook">Returnbook<br>
<input type="radio" name="transaction" value="Issuebook">Issuebook<br>
<input type="submit"/>
</form>
</body>
</html>

TRANSACT.JAVA

import banktransact.banktransactLocal;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Transact extends HttpServlet


{

libtransactLocal libtransact = lookuplibtransactLocal();

protected void processRequest(HttpServletRequest request, HttpServletResponse response)


throws ServletException, IOException
{
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter())
{
String s=request.getParameter("transaction");
int noofbook=Integer.parseInt(request.getParameter("t1"));

if (s.equals("Returnbook"))
{
out.println(noofbook+"Successfully added Available books are:"+libtransact.Retunbook(noofbook));
}
if (s.equals("Issuebook"))
{
out.println(noofbook+"Successfully removed Available books are:"+libtransact.delbook(noofbook));
}

}
}

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);
}

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
processRequest(request, response);
}
@Override
public String getServletInfo()
{
return "Short description";
}// </editor-fold>

private libtransactLocal lookupbanktransactLocal()


{
try
{
Context c = new InitialContext();
return (libtransactLocal) c.lookup("java:global/library/library-ejb/libtransact!
libtransact.libtransactLocal");
}
catch (NamingException ne)
{
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught",ne);
throw new RuntimeException(ne);
}
}

}
LIBTRANSACT.JAVA

package libtransact;

import javax.ejb.Stateful;

@Stateful
public class libtransact implements libtransactLocal
{
int total=10;

// Add business logic below. (Right-click in editor and choose


// "Insert Code > Add Business Method")
@Override
public int Returnbook(int noofbook)
{
total=total+noofbook;
return total;
}

@Override
public int Issuebook(int noofbook) {
total=total-noofbook;
return total;
}
}
Output:
Result:

Thus the program was executed successfully and the output was verified.
Ex no:6

Date:28/09/2022 Create JFrame class for Employee details

Aim:

To create a JFrame class for Employee details.

Algorithm:

Step1: Start the program.


Step2: Open the notepad.
Step3: Create a Employee details and give named as “Emp.java”.
Step4: To import necessary header files.
Step5: In Emp.java, use jframe to display Employee details such
As name, salary, department, phone no etc.
Step6: Save the file using Java Extension.
Step7: And run the java program in command prompt by
Using the following command
Java Emp.java
Java Emp
Step8: End the Program
Program Coding:

import javax.swing.*;
import java.awt.*;
public class Emp extends JFrame
{
JButton jButton1;
JTextField jt1;
JTextField jt2;
JTextField jt3;
JTextField jt4;
JTextField jt5;
public Emp()
{
JLabel jL2 = new JLabel("Enter Name");
jt1 = new JTextField(10);
JLabel jL3 = new JLabel("Enter Department");
jt2 = new JTextField(10);
JLabel jL4 = new JLabel("Enter Address");
jt3 = new JTextField(10);
JLabel jL5 = new JLabel("Enter Salary");
jt4 = new JTextField(10);
JLabel jL6 = new JLabel("Phone No.");
jt5 = new JTextField(12);
jButton1 = new JButton();
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
jButton1.setText("Save");

jButton1.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton1ActionPerformed(evt);
}
});

Container cp = getContentPane();
JPanel p=new JPanel();

p.add(jL2);
p.add(jt1);
p.add(jL3);
p.add(jt2);
p.add(jL4);
p.add(jt3);
p.add(jL5);
p.add(jt4);
p.add(jL6);
p.add(jt5);
p.add(jButton1);
cp.add(p);
}
void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
String name1=jt1.getText();
String dept=jt2.getText();
String addr=jt3.getText();
int salr=Integer.parseInt(jt4.getText());
int phon=Integer.parseInt(jt5.getText());
System.out.println(name1);
System.out.println(dept);
System.out.println(addr);
System.out.println(salr);
System.out.println(phon);
}
public static void main(String args[])
{
Emp emp= new Emp();
emp.setVisible(true);
emp.setSize(260,260);
emp.setTitle("Employee Details");
emp.setResizable(false);
}
}
Output:
Result:

Thus the program was executed successfully and the output was verified
Ex no:7
Create a Servlet to display all the headers available from request
Date:06/10/2022

Aim:

To write a program servlet to display all headers available from request.


Algorithm:

Step 1: Open the Netbeans app.


Step 2: Select javaweb and select web applications.
Step 3: Click next and give project name, then click finish.
Step 4: Write a Xml coding to use the servlet.
Step 5: Create a index html page and give the link to connect the servlet document.
Step 6: Create a new java class file and give name as show headers.java
Step 7: Save the project.
Step 8: Run the project.
Step 9: End the program.
Program Coding:

WEB .XML:

<web-app>
<servlet>
<servlet-name>s1</servlet-name>
<servlet-class>ShowHeaders</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>s1</servlet-name>
<url-pattern>/run</url-pattern>
</servlet-mapping>
</web-app>

Index.html:

<html>
<body>
<a href="run"> click Here </a>
</body>
</html>
ShowHeaders.java:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;

public class ShowHeaders extends HttpServlet


{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<p>HTTP headers sent by your client:</p>");
Enumeration e = request.getHeaderNames();
while (e.hasMoreElements())
{
String headerName = (String) e.nextElement();
String headerValue = request.getHeader(headerName);
out.print("<b>"+headerName + "</b>: ");
out.println(headerValue + "<br>");
}
}
}
Output:
Result:

Thus the program was executed successfully and the output was verified
Ex no:8

Date:08/10/2022 Create a Servlet count the number of visitors in a page

Aim:

To write a servlet which displays a message and also display how many times the message has been
displayed.

Algorithm:

Step 1: Open the NetBeans App.


Step 2: File – New Project – select Java Web – select Web Application.
Step 3: Inside the web.xml file create a servlet name and link into the java class named as
“counterservlet.java”.
Step 4: Create index.html and write the coding to run the webpage.
Step 5: Create a new javaclass file inside the source package folder named
as” counterservlet.java”.
Step 6: Write the coding inside the counterservlet.java file to perform a display how many
times the message has been displayed.
Step 7: Save the application, build and run it.
Step 8: End the program.
Program Coding:

web.xml

<web-app>
<servlet>
<servlet-name>sample</servlet-name>
<servlet-class> counterservlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>sample</servlet-name>
<url-pattern>/run</url-pattern>
</servlet-mapping>
</web-app>

Index.html
<html>
<body>
<a href="run">Click Here </a>
</body>
</html>
counterservlet.java

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class counterservlet extends HttpServlet
{
private int c;
@Override
public void init() throws ServletException
{
c=0;
}
@Override
public void doGet(HttpServletRequest request,HttpServletResponse response) throws
ServletException,IOException
{
PrintWriter out=response.getWriter();
out.println("<h3> Welcome to my website!!!</h3>");
out.println("You are vistor number: "+(++c));
}
@Override
public void doPost(HttpServletRequest request,HttpServletResponse response) throws
ServletException,IOException
{
doGet(request,response);
}
}
Output:
Result:

Thus the program was executed successfully and the output was verified
Ex no:9

Date:13/10/2022 Display the cookie id

Aim:

To write a Program which displays cookie id.

Algorithm:

Step1: Open the NetBeans App.


Step2: File-new project-click javaweb-select WebApplication.
Step3: Write a xml coding.
Step4: To create index.html page and give link to the servlet document.
Step5: Create a new java class and give name as FirstServlet.java.
Step6: Use cookie to get the Username.
Step7: Create a another java class and givethe named as SecondServlet.java.
Step8: Use cookie to print the Username.
Step9: Save the application.
Step10: Run the program.
Program Coding:

Xml coding

<web-app>
<servlet>
<servlet-name>S1</servlet-name>
<servlet-class>FirstServlet</servlet-class>
</servlet>

<servlet>
<servlet-name>S2</servlet-name>
<servlet-class>SecondServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>S1</servlet-name>
<url-pattern>/servlet1</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>S2</servlet-name>
<url-pattern>/servlet2</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

Html coding

<form action="servlet1" method="post">


Name:<input type="text" name="userName"/><br/>
<input type="submit" value="go"/>
</form>
First servlet:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class FirstServlet extends HttpServlet
{
public void doPost(HttpServletRequest request, HttpServletResponse response)
{
try
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String n=request.getParameter("userName");
out.print("Welcome "+n);
Cookie ck=new Cookie("uname",n);//creating cookie object
response.addCookie(ck);//adding cookie in the response

//creating submit button


out.print("<form action='servlet2' method='post'>");
out.print("<input type='submit' value='go'>");
out.print("</form>");
out.close();
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Second servlet:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class SecondServlet extends HttpServlet


{
public void doPost(HttpServletRequest request, HttpServletResponse response)
{
try
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Cookie ck[]=request.getCookies();
out.print("Hello "+ck[0].getValue());
out.close();
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Output:
Result:

Thus the program was executed successfully and the output was verified.
Ex no:10

Date:15/10/22 Create a JSP page which uses the include directive to show its header and footer

Aim:

To Write a JSP page, which uses the include directive to show its header and footer.

Algorithm:
Step1: Open the NetBeans app.
Step2: Create a JSP and give name as main JSP.
Step3: Use <%@include> to include the files for displaying in header.
Step4: Create another JSP and that file the contents to display header and footer.
Step5: Save the application and build.
Step 6: After successful build run the application.
Program Coding:

Main.jsp:

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<%@ include file = "header.jsp" %>
<center>
<p>Thanks for visiting my page.</p>
</center>
<%@ include file = "footer.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
</body>
</html>

header.jsp:

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<%!
int pageCount = 0;
void addCount() {
pageCount++;
}
%>
<% addCount(); %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>
<body>
<center>
<h1>Hi Welcome</h1>
<h2> This is an directory Example<h2>
<p>This site has been visited<%= pageCount %> times.</p>
</center>
<br/><br/>
</body>
</html>

footer.jsp:

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<br/><br/>
<center>
<p><footer>copy right @ 2021</footer></p>
</center>
</body>
</html
Output:
Result:

Thus the program was executed successfully and the output was verified
Ex no:11
Develop Remote Interface and implement Java/RMIServer
Date:20/10/2022

Aim:

To write a remote interface and implement java/RMI server

Algorithm:

Step 1: Start the program.


Step 2: Open the Notepad.
Step 3: Create a RMI remote interface Hello.java.
Step4: Create a class IMPLexample that implement interface hello.java.
Step5: Create a application that run as server,
Step6: Open a command promt type javac.* java and start rmiregistry
Step7: Open another command promt and run the client the message in the client will be
displayed in the server.
Step 8: End the program.
Program Coding:

Hello.java

import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Hello extends Remote
{
void printMsg() throws RemoteException;
}

ImplExample.java

public class ImplExample implements Hello


{
public void printMsg()
{
System.out.println("This is an example RMI program");
}
}
Server.java

import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class Server extends ImplExample


{
public Server()
{
}
public static void main(String args[])
{
try
{
ImplExample obj = new ImplExample();
Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
Registry registry = LocateRegistry.getRegistry();
registry.bind("Hello", stub);
System.err.println("Server ready");
}
catch (Exception e)
{
System.err.println("Server exception: " + e.toString());
e.printStackTrace();
}
}
}
Client.java

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class Client


{
private Client()
{
}
public static void main(String[] args)
{
try
{
Registry registry = LocateRegistry.getRegistry(null);
Hello stub = (Hello) registry.lookup("Hello");
stub.printMsg();
}
catch (Exception e)
{
System.err.println("Client exception: " + e.toString());
e.printStackTrace();
}
}
}
Output:
Result:
Thus the program was executed successfully and the output was verified

You might also like