Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
123
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Rextester { public class bank { public String name; public int p, n; public void getdetails() { Console.WriteLine("Enter the Basic Information "); Console.Write("Enter the Customer Name: "); name = Console.ReadLine(); Console.Write("Enter the Principle: "); p = int.Parse(Console.ReadLine()); Console.Write("Enter the Number of Years: "); n = int.Parse(Console.ReadLine()); } } public class hdfc : bank { public int r; public float s; public void calc() { r = 6; s = (p * n * r) / 100; } } public class ios : bank { public int r; public float s; public void calc() { r = 5; s = (p * n * r) / 100; } } public class sbi : bank { public int r; public float s; public void calc() { r = 4; s = (p * n * r) / 100; } } class Program { public static void Main(String[] args) { hdfc h = new hdfc(); ios i = new ios(); sbi sb = new sbi(); h.getdetails(); h.calc(); i.calc(); sb.calc(); if ((h.s > i.s) && (h.s > sb.s)) { Console.WriteLine("HDFC Bank is the Best Bank For Giving More Interest"); Console.WriteLine("The Interest amount is: {0}", h.s); } else if (i.s > sb.s) { Console.WriteLine("IOS Bank is the Best Bank For Giving More Interest"); Console.WriteLine("The Interest amount is: {0}", i.s); } else { Console.WriteLine("SBI Bank is the Best Bank For Giving More Interest"); Console.WriteLine("The Interest amount is: {0}", sb.s); } Console.ReadLine(); } } }
run
|
edit
|
history
|
help
0
C# Programming Exercise 3
Generics
cs001
Hello world
30272 Program Ex1
BreakNum
Day1
Капча
gggsggsgg
work_laba#2