You are on page 1of 2
} KONERU taco, i : KSHMAIAI 7 H gad SOUCATION EouNDATION BRIAR +070 00 be Univeran, © lech - Bren Sem Semen Baergen ‘Academie Year:2019-2020 19¢s1203 - OBJECT ORIENTED PR paaed OGRAMMING Choice |Marks ico \CO 'COr ae BIL BIL. x keyword in java —~heensiooa's at | (eat an bse lass Bank’ wi an abstained 7 "getBalance $100, $150 and $200 are balances inbanks | | . B and C respectively. Bank’, BankB" || acs'cos, 5 id | 3} | _iesbsaes fis Ban ailtismenotby | umaslcO3> P| J lereating an object ofeach ofthe three classes. i | } { 5, eins progam tat emi neers TTT } |. —Jeommand line argument to main() method He inputs : Peay Tinteger: Develop he codetofandie ti | éamticot? 4 an - |Demonstrate a program for the implementation of thread 1 19 _ [by extending Thread clas. | [Create an class Entertainment, with an attibure Title and abstract methods seatingCapacity()rint and \ 1 ticketPrive():int. The classes Movie (with attribute {Gireetor'Steing), Drama (with atmbute wrterSwing)are ||) jsubciasses of Entertainment. Consider Movie has seating Is |capacity of 250 persons, with a fare of 200 per ticket, '5MarksiCO3'3 Drama has senting Capacity of 500 persons withticket | | ‘| price 100 per person. The EnterainmentDemo class hes i {Main © method to create 2 references of Entertainment ' | imma O dined with objects of Movie at Drama’snd — ) / (favoking the methods. {Develop a class Person with name and adress as StS Jattibates. The Employee class inherits the Person on ‘Ms ID, salary as atibutes. Write constructors in boss i | {clases to initialize the atibutes The EnpiyeDemo IsMensicos!s [3 | ass in() method that creates object 0 : [Barsoyee and mas details in the following format: ID: \ ty \Eoeltvame: ABC Adress: Guntur, AP Salar’ Rps i | (25000. ¢ prompts the user 10 en =F nue a program that prompts ts user 1 Ot [eta Te oan mo Cine pe user enters negative ABST oP 7 eo imainenetin Ce 8 | {defines Except ty per of Student ns 8. jarguments distinct names. _ Bit he number of ese spend ws Mert program to print only Uw Se of 4 td |A publishing company markets both audiocassette versions of its works. C k and | ublcation that stores the ttle (type ge ice | | ype Heat) of a publication. From ‘iene a price 7 |classes: Book, which adds a page count type int), and [lass Tape, which adds an atribue ime that denotes the | playing time in mi jpiay! ae re i in Le (type float), Each of these classes \P : pare ized constructor, toString() method. The | ee class has main() method whicl |isven with the following options: 1. Add new [Publication 2. Print details of ail publications {Develop a class Bank with getRateOflnterest() and [caleulateinterest( as its abstract methods and both return | double. It has the attributes principle and noOfYears as | 10, | attributes. The classes SBI and ICICI must implement the| [above methods. SBI has 7% and ICICI has 8% as interest i | | t i j jchoice | -10 | + | Irate, Create references to Bank and store details of both | | __|banks. Invoke the methods and display the data. i | Develop a program to create a class “Dictionary” that |contains the following information. (a) Name of a person (b) Mobile Number.. The setter method raise an ! {exceptions when name has any other characters apart | peeee | 11. [from lower- and upper-case alphabets and when mobile |echotce |ontarks| CO4)3 | mumber is negative or does not have 10 digits. The hea } | parameterized constructor calls the setters and throws the | |Exceptions. The main method of DictionaryDemo must \ {handle the exceptions. _ \ "Develop a Java class to Read data of Employees (with T lip, name, gender, salary as private instance members). | Draw the class diagram and define the parameterized constructor and format the output asID: 1234Name: |ABCGender: MaleSalary: $2400The main () method | nust be menu driven with the following options: Add | |New Employee2. Print all Employee deta ‘Store the data | __|iman ArrayList \ [object HTMLDivElement] orm — | | | | | |

You might also like