+ 1
I need help to write this programming language
write complete C# application that defines the next : a. define class called "Fraction"  b. inside the class do the ulterior:  1. define an integer attributes called a,b,c,d  2. define void get method to print values of a,b,c,d  3. define void set method to take values of a,b,c,d 4 . define void method to add a/b  with c/d then print result 5 define void method to multiply a/b  with c/d then print result c. Inside the main function define and object to test the previous methods Â
4 Answers
+ 1
Here everything you need:
ï»żclass Fraction
{
static int a, b, c, d;
static void GetValues()
{
Console.WriteLine("Inputted values: ");
Console.WriteLine("a: " + a);
Console.WriteLine("b: " + b);
Console.WriteLine("c: " + c);
Console.WriteLine("d: " + d);
}
static void SetValues()
{
Console.WriteLine("Enter values: ");
Console.Write("a: ");
a = int.Parse(Console.ReadLine());
Console.Write("b: ");
b = int.Parse(Console.ReadLine());
Console.Write("c: ");
c = int.Parse(Console.ReadLine());
Console.Write("d: ");
d = int.Parse(Console.ReadLine());
}
static void AddThenPrint()
{
int sum = a / b + c / d;
Console.WriteLine("Sum: " + sum);
}
static void MultiplyThenPrint()
{
int prod = a / b * c / d;
Console.WriteLine("Product: " + prod);
}
static void Main(string[] args)
{
SetValues();
GetValues();
AddThenPrint();
MultiplyThenPrint();
}
}
An UpVote đ will be highly appreciated đđ
0
thank you
0
erwin mesias
0
No Problem Buddy đđȘđđ