algorithm to help michael find the length of the optimal path to deliver all the orders aa well as mark his attendance at the company's office
mini java project
Find out the area of three geometric shape: Circle, Triangle, Square. Give the user an option to select which geometric shape's area he/she wants to find out. Based on the choice take necessary input and find out the result. Use different area method for each geometric shape. Print the result in main method.
In a bank, different customers have savings account. Some customers may have taken a loan from the bank. So, bank always maintains information about bank depositors and borrowers.
Design a Base class Customer (name, phone-number). Derive a class Depositor (accno, balance) from Customer. Again, derive a class Borrower (loan-no, loan-amt) from Depositor. Write necessary member functions to read and display the details of ‘n’ customers.
Task 1: Write a Java Program which will determine whether a number is even or odd. Take the number as an input from the user. Perform the checking in a separate method other than main method. Print the results in main method.
Task 2: Find out the area of three geometric shape: Circle, Triangle, Square. Give the user an option to select which geometric shape's area he/she wants to find out. Based on the choice take necessary input and find out the result. Use different area method for each geometric shape. Print the result in main method.
Write a class InvalidCNICException that extends Exception class.
The class should have following details implemented
– A message property.
– override following method that returns message
String toString()
– Two constructors
1. With no parameter
2. With String parameter
Take user input for CNIC. The CNIC is considered valid if
1. The length of CNIC is 15(including -)
2. if the hyphen(-) is present at position 6 and 14.
Generate (throw) InvalidCNICException when an invalid CNIC has been entered by the user. Handle this exception by giving user a responsive message saying "The CNIC you entered is not valid
Write a java code for online food delivery system to manage the data of customers who order the food using online application. User have different option for the payment i.e. Credit Card, Debit Card and Cash on Delivery. Credit card user get 10% discount on total bill, debit card customers get 7% discount while cash on delivery customers get 5% discount. Other than food bill each user have to pay delivery charges RS. 100/-.
Carefully think about number of classes and attribute for each class. All attributes of classes must be private and exposed via getter and setter. For all classes, create fully parameterized constructor.