Skip to content

Latest commit

 

History

History

List Of Programs and Output for Experiment 3

student.java - Program to create a student class with name, roll no and marks of five subjects. Write functions to read and display the details.

Enter name of student: akku
Enter class of student: 12
Enter roll no of student: 2
Enter marks in 1st subject: 56
Enter marks in 2nd subject: 78
Enter marks in 3rd subject: 45
Enter marks in 4th subject: 23
Enter marks in 5th subject: 98

Displaying the student details

Name of the Student is akku
Class of the student is 12
Roll no of the Student is 2
Marks on 1st subject is  56
Marks on 2nd subject is  78
Marks on 3rd subject is  45
Marks on 4th subject is  23
Marks on 5th subject is  98

factorial_sum.java - Program with functions included within the main() class to find factorial and sum of digits of the number.

Enter the number:
15
sum :6
Factorial :2004310016

freq_reverse_String.java - Create a class with functions to find the frequency of a given character in a string and to reverse a given string. The functions should be invoked from the main().

Enter the string:
malayalam
Enter the character to be find the frequency: 
a
The character is present at position 2
The character is present at position 4
The character is present at position 6
The character is present at position 8
Frequency of character is 4
Reversed string is:malayalam

area_shapes.java - Write a Java program to calculate the area of different shapes namely circle, rectangle, and triangle using the concept of method overloading.

1.Circle/2.Rectangle/3.Triangle
Select an option(1/2/3) :
2
Enter the length :
5
Enter the breadth :
6
Area of Rectangle is:30

perimeter_shapes.java - Write a Java program to calculate the perimeter of different shapes namely circle and rectangle using the concept of constructor overloading.

Enter the radius of circle :
6
Enter the length of rectangle :
4
Enter the breadth of rectangle :
5
Perimeter of circle is:37.68
Perimeter  of Rectangle is:18

concat_string_number.java - Java program to concatenate two numbers and strings using method overloading concept.

Concated String=56
Concated String=Sarah Akku

Employee.java - Java program to create a class employee with details such as empno, name and phone number. Read details of at least 5employees and print

Enter the no of employees:
2

Enter the name of employee 1:
Akku
Enter the empno of employee 1:
101
Enter the phone no of employee 1:
1238743

Enter the name of employee 2:
Sarah
Enter the empno of employee 2:
102
Enter the phone no of employee 2:
237182

The details are:

Name of employee 1 is: Akku
Employee no of employee 1 is: 101
Phone no of employee 1 is: 1238743

Name of employee 2 is: Sarah
Employee no of employee 2 is: 102
Phone no of employee 2 is: 237182