Java Assignment

=====>CBPCC college<==========

  1. Write a java program to reverse a number.
  2. Write a java program generate fibonacci series.
  3. Write a Java program that takes a number from the user and checks it is
    palindrome or not.
  4. Write a Java program that accepts array of 10 integers from user and
    displays all prime numbers from it.
  5. Write a Java program that accepts 3 X 3 matrix from the user and finds the
    sum of each row of this matrix.
    (Note: In all above programs, take input from the user ) .
  6. Create a superclass, Student, and subclass, Grade.
    The superclass Student should have data members: name, ID, age, address.
    The superclass, Student should have at least one method: findGrade(double
    percent)
    The purpose of the findGrade method is to take one parameter, percent
    (value between 0 and 100) and find grade.
    In the Student class this method should be empty as an abstract method. The
    Grade will inherit all data members of the Student class and override the
    method findGrade. Create a test class for above two classes. In the test class,
    create Grad object. For an object, provide percent and find grade and display
    the results of the findGrade method.
  7. Create following classes
    Publisher class contains
    Variables :Pubid, Pubname
    Method :setPublisher() sets details of a publisher
    Book class inherits Publisher class and contains
    Variables :Bookid, BookName, Author
    Method :setBookDetails() sets the details of a book
    Method :getBookDetails() gets details of a book
    Create a main() that will use above classes and display details about
    publisher and book.
  8. Create two classes called income and expenditure. The income class
    contains (salary,allowance,rent) and the expenditure class contains
    (food,clothing,educational). Create a Budget class which uses the above
    classes and also, calculate savings of the family.
  9. WAP to accept a string and count total number of uppercase and lowercase
    characters in a string.
  10. WAP to accept multiple strings and arrange them in ascending order.
  11. WAP to find all rotations of a given string.
    e.g. Java –→ Java, avaJ,vaJa,aJav
  12. WAP to accept a string and rewrite it in alphabetical order.
    e.g. COMPUTER — > CEMOPRTU
  13. Create a class that contains a string variable called Name. Write and
    implement methods
    To convert all characters in Name to uppercase.
    To display name in reverse order.
  14. WAP to inputs a string array as member array. Define
    method to do the following
    Insert string at nth position.
    Search for a particular word in the string. Count total occurrence.
    Delete the portion of a string at a specified position.
  15. WAP to input string through command line and check each command line
    inputs and display only those strings which are in uppercase until any lower
    case string found
  16. Create a user defined exception to check whether your employee exist in an
    array or not, throw exception if name is not in the employees list. Use the
    catch and finally block to display an appropriate message.
  17. WAP to accept 5 command line arguments and then raise custom exception
    if any argument is not from the list
    (“BCA”,”MCA”,”BBA”,”MBA”,”OTHER”).
  18. WAP to throw a user defined exception when a user enters floating point
    number.
  19. Create an applet which displays triangle in circle. Set the background color
    of an applet by passing parameter. Also, display objects in different colours.
    Display date in triangle.
  20. Create an applet to display an object (circle, rectangle or any other object) N
    number of times. N is given by user as a parameter.
  21. Create an applet to draw a house. And fill with different colours.
  22. WAP to simulate a Digital clock using Thread.
  23. Write an application that executes three threads from one thread class. One
    thread displays “JAVA” every one second, second thread displays
    “RDBMS” every two seconds and third thread displays “VB.NET” every
    three seconds. Create the thread by using Runnable interface.
  24. Write a program to implement Singly linked list.
  25. Write a program to implement Singly circular linked list.

====>SDJain<=======

  1. Write a Java Program to Find the Largest Among Three Numbers.
  2. Write a Java Program to Check Whether a Character is Alphabet or Not.
  3. Write a Java Program to Display Alphabets (A to Z) using loop.
  4. Write a Java Program to Check Whether a Number is Prime or Not
  5. Write a Java Program to print Pascal triangle.
  6. Write a Java Program to display Fibonacci series using loops.
  7. 7. Write a Java Program to make a calculator using switch case.
  8. Write a Java Program to display grades of Student using switch case. (Note : if marks>90 then grade A, if marks>80 and marks <90 then grade B, : if marks >60 and marks<80 then grade C, if marks>35 and per<60 ,then grade D,if marks<35 grade F)
  9. Write a Java Program to Swap Two Numbers.
  10. Write a Java Program to count vowels and consonants in a String.
  11. Write a Java Program to find simple interest.
  12. Write a Java Program to calculate compound interest.
  13. Write a Java Program to create STUDENT class having data members roll
    no and name. Create 5 objects of STUDENT class and take input from the
    user and print all students’ data in ascending order of name with interval of 1 second.
  14. Write a Java Program that accepts string data. Extract either All Vowels or
    All Non-Vowels from given Data According to Options Selection. Also
    Provide an Option to Display Output in Uppercase or Lowercase.
  15. Write a Java Program to demonstrate inheritance. Create a supper class Pizza and
    create below sub classes.
    a. Margherita
    b. Onion pizza
    c. Paneer pizza
    d. Tomato pizza
    e. Capsicum
  16. Write a Java Program to create an applet which displays a Triangle within a circle
    where the circumference of the circle touches to the all the vertices of the triangle.
    Provide different colors to both the objects.
  17. Write a java program to draw smiley with colour using applet
  18. Write a program that accept two strings or two numbers from command
    line and create overloaded method that add these two numbers or
    concate two strings.
  19. Write a java program to create an applet which displays triangle in circle. Set
    background color of an applet by passing parameter.
  20. Write a program which accept title, author, publishers, price and number of pages
    of N books from the user and display details of book in descending order of
    number of pages at an interval of 1 second using
    thread.
  21. Write a program that accept a string from command line and arrange all cemoprtu
  22. Write a program to create interface area. Create 3 classes called rectangle, triangle and square .Calculate areas respectively
  23. Write a Java program to perform employee payroll processing using packages. Inthe java file, Emp.java creates a package employee and creates a class Emp. Declare the variables name, empid, category, basic_pay, hra, da, netpay, pf, grosspay, income_tax, and allowance. Calculate the values in methods. Create another java file Emppay.java. Create an object e to call the methods to perform and print values.
  24. Write a java Program to multiply two Numbers. Take values by constructor. Create one constructor with parameter and create one constructorwithout parameter.(Use of constructor overloading).
  25. Write a Java Program to check string is palindrome or not. Accept input from user.

====>C.K.pithwala<=====

  1. Write program to print “My First Java Program”.
  2. Write program to find the area and circumference of a circle.
  3. Write program to find the simple interest for the given data.
  4. Write program to swap the content of two variables without using third
    variable.
  5. Write program to check whether given number is odd or even
  6. Write program to convert Fahrenheit to Centigrade.
  7. Write program to define two different classes in a single java file to find area of
    Room.
  8. Write program to display the number of days in a given month using switch
    statement.
  9. Write program to accept two integers from user through command line and
    display addition of two integers.
  10. Write program to print the factorial of a number.
  11. Write program to print the Fibonacci series up to a given number.
  12. Write program to print the multiplication table of a given number.
  13. Write program to check whether the given number is palindrome or not.
  14. Write program to print the Pascal triangle.
  15. Write program to find the Armstrong numbers between 100 and 1000.
  16. Write a program that will print your Name, Address, and Mobile numbers as
    an output.
  17. Write a program that will calculate summation of numbers stored at even
    locations and summation of numbers stored at odd locations in an array with 10 elements.
  18. Write a program that will calculate summation of two 3X3 matrix.
  19. Write a program that will calculate multiplication of two 3X3 matrix.
  20. Write a java program to implement the abstract keyword and method overriding
  21. Write a java program to implement the constructor overloading.
  22. Write a java Program to Implement Dynamic (super class) method dispatch
    (Runtime Polymorphism).
  23. Write a java program to show the use of This Keyword and Constructor
    Overloading.
  24. Write a java program to invoke constructors using “Super” Keyword.
  25. Write a program that will create a base class publisher with fields id and name. Create another class book which inherits publisher class with its member variable. author name, book name and price. Write a method named search and display that will perform appropriate task.
  26. Create class called “stud” which contains instance variable rollno, name of student,
    class. Store “stud” class in package name p1. Extend class “result” from “stud”
    which contains instance variable marks in java, marks in unix, and marks in os.
    Store class “result” in package name p2, which is resided in package name p1.
    Write a java code to run main method and display that contain of student in
    following format.
    bca college_____
    roll no: name :
    class :
    java : unix : os :
    total :
  27. WAP to create an interface Shape which defines two methods area and circumference .Create two classes Rectangle and Circle which implements the interface Shape.
  28. Write a program to accept a string and count total number of uppercases characters and lowercase characters in a string.
  29. Write a java code which will read a string and rewrite it in alphabetical order.eg. the word COMPUTER should be written as CEMOPRTU
  30. WAP that will find out the total number of vowels from a string.
  31. WAP that will calculate total occurrence of each character in a string.
  32. Write a program to display simple shapes like line, rectangle, round rectangle, oval and arc both filled and hollow on an applet.
  33. Write applet program to display digital clock with day, month and year on the applet.
  34. Write an applet which takes number as parameter it is odd print the number in red color otherwise in green
  35. W.a.p to implement smiley face using applet.
  36. Design a class mystring having a data member of type string and add member functions to achieve following task: 1.compare string 2.string in toggle case 3.extract N character from right end of the string
    w.a. menu driven program to call all this methods of mystring class. Program should
    not terminate abruptly.
  37. Create an applet which display triangle in circle. Set background colour of an applet by passing parameter.

=====>SHREE UTTAR GUJARAT<======

  1. Write a program to check whether a number is Palindrome or
    not.
  2. Write a java application which accepts a string and the string in
    reverse order by interchanging its odd position character with
    even position character. Example: input : JAVA Output: AJAV
  3. .Write a menu driven program that accept a String and perform various operations without using String functions. Uppercase, Lowercase, Toggle case, Title case, Display all Vowel, Display all Non-vowels .
  4. Write a program to accept sentences using StringBuffer. Count total number of Characters, Sentences and Words.
  5. Create a Class Student give data members roll no, name, classand marks of three subjects(JAVA, .NET, IOT). Create member functions for calculating percentage and grade.Display result of at least 5 students.
  6. Design a class Cricketer having data member name and number of matches and appropriate member function to set the values. Derive two classes Batsman and Bowler from Cricketer class with data member total no of runs and wickets respectively. Batsman class is having a method to calculate average run rate and bowler class is having method to calculate average wicket. Write a program to create two objects and displays information of one batsman and bowler along with average run and wicket
  7. Create package stores. Under it create a class called stock with member variable (item_no, item_name, stock_availible, and cost). Under the default package create a class called sales with field name (qty_sold) and it is the child class of stores class. Write a program to print the current stock of each item and perform addition.
  8. Write a program to create an interface Area. Create three classes called Rectangle, Triangle and Square and calculate areas respectively.
  9. Write a java application which accepts 10 names of student and their age. Sort names and age in descending order. Display the names of students using thread class at interval of one second.
  10. Write a program that accept Book information like Title, Author, Publication and Price for n books from the user and display books in descending order with interval of 1 second with Thread.
  11. Write a program to accept five command line arguments and then raise custom exception if any argument is not from the following List: (“BCA”,”MCA”,”BBA”,”MBA”,”Other”) Set Exception message(“Argument not in the List”)
  12. Write an applet program to Display a Solid square having Red color Display name of your college within the square with font style= “Times New Roman”, font size= 12 and Font color=yellow”.
  13. Write an applet program that gets no of rectangles from the user (param tag) and draw the rectangles in different positions.
  14. Write an applet that simulates Digital Clock displaying in theform Hour:min:sec.
  15. Create a Class Student which contains instance variables rollno, name, class. Store Student class in package p1.Extend class result from student which contains instance variables marks in JAVA, VB.NET and IOT. Store result class in package P2 which resides in package P1.Write a java code to run a main method and display the student information in following format. Shree Uttar Gujarat BCA College Roll No:_______ Name: __ Class : _____Marks in: JAVA :_____ .NET :_______ IOT :_______
  16. Write a program to create singly Link List and perform following operations: (i).Insert a node at desired Location.(ii)Delete a node from given Location.(iii)Update desired Location.(iv)Search (v).Display
  17. Write a program to create singly circular Link List and perform
    following operations: (1).Insert a node at beginning. (2).Insert a node at End.(3).Delete First node.(4).Delete Last node. (5)Display.

=====>SMT. TANUBEN & DR. MANUBHAI TRIVEDI COLLEGE OF INFORMATION SCIENCE, SURAT<=======

  1. Write a program that accepts a positive number from the user. Covert number into words.
  2. Write a program which accepts a positive number from the command line and displays factorial
    of it using UDF.
  3. Create a jagged array of type String to store list of primitive and non-primitive data types of java.
    Use static allocation of array. Display all java data types in proper format.
  4. Design a class to demonstrate constructor overloading, also add at least one member function.
    Write a program to create various objects of that class and call its member function.
  5. Write a menu driven program to calculate Perimeter and Area various 2-dimentional geometric
    shapes based on user’s choice using the concept of class and interface.
    ==========Geometrical Menu===========Perimeter (i)Circle (ii)Square (iii).Rectangle (iv).Triangle (2).Area (i)Circle (ii)Square (iii)Rectangle (iv).Triangle (3).Exit
  6. Write a program that accepts a positive integer from the user and displays octal equivalent of that number.
  7. Write a program that accepts a sentence from the user. Perform following operations based on
    user’s choice.
    a) Uppercase
    b) Reverse the String c) Toggle case d) Sentence Case.
  8. Design Book class with appropriate data members. Add parameterized constructor in it and
    override toString( ) method in it. Write a menu driven program that creates N objects of the Book
    class and perform following operations on it.
    a) Displays all Books
    b) Displays books published by ‘BPB’
    c) Displays books whose title starts with ‘Data’
    d) Arrange book details in ascending order of their price
    e) Exit
  9. Consider following hierarchy. Design necessary interface and classes. Square, circle and rectangle class have parameterized constructor. Write a program that calculates area based on user’s choice. Give shape name as a choice to the user.

10. Write an applet code to draw following objects. Format it properly.
● Sad Face
● Displays solid right angle triangle
● Draw triangle inside the circle where edges of the triangle are on the circumference of the
circle. Display your name inside the triangle. Provide different colors.

11.

  1. Write an applet code that passes two integers using parameter tag. Display addition of these
    numbers in proper format.
  2. Write a program that accepts a number from the command line and displays individual digit at an interval of 2 second.
  3. Write an applet code to simulate Digital Clock.
  4. Write a program that accepts Book title. Publisher, author and price of N books. Display details of books in the descending order of their price at an interval of 1 second using thread.
  5. Write a java program to create and display Singly Linked List and perform following task:
    a) Display linked list
    b) Insert node at end
    c) Insert node at specified position
    d) Delete node from specific position


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *