+ 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  

10th Jul 2016, 6:53 PM
abud bani irshaid
abud bani irshaid - avatar
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 😁😂
11th Jul 2016, 9:20 AM
Erwin Mesias
Erwin Mesias - avatar
0
thank you
13th Jul 2016, 4:11 AM
abud bani irshaid
abud bani irshaid - avatar
0
erwin mesias
13th Jul 2016, 4:12 AM
abud bani irshaid
abud bani irshaid - avatar
0
No Problem Buddy 😁đŸ’Ș👍👌
23rd Aug 2016, 4:30 PM
Erwin Mesias
Erwin Mesias - avatar