Space for google add

LAB COURSE II TYBCS- Assignment 4 | JAVA - csprogramx



 SET A

1. Define a class CricketPlayer (name, no_of_innings, no_times_notout, total_runs, bat_avg).

Create an array of n player objects. Calculate the batting average for each player using a static

method avg(). Handle appropriate exception while calculating average. Define a static method

“sortPlayer” which sorts the array on the basis of average. Display the player details in sorted

order.


2. Define a class SavingAccount (acNo, name, balance). Define appropriate constructors and

operations withdraw(), deposit() and viewBalance(). The minimum balance must be 500.

Create an object and perform operations. Raise user defined InsufficientFundsException when

balance is not sufficient for withdraw operation.


SET B

1. Define a class MyDate (day, month, year) with methods to accept and display a MyDate

object. Accept date as dd, mm, yyyy. Throw user defined exception “InvalidDateException”

if the date is invalid.

Examples of invalid dates : 12 15 2015, 31 6 1990, 29 2 2001

Post a Comment

0 Comments