Interviews Questions, Algorithms, Aptitude, C Interview Program, C Theory Question, Aptitude Tricks, Test Series,

Monday, 25 February 2019

Aptitude Hack#3(26-2-19)

Question: A can do a work in 15 days and B in 20 days. If they work on it together for 4 days, then the fraction of the work that is left is : A.1/4 B.1/10 C.7/15 D.8/15 ...

Sunday, 24 February 2019

Apti Hack#2(25-2-19)

Question: The present age of Vinod and Ashok are in the ratio of 3:4 respectively. After 5 years, the ratio of their ages becomes 7:9 respectively. What is Ashok’s present age is? A 40 years B 28 years C 32 years D 36 years ...

Saturday, 23 February 2019

Extra Program #1(Awt) [ IA-1 3 B) ]

Question: The program should display the message "Successfully Submitted" on the console when clicked on the "Submit" button and the text should get cleared when the user clicks on "Clear" button. Program: import java.awt.*; import java.awt.event.*; public...

Fifth Week Term Work Program 4

Question Program: import java.awt.*; import java.awt.event.*; public class Registrationform { public static void main(String[] args) { Frame f = new RegistrationFrame("Registration Form"); f.setSize(260, 200); f.setVisible(true); } } //Frame...

Fifth Week Term Work Program 3

Question Program: //Displays a frame containing a three CheckBox. Tick the //CheckBox causes the background of the frame to change from //white to define color. import java.awt.*; import java.awt.event.*; import javafx.scene.control.CheckBox; public...

Fifth Week Term Work Program 2

Question Program: //Displays a frame containing a three button. Pressing the //button causes the background of the frame to change from //white to define color. import java.awt.*; import java.awt.event.*; import java.awt.Button; public class threecolor { public...

Fifth Week Term Work Program 1

Question  Program://Displays a frame containing a single button. Pressing the//button causes the background of the frame to change Color Randomly  import java.util.Random;  import java.awt.*; import java.awt.event.*; //Driver classpublic class ChangingColor...

Sunday, 17 February 2019

Introduction

This Blog has been created keeping in mind all the difficulties faced by me and my friends during Practical Sessions. So, considering all the aspects this Blog Java Term work: I will share the best possible solution of Advance Java Lab Term Work and Other important possible java Program as per the interview point of view. I hope...

Fourth Week Term Work Program 3

3) Write a Java Program that creates an AWT window that should produce the following output when executed: Program: import java.awt.*;import java.awt.event.*;public class awtsecond extends Frame{ Button button1,button2,button3; List l1; TextField t1; Label l; Checkbox...

Fourth week Term Work Program 2

2) Write a Java Program that creates a SWING window with the following attributes:a. Dimensions of the window: 500X400b. Initial position of the window: (150, 150)c. Name of the window: My First SWING Framed. Add a button named “Cancel” to the windowe. On pressing “X” button,...

Fourth Week Term Work Program1

1) Write a Java Program that creates an AWT window with the following attributes:a. Dimensions of the window: 500X400b. Initial position of the window: (150, 150)c. Name of the window: My First AWT Framed. Add a button named “Cancel” to the windo...

Wednesday, 6 February 2019

THIRD WEEK TERM WORK Program 4

4) Write a Java program that implements bounded buffer problem (consider a circular queueand single producer and consumer threads). import java.util.Scanner; class Qb { int n; int a[] = new int[5]; boolean valueSet = false; private Scanner s; int front = -1; int rear = -1; int result; synchronized int get() { while (!valueSet) try...

THIRD WEEK TERM WORK Program 5

5) Write a Java program that simulates deadlock condition using threads. Program: public class DeadLockThread {    public static Object L1 = new Object();    public static Object L2 = new Object();        public static void main(String args[]) {       ThreadDemo1 T1 = new ThreadDemo1(); ...

THIRD WEEK TERM WORK Program 3

3) Write a Java Program that simulates Client-Server Interaction using threads.Methodology: Two threads should be created; one thread should act as Server, and the otherone should act as Client. The Server thread should accept a String request from Client thread,parse that request and print the length of the string. It should also send back theacknowledgement...

THIRD WEEK TERM WORK Program 2

2) Write a Java program that implements producer consumer problem (consider a singleresource slot and single producer and consumer threads). import java.util.Scanner; //A correct implementation of a producer and consumer. class Q { int n; int a; boolean valueSet = false; private Scanner s; synchronized int get() { while (!valueSet) ...

Tuesday, 5 February 2019

THIRD WEEK TERM WORK Program 1 (1b)

Question: Write a Java program that uses threads to compute multiplication of two matrices. The program should perform multiplication of matrices of arbitrary order. Also, proper errorhandling mechanism should be used.Methodology: Matrix multiplication is implemented using the formula: Cij = Aik * Bkj.This formula is used for generating each element...

Saturday, 2 February 2019

SECOND WEEK TERM WORK Program 4 [ IA-1 1 A) ]

4) A chemical company named “XYZ” manufactures various chemicals. To automate andmonitor the manufacturing process, they are planning to install an “AutomatedManufacturing and Maintenance System”. One important task of this system is to monitorthe temperature of the furnace. If the temperature of the furnace rises above 2000C, then itshould immediately...

SECOND WEEK TERM WORK Program 2

2) Write a Java Program that takes two strings as command-line arguments and checks whetherboth command-line arguments are equal or not. If they are equal then print proper message;otherwise generate a used-defined exception StringNotEqualException. package exception2; class StringNotEqualException extends Exception { public StringNotEqualException(String...

FIRST WEEK TERM WORK Program 1

1) Write a Java Program that implements a Queue using OOP concepts. package Program1; import java.util.*; class Queue { public int Q[]; public int top; public int rear = 0; Queue(int size) { Q = new int[size]; top = -1; rear = 0; } public void EnQueue(int item) { if (top == Q.length - 1) { System.out.println("Queue overflow"); ...

FIRST WEEK TERM WORK Program 3

3) Using the concept of interface, write a Java Program that calculates and prints the areas of triangle, square and rectangle. package Program3; interface shapes { abstract void print(); abstract void calc(); } class triangle implements shapes { public int a, b, area; triangle(int p, int q) { a = p; b = q; } public...