Notes
Notes - notes.io |
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assignment_3
{
internal class Program
{
static void Main(string[] args)
{
Account a = new Account(10102746, "Rahul", "saving");
a.Transaction("credit", 500);
a.Transaction("debit", 100);
Account a2 = new Account(13764762, "Alia", "salary");
a2.Transaction("debit", 20);
Student s = new Student(54, "Megh", "5a", 5, "branch", [ 94, 87, 23, 76, 78 ]);
Console.ReadLine();
}
}
public class Account
{
long Ac_No;
string CustomerName;
string AccountType;
string TransactionType;
double amount;
private double balance;
public double getBalance()
{
return balance;
}
public double credit(double amt)
{
balance = balance + amt;
return balance;
}
public void Transaction(string transtype, double amt)
{
if (transtype == "credit")
{
Console.WriteLine("The balance after crediting is :" + credit(amt));
}
else if (transtype == "debit")
{
Console.WriteLine("The balance after debiting is :" + Debit(amt));
}
}
public double Debit(double amt)
{
if (balance > 0)
{
balance = balance - amt;
return balance;
}
else
{
Console.WriteLine("Insuffient balance: ");
return 0;
}
}
public Account(long ac_No, string customerName, string accountType)
{
Ac_No = ac_No;
CustomerName = customerName;
AccountType = accountType;
Console.WriteLine("The accounts details are: ");
Console.WriteLine("Account No: " + ac_No + " ConstumerName: " + customerName + " Acc Type: " + accountType);
}
}
public class Student
{
int RolNo;
string name;
string Class;
int sem;
string branch;
int[] marks;
public void DisplayMarks(int[] m)
{
double avg = 0;
for (int i = 0; i <= m.Length; i++)
{
avg = m[i] + avg;
}
Console.WriteLine("The average marks is: " + avg);
}
public void PassFail(int[] m)
{
bool b = true;
for (int i = 0; i <= m.Length; i++)
{
if (m[i] < 35)
{
b = false; ;
}
}
if (b == true)
{
Console.WriteLine("Pass");
}
else
{
Console.WriteLine("Fail");
}
}
public Student(int rolNo, string name, string Class, int sem, string branch, int[] marks)
{
RolNo = rolNo;
this.name = name;
this.Class = Class;
this.sem = sem;
this.branch = branch;
this.marks = marks;
}
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team
