68 472
Assignments Done
98,7%
Successfully Done
In December 2018

Answer to Question #15674 in C# for Zulekha

Question #15674
Create a console application with a class ‘Account’ having variables as id(int) and name (String).Add property ‘account-no’

which can be set andget. Add a ‘ReadOnly’ property ‘IntRate’ and ‘WriteOnly’ property‘Password’ for this class. Add a

shared property ‘Branch’ with set/get methods. In main method create objects of ‘Account’ and test these properties and

print the results on the screen.
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Account
{
& int id;
& string name;
& private int no_account;
& public void setNoAcc(int a) { no_account = a; }

& private int IntRate;
& public int getIntRate() { return IntRate; }

& private int password;
& public void setPass(int p) { password = p; }

& int branch;
& public void setBranch(int b) { branch = b; }
& public int getBranch() { return branch; }
}



class Program
{
& static void Main(string[] args)
& {
Account ac = new Account();
ac.setBranch(1);
Console.WriteLine(ac.getBranch());

ac.setNoAcc(12);
Console.WriteLine(ac.getIntRate());

ac.setPass(1123);
& }
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions