A bank maintains two types of operations Simple and Interest. Use Class Simple with the following specifications:This Java program models a bank system where it calculates simple interest and the total amount after applying interest. The program supports operations like deposit and withdrawal, and uses inheritance to extend the functionality of the Simple class into the Interest class. Read more
Class name: Simple Data members:void withdraw( ): to maintain the balance with withdrawl (balance - w) void deposit(int d): to maintain the balance with the deposit (balance + d) Data members:void calculate( ): Find simple interest and amount si = (balance*r*t)/100 a = a + si; void display( ): to print account number, balance, interest and amount. |
||||||||
Write a class program with the following specifications: Class name: matrixThis Java program accepts a 3x3 matrix, calculates the sum of each row and each column, and displays the results. The program uses methods in a Matrix class to handle the calculations and display the output. Read more
Class name: matrix Data members: void rowsum( ): to find and print the sum of the numbers of each row. void colsum( ): to find and print the sum of numbers of each column. |
||||||||
Write a program by using a class with the following specifications: Class name: salary Data members:This Java program calculates and displays the dearness allowance (DA), house rent allowance (HRA), and gross salary based on the inputted basic pay. The allowances are calculated as percentages of the basic pay. Read more
Class name: salary void display( ): to find and print the following- da = 30% of basic, hra = 10% of basic, gross = basic + da + hra |
||||||||
Write a program by using a class with the following specifications: Class name: factorialThis Java program uses a class Factorial to input a number and compute its factorial. The program handles both positive and negative inputs, displaying the factorial or a message if the input is invalid. Read more
Class name: factorial Data members:void fact( ): to find and print factorial of the number. |
||||||||
Use main class to operate the functions.This Java program uses a class Prime to input a number and check if it is a prime number. The program checks divisibility to determine if the number is prime and displays the result. Read more
Class name: prime Data members: void prime( ): to check and display the number is prime or not |
||||||||
Write a class with the following specifications: Class name: employeeThis Java program calculates an employee's salary based on basic pay, DA (50%), HRA (10%), Provident Fund (8.33%), and the final net salary. It uses inheritance to extend the Employee class and calculate the necessary salary components in the Salary class. The payslip is then displayed showing all details. Read more
Class name: employee Data members:Data members:da = 50% of basic hra = 10% of basic gross = basic + da + hra pf = 8.33% of (basic + da) net = gross - pf void display( ): to display the payslip |
||||||||
A company pays commission to its salesman on the sale value according to the following rates:This Java program calculates the commission for a salesman based on the sale value. The commission rates are 5%, 10%, and 15% for different sale ranges. The program takes a sale value, calculates the corresponding commission, and displays the result. Read more
Class name: salecom Data members:void commission( ): to find the commission void display( ): to display the commission |
|
Sale |
Commission |
|
Up to Rs. 1000 |
5% on sale |
|
Rs. 1001 to Rs. 2000 |
10% on sale |
|
Rs. 2001 and above |
15% on sale |
Read Answer
This Java program simulates a tollbooth system for a bridge, where good cars pay a toll of Rs. 5, and bad cars pass without paying. The program keeps track of the number of cars and the total amount collected from good cars.
Read moreRead Answer
This Java program defines a class Array to handle two integer arrays and performs operations like summing corresponding elements and finding the maximum of corresponding elements in the arrays.
Read moreRead Answer
This Java program defines a Stringopr class that calculates the length of a given string and counts the number of words in it using string manipulation techniques.
Read moreRead Answer
This Java program checks whether a number is a palindrome by reversing its digits and comparing it to the original number. It uses a class to handle the logic and user interaction.
Read moreRead Answer
This Java program implements a simple calculator with options for addition, subtraction, multiplication, division, displaying the result, and clearing the result. It uses a class to manage the calculations and interact with the user.
Read moreRead Answer
This Java program defines the Quad class to calculate and display the roots of a quadratic equation ax^2 + bx + c = 0 based on the coefficients entered by the user. The program computes the discriminant and determines whether the roots are real or not.
Read moreRead Answer
This Java program defines the Population class that calculates and displays the population of a country from 2001 to 2007 based on the initial population and annual growth rate.
Read moreRead Answer
This Java program defines the class Stringop, which encodes a string by shifting each character by two positions in the ASCII table and prints each word of the string on a separate line.
Read moreRead Answer
This Java program defines a class Stat that computes the mean of 10 integers and calculates the deviation of each number from the mean. The class accepts input, computes the mean, and displays the deviations for each number.
Read more
This Java program defines a class Arrange that arranges the characters of a given word in ascending order based on their ASCII values without using any built-in sorting techniques.
Read moreRead Answer
This Java program defines a class Calculate to determine if a number is a Prime Palindrome. It includes methods to check for primality, calculate the reverse of a number, and display the results.
Read moreRead Answer
This Java program defines a class hcflcm that calculates the HCF and LCM of two numbers using a constructor for initialization and a method to perform calculations. The Euclidean algorithm is used for HCF computation.
Read moreRead Answer
This Java program defines a Student class to calculate and display the maximum and average marks of a student based on input details, using a parameterized constructor and member methods.
Read moreRead Answer