Your SlideShare is downloading. ×
Week 1 assignment
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Week 1 assignment

193

Published on

Published in: Education, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
193
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Week 1 – AssignmentQ1. Create a Console Application having a base class Parent and another derived class Child. In Parent class declare a member variable parentString, one unparametrized constrctor displaying amessage “Parent Constructor”, one more constructor accepting one string paramenter and displayingthat string and one void function print displaying a message “I am a parent class”.In Child class create a constructor using base class constructor, displaying “Child Constructor” and a printfunction displaying “I am a child class”.In main function create an object of Parent and Child classes and call their print function.Q2. Create a class Book with member variables string Title, string Authors, decimal Price and boolPaperback. Create a constructor taking four arguments for initializing all four member variables.Create another class BookDB to maintain the book database having an array list as member variable anda public function AddBook to add a book to the array list.Create a Test class to initialize the database with some books and print all the title of paperback booksalong with their average price.

×