Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE USE OBJECT ORIENTED PROGRAMMING IN C# USING MICROSOFT VISUAL. *****PLEASE USE C#(C SHARP)***** thanks it's really appreciated for all the help Create a class

PLEASE USE OBJECT ORIENTED PROGRAMMING IN C# USING MICROSOFT VISUAL.

*****PLEASE USE C#(C SHARP)*****

thanks it's really appreciated for all the help

image text in transcribedimage text in transcribed

Create a class called Rational for performing arithmetic with fractions. Write an app to test your class. Use integer variables to represent the private instance variables of the class--the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should store the fraction in reduced form The fraction 2/4 is equivalent to 1/2 and would be stored in the object as 1 in the numerator and 2 in the denominator Provide a parameterless constructor with default values in case no initializers are provided. Provide public methods that perform each of the following operations (all calculation results should be stored in a reduced form) a) Add two Rational numbers. b) Subtract two Rational numbers. c) Multiply two Rational numbers. d) Divide two Rational numbers. e) Display Rational numbers in the form a/b, where a is the numerator and b is the denominator. f) Display Rational numbers in floating-point fomat. (Consider providing formatting capabilities that enable the user of the class to specify the number of digits of precision to the right of the decimal point.) Create a class Hugelnteger which uses a 40-element array of digits to store integers as large as 40 digits each. Provide methods 1. Input, 2. ToString, 3. Multiply, 4. Divide 5. Remainder 6. Add 7. Subtract and 8. IsZero. For comparing Hugelnteger objects, provide the following methods: 1. IsEqualTo, 2. IsNotEqualTo, 3. IsGreaterThan, 4. IsLessThan, 5. IsGreaterThanOrEqualTo and 6. IsLessThanOrEqualTo. Each of these is a method that returns true if the relationship holds between the two Hugelnteger objects and returns false if the relationship does not hold. In the Input method, use the string method ToCharArray to convert the input string into an array of characters, then iterate through these characters to create your Hugelnteger [Note: The .NET Framework Class Library includes type Biginteger for arbitrary sized integer values.] Write a console app to test your Hugelnteger class. Your app should allow the user to repeat for next sentence, and "END" to end the app execution

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

You need to do Financial analysis on the Merck & co. Inc

Answered: 1 week ago

Question

The Nature of Nonverbal Communication

Answered: 1 week ago

Question

Functions of Nonverbal Communication

Answered: 1 week ago

Question

Nonverbal Communication Codes

Answered: 1 week ago