Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
🔒 NordVPN Premium – 3 Months
hrdilshan
Updated:
Yesterday at 8:29 PM
🚀 Microsoft Office 365 Pro Plus – Lifetime Access! 🚀
hrdilshan
Updated:
Yesterday at 8:28 PM
Linkedin Premium Business / Careere /Sales Navigator - 1/2/3/6/9/12 Months - Reddem Link
hrdilshan
Updated:
Yesterday at 8:27 PM
Colombo
YEYE 3 in 1 Instant Coffee Mix 50 Sachet
Romeshka
Updated:
Wednesday at 12:16 AM
Colombo
Red Hat Certified System Administrator (RHCSA) - RHEL 10
Sanjeewani95
Updated:
Jul 3, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
C++ podi help ekak.meka harida balannako
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Jim_Moriarty" data-source="post: 26317760" data-attributes="member: 570136"><p><span style="font-size: 22px">මචන්ලා මේක මන් කරලා තියෙනවා හරිද ?වැරදි තියෙනවනම් කියන්න.මේක මිට වැඩ හොදට කරන්න පුලුවන්නම් එකත් පොඩ්ඩක් කියන්න.</span></p><p></p><p><strong><span style="font-size: 15px">The part of a banking application has two classes Person and class Account_Holder. The attributes and functions of each class are given below. Assume the function ShowDetails() is a pure virtual function.</span></strong></p><p><span style="font-size: 15px"><strong>Write an object-oriented application using C++ to perform the following.</strong></span></p><p><span style="font-size: 15px"><strong>i. Set the NIC number, Account number of one account holder.</strong></span></p><p><span style="font-size: 15px"><strong>ii. Show the NIC number and Account number of the account holder overriding function showDetails() in the class Person.</strong></span></p><p><span style="font-size: 15px"><strong>Class Person:</strong></span></p><p><span style="font-size: 15px"><strong>NIC number</strong></span></p><p><span style="font-size: 15px"><strong>SetNIC() //set NIC number of the person</strong></span></p><p><span style="font-size: 15px"><strong>ShowDetails() //display NIC number of the person.</strong></span></p><p><span style="font-size: 15px"><strong>Class Account_Holder:</strong></span></p><p><span style="font-size: 15px"><strong>Account number</strong></span></p><p><strong><span style="font-size: 15px">SetAccountNumber() // set Account number of the account holder.</span></strong></p><p></p><p></p><p></p><p></p><p></p><p>[CODE]#include<iostream></p><p></p><p>using namespace std;</p><p></p><p></p><p></p><p>class person</p><p></p><p>{</p><p></p><p> public:</p><p></p><p> string nicnumber;</p><p></p><p> void setNic(string NIC)</p><p></p><p> {</p><p></p><p> nicnumber = NIC;</p><p></p><p> }</p><p></p><p> virtual void showDetails()</p><p></p><p> {</p><p></p><p> cout << "NIC NUMBER IS " << nicnumber << endl;</p><p></p><p> }</p><p></p><p>};</p><p></p><p>class Acount_holder : public person</p><p></p><p>{ </p><p></p><p> public:</p><p></p><p> int accountnumber;</p><p></p><p> void setAccountnumber(int n)</p><p></p><p> {</p><p></p><p> accountnumber = n ;</p><p></p><p> }</p><p></p><p> void showDetails()</p><p></p><p> {</p><p></p><p> cout << "Account number is " << accountnumber << endl;</p><p></p><p> }</p><p></p><p>};</p><p></p><p></p><p></p><p></p><p></p><p>int main()</p><p></p><p>{</p><p></p><p> person a;</p><p></p><p> a.setNic("930501352v");</p><p></p><p> a.showDetails();</p><p></p><p> Acount_holder b;</p><p></p><p> b.setAccountnumber(123);</p><p></p><p> b.showDetails();</p><p></p><p></p><p></p><p> return 0;</p><p></p><p>};[/CODE]</p></blockquote><p></p>
[QUOTE="Jim_Moriarty, post: 26317760, member: 570136"] [SIZE=6]මචන්ලා මේක මන් කරලා තියෙනවා හරිද ?වැරදි තියෙනවනම් කියන්න.මේක මිට වැඩ හොදට කරන්න පුලුවන්නම් එකත් පොඩ්ඩක් කියන්න.[/SIZE] [B][SIZE=4]The part of a banking application has two classes Person and class Account_Holder. The attributes and functions of each class are given below. Assume the function ShowDetails() is a pure virtual function.[/SIZE][/B] [SIZE=4][B]Write an object-oriented application using C++ to perform the following. i. Set the NIC number, Account number of one account holder. ii. Show the NIC number and Account number of the account holder overriding function showDetails() in the class Person. Class Person: NIC number SetNIC() //set NIC number of the person ShowDetails() //display NIC number of the person. Class Account_Holder: Account number[/B][/SIZE] [B][SIZE=4]SetAccountNumber() // set Account number of the account holder.[/SIZE][/B] [CODE]#include<iostream> using namespace std; class person { public: string nicnumber; void setNic(string NIC) { nicnumber = NIC; } virtual void showDetails() { cout << "NIC NUMBER IS " << nicnumber << endl; } }; class Acount_holder : public person { public: int accountnumber; void setAccountnumber(int n) { accountnumber = n ; } void showDetails() { cout << "Account number is " << accountnumber << endl; } }; int main() { person a; a.setNic("930501352v"); a.showDetails(); Acount_holder b; b.setAccountnumber(123); b.showDetails(); return 0; };[/CODE] [/QUOTE]
Insert quotes…
Verification
Hathara warak wissa keeyada? (Hathara wadi karanna 20)
Post reply
Top
Bottom