Bazgha AJ

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

MAHARISHI DAYANAND UNIVERSITY

Delhi Global Institute of


Technology
Advanced Java Lab

Submitted By: Anjali

Subject Code : LC-CSE-328G

Subject Name : Advanced Java Lab

Registration Number : 191380197


INDEX
S.No. Program Date Remaks
1. Print “Hello” message using java. 19/04/22
2. Print Series 19/04/22
1
23
456
7 8 9 10
3. Print Series 26/04/22
1
12
123
1234
4. Print Series 26/04/22
1
123
12345
5. Make a calculator for addition, 10/05/22
subtraction, multiplication, division and
modular operator in JSP.
6. In JSP take input from user and find out 17/05/22
whether it is odd or even.
7. Calculate electricity bill when number of 31/05/22
units consumed is given.
8. Take a number from user, find out 07/06/22
whether it is Armstrong number or not.
9. Take a number from user and find out 14/06/22
whether it is palindrome or not.
10. In JSP, make your resume including html 14/06/22
tags also.
Name: Anjali

Registration Number:191380197

Program 1: Print “Hello” message using java.

Code:

class Class {

public static void main(String[] args) {

System.out.println("Hello");

Output:
Name: Anjali

Registration Number:191380197

Program 2: Print Series


1

23

456

7 8 9 10

Code:

class HelloWorld {

public static void main(String[] args) {

int rows = 4;

int count =1;

for (int i = 1; i <= rows; i++) {

for (int j = 1; j <= i; j++) {

System.out.print(count+"\t");

count++; }

System.out.println(); }

Output:
Name: Anjali

Registration Number:191380197

Program 3: Print Series


1

12

123

1234

Code:

class HelloWorld {

public static void main(String[] args) {

int rows = 4;

for (int i = 1; i <= rows; i++) {

for (int j = 1; j <= i; j++){

System.out.print(j+" ");

System.out.println();

Output:
Name: Anjali

Registration Number:191380197

Program 4: Print Series

123

12345

Code:

public class HelloWorld {

public static void main(String[] args) {

for (int i=1; i<=3; i++){

for (int k=1;k<=2-i+1;k++){

System.out.print(" ");

int num = 1;

for (int j=1; j<=2*i-1; j++){

System.out.print(num);

num++;

System.out.println(); } }
}

Output:

Name: Anjali

Registration Number:191380197

Program 5: Make a calculator for addition, subtraction, multiplication, division


and modular operator in JSP.

Code:

<html>

<body>

<script>

const operator = prompt('Enter operator to perform the calculation ( either +,-,


* ,% or / ): ');

const number1 = parseFloat(prompt ('Enter the first number: '));

const number2 = parseFloat(prompt ('Enter the second number: '));

let result;

if (operator == '+') {

result = number1 + number2;

else if (operator == '-') {

result = number1 - number2;

}
else if (operator == '*') {

result = number1 * number2;

else if (operator == '%'){

result = number1%number2;

Name: Anjali

Registration Number:191380197

else {

result = number1 / number2;

document.write(" Result is " + result);

</script>

<body>

</html>

Output:
Name: Anjali

Registration Number:191380197

Program 6: In JSP take input from user and find out whether it is odd or even.

Code:

<html>

<body>

<script>
function oddEven(number){

if(number%2==0){

return("The number is Even");

else{

Name: Anjali

Registration Number:191380197

return("The number is Odd");

</script>

<script>

var n = parseInt(prompt("Enter the number"));

var ans = oddEven(n);

document.write(ans);

</script>

</body>

</html>

Output:
Name: Anjali

Registration Number: 191380197

Program 7: Calculate electricity bill when number of unitsconsumed is given.

Code:

<html>

<body>

<script>

function calculateBill(units)

if (units <= 100)

return units * 10;

else if (units <= 200)

return (100 * 10)+ (units - 100)* 15;

}
else if (units <= 300)

return (100 * 10)+ (100 * 15)+ (units - 200)* 20;

else if (units > 300)

Name: Anjali

Registration Number:191380197

return (100 * 10)+ (100 * 15)+ (100 * 20)+ (units - 300)* 25;

return 0;

</script>

<script>

var units = parseInt(prompt("Enter the number of units: "));

document.write("Total Electricity Bill: ");

document.write(calculateBill(units));

</script>

<body>

</html>

Output:
Name: Anjali

Registration Number:191380197

Program 8: Take a number from user, find out whether it is Armstrong number
or not.

Code:

<html>

<body>

<script>
function Armstrong(number)

var original,remainder,res = 0;

original = number;

while(number > 0)

remainder = number%10;

Name: Anjali

Registration Number:191380197

res = res + remainder*remainder*remainder;

number = parseInt(number/10);

if(res == original)

return("The number is Armstrong");

else

return("The number is not Armstrong");

</script>

<script>
var n = parseInt(prompt("Enter the number"));

var ans = Armstrong(n);

document.write(ans);

</script>

</body>

</html>

Name: Anjali

Registration Number:191380197

Output:

Program 9: Take a number from user and find out whether it is palindrome or
not.
Code:

<html>

<body>

<script>

function validatePalin(str) {

const len = string.length;

Name: Anjali

Registration Number:191380197

for (let i = 0; i < len / 2; i++) {

if (string[i] !== string[len - 1 - i]) {

return( str+' is not a palindrome');

return( str+' is a palindrome');

</script>

<script>

const string = prompt('Enter a String or Number ');

const ans = validatePalin(string);

document.write(ans);

</script>

</body>

</html>
Output:

Name: Anjali

Registration Number:191380197

Program 10: In JSP, make your resume including html tags also.

Code:

<html>

<head><title>My CV </title></head>

<body>

<h1><b> Anjali</b></h1>
<address style="color:black;">[email protected]</address>

<h2 style="color:blue;">PROFILe</h2>

I am currently pursuing B Tech 3rd year in computer science and engineering.

<br> I am currently looking for an internship opportunity that allows me to


grow my skills alongside.<br>

<hr>

<h2 style="color:blue;">EDUCATION AND QUALIIFICATIONS</h2>

Name: Anjali

Registration Number:191380197

<table border="2" cellspacing="5" cellpadding="5" >

<tr>

<th>Qualification</th>

<th>Obtained Marks/GPA</th>

<th>College/School Name</th>

<th>Bord/University</th>

</tr

<tr>

<td>10th</td>

<td>9.2</td>

<td>Kendriya Vidyalaya</td>

<td>CBSE</td>

</tr>

<tr>
<td>12th</td>

<td>64%</td>

<td>Kendriya Vidyalaya</td>

<td>CBSE </td>

</tr>

<tr>

Name: Anjali

Registration Number: 191380197

<td>B.Tech(CSE) in progress</td>

<td>8.53</td>

<td>Delhi Global Institute of Technology</td>

<td>MDU</td>

</tr>

</table>

<hr>

<h2 style="color:blue;">TECHNICAL EXPERIENCE:</h2>

Languages: Python, Java, HTML,CSS, JavaScript <br>

Frameworks/ Libraries: Flask, Bootstrap, jQuery<br>

Databases/ Tools: SQL, MongoDB, Git & Github, Command Line

<hr>

<h2 style="color:blue;">PROJECTS</h2>
<strong style = "color:black;">Realtime multiclient chat app:</strong> An
extension used for research purpose. It uses picture in picture concept.<br>

<strong style= "color:black;">Dhirati Education's App:</strong> An E-Learning


app using Flutter and Dart.<br>

<strong style= "color:black;">Password Checker: </strong>It basically helps you


to check that how many times your password was hacked before, so that you
can change your password according to the information.<br>

Name: Anjali

Registration Number:191380197

<strong style = "color:black">Secrets:</strong> It's a website similar to whisper


app. In this, I have learned authentication.

<hr>

<h2 style="color:blue;">INTERNSHIP</h2>

1.App Developer at Dhirati Education.

<br>

2.Social Media Marketing intern at Fantastiqo.<br>

<hr>

<h2 style="color:blue;">COMMUNITY</h2>

Microsoft Student Ambassador

</body>

</html>
Name: Anjali

Registration Number: 191380197

You might also like