Write a GUI that generates a multiplication or division table. A multiplication or division table is a useful tool for learning simple multiplication and division sums.
The class ExpenseLedger will record all the expenses you make. You record an expense by giving it a serial number, a description (that tells what it is about) and the money you spent on this item. So you need to create a class ExpenseItem with serial, description and amount. Provide constructors, getters and setters. Also provide toString for this class. Now in the ExpenseLedger class you need to build a collection that will hold the instance of ExpenseItem. Provide the following methods in the ExpenseLedger
1. void addExpense(description, amount): You should be able to figure out the serial of the expense yourself. This method will create an expense item and add it to the ledger.
In UG Boys Hostel Having 5 floors and each floor having 15 rooms. Consider you have to allocate the hostel room for students of IT department using hashing techniques (Hint: Key=201IT253). For only final year, one student per room and all other rooms are shareable at the maximum of three students per room. You may to use any strategy but must implement the separate chaining and Linear probing techniques in your solution.
Write a Java program that creates an Account object with an account ID of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and print the balance, the monthly interest, and the date when this account was created.
Demonstration and Viva will be carried out in week 13 during your respective seminar session.
You will be assessed on the working of the code as well as on your ability to explain the code.
Design a class named Account that contains:
A private int data field named id for the account (default 0).
A private double data field named balance for the account (default 0).
A private double data field named annualInterestRate that stores the current
interest rate (default 0). Assume all accounts have the same interest rate.
A private Date data field named dateCreated that stores the date when the account was created.
A no-arg constructor that creates a default account.
A constructor that creates an account with the specified id and initial balance.
The accessor and mutator methods for id, balance, and annualInterestRate.
The accessor method for dateCreated.
A method named getMonthlyInterestRate() that returns the monthly interest rate.
A method named withdraw that withdraws a specified amount from the account.
A method named deposit that deposits a specified amount to the account.
Draw the UML diagram for the class.
Implement the class.
output this in the console:
n=no. of items to sort
Sorting Algorithm | 1000 | 3000 | 5000 | 7000 | 9000 | 11000 |
BubbleSort |
SelectionSort | sorting time in
InsertionSort | millisecond
NOTE: do not display sorted items.
Use java method to find minimum among entered five numbers
Correct the following code make it run easily and explain each step that what is happening in the code.Also attach the picture of the code when you code successfully runs...
public class DLL {private Node start;private Node end;private int count;public DLL()
{start = end = null;count = 0;}
public void insertAtStart(Data d)
{Node tn = new Node(d, null, null);
if (count == 0) {start = end = tn;} else {tn.next = start;start.prev = tn;start = tn;}
count++;}
public void insertAtEnd(Data d) {if (count == 0) {insertAtStart(d);}
else {Node tn = new Node(d, null, end);
end.next = tn;end = tn;count++;}}
public void insertAt(Data d, int index) {if (count == 0 || index == 0) {insertAtStart(d);} else if (index >= count) {insertAtEnd(d);} else {Node temp = start;for (int i = 0; i < index; i++, temp =temp.next);Node tn = new Node(d, temp, temp.prev);
temp.prev.next = tn;temp.prev = tn;}}}
public class Node {Data d;Node next;Node prev;public Node(Data d, Node n, Node p) {this.d = d;next = n;prev = p;}}
Write an algorithm to find the total number of units of memory allocated/deallocated by the server one after processing all the request
The class ExpenseLedger will record all the expenses you make. You record an expense by giving it a serial number, a description and the money you spent on this item. So you need to create a class ExpenseItem with serial, description and amount. Now in the ExpenseLedger class you need to build a collection that will hold the instance of ExpenseItem. Provide the following methods in the ExpenseLedger
void addExpense(description, amount): You should be able to figure out the serial of the expense yourself. This method will create an expense item and add it to the ledger int removeSmallExpenses(double amt):This method will find the expense items that are smaller or equal to the amount amt and then remove these items from the list. Note that multiple items can be smaller than this value and thus each of these should be removed. Also this method should return the number of items removed. double totalExpenditure(): This method will calculate the total expenditure recorded in the ledger so far.