Program

import java.util.Scanner; import java.text.DecimalFormat; public class MobileBill { public static void main(String[]args){ final double lcalls = 0.10; final double icalls = 1.00; final double net = 500.00; double localcalls, ISDcalls, totallocalcalls, totalISDcalls, netbill, totalnetbill,totalbill; Scanner keyboard = new Scanner(System.in); DecimalFormat df = new DecimalFormat("0.00"); System.out.println("Please Enter your local calls in minutes: "); localcalls = keyboard.nextDouble(); … Continue reading Program

Write a java program to find the factorial of a number using interface concept.

Program: import java.util.Scanner; public class Main { //Driver Code public static void main(String[] args) { //Take input from the user Scanner sc = new Scanner(System.in); System.out.println("Enter the number :"); int num = sc.nextInt(); //Input the number if(num>=0) { //Call a recursive function to find the factorial int factorial=findFactorial(num); System.out.println("The factorial of the entered number is … Continue reading Write a java program to find the factorial of a number using interface concept.

Write a Java Program to create an abstract class named Shape that contains two integers andan empty method named printArea(). Provide three classes named Rectangle, Triangle andCircle such that each one of the classes extends the class Shape. Each one of the classescontains only the method printArea() that prints the area of the given shape.

Program: import java.util.*; abstract class shape { int x,y; abstract void area(double x,double y); } class Rectangle extends shape { void area(double x,double y) { System.out.println("Area of rectangle is :"+(x*y)); } } class Circle extends shape { void area(double x,double y) { System.out.println("Area of circle is :"+(3.14*x*x)); } } class Triangle extends shape { void … Continue reading Write a Java Program to create an abstract class named Shape that contains two integers andan empty method named printArea(). Provide three classes named Rectangle, Triangle andCircle such that each one of the classes extends the class Shape. Each one of the classescontains only the method printArea() that prints the area of the given shape.

Write a Java program that keeps a number from the user and generates an integer between 1 and 7and displays the name of the weekday.Test DataInput number: 3Expected Output :Wednesday

Program: import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Input number: "); int day = in.nextInt(); System.out.println(getDayName(day)); } // Get the name for the Week public static String getDayName(int day) { String dayName = ""; switch (day) { case 1: dayName = "Monday"; break; case 2: … Continue reading Write a Java program that keeps a number from the user and generates an integer between 1 and 7and displays the name of the weekday.Test DataInput number: 3Expected Output :Wednesday

Write a java program that implements a multi-threaded application that has three threads. First thread generates a random integer every 5 second and if the value is prime, second thread computesthe square of the number and prints and if the value is odd, the third thread will print the value of cube of the number.

Program: import java.util.Random; class Square extends Thread { int x; Square(int n) { x = n; } public void run() { int sqr = x * x; System.out.println(“Square of ” + x + ” = ” + sqr ); } } class Cube extends Thread { int x; Cube(int n) {x = n; } public … Continue reading Write a java program that implements a multi-threaded application that has three threads. First thread generates a random integer every 5 second and if the value is prime, second thread computesthe square of the number and prints and if the value is odd, the third thread will print the value of cube of the number.

Polymer Memory

Semiconductor memory is a digital electronic semiconductor device used for digital data storage, such as computer memory, where data is stored within metal–oxide–semiconductor (MOS) memory cells on a silicon integrated circuit memory chip. Silicon Shortage A metal made from the second-most abundant element on Earth has become scarce, threatening everything from car parts to computer chips … Continue reading Polymer Memory