c++

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

c++

Post by answerhappygod »

c++
C 1
C 1 (76.12 KiB) Viewed 35 times
C 2
C 2 (84.73 KiB) Viewed 35 times
C 3
C 3 (69.27 KiB) Viewed 35 times
2. Continuous of question 1. Implement operator overloading. Operator Overloading a) Implement two unary operator overload functions (−,+,!). b) Implement four arithmetic operator overload functions (+,−,∗,/). c) Implement six relational operator overload functions (==,!=,>,>=,<,<=). d) Implement the insertion operator overload function (≪<). e) Implement the extraction operator overload function (≫). f) Implement the subscript operator overload function ([]). Make sure that each function is optimally overloaded for its purpose. (pick between member, non-member, friend as appropriate) Notes Add Rational Numbers Given a/b+c/d : Step 1: Find the LCM of b and d. Step 2: Create a new Rational Number: ((a∗(LCM/b)+(c∗(LCM/d))/LCM. Step 3: Reduce the new Rational Number from step 2. Step 4: Return the new Rational Number. Subtract Rational Numbers Given a/b−c/d : Step 1: Find the LCM of b and d. Step 2: Create a new Rational Number: ((a∗(LCM/b)−(c∗(LCM/d))/LCM. Due date: Jul 17, 11:59 PM Step 3: Reduce the new Rational Number from step 2. Step 4: Return the new Rational Number.
Multiply Rational Numbers Given a/b * c/d : Step 1: Create a new Rational Number: (a∗c)/(b∗d). Step 2: Return the new Rational Number. Divide Rational Numbers Given a/b * c/d: Step 1: Create a new Rational Number: (a∗c)/(b∗d). Step 2: Return the new Rational Number. Compare Rational Numbers: greater than Determine if a/b>c/d : Step 1: Find the LCM of b and d. Step 2: If (a∗(LCM/b)>(c∗(LCM/d) return true, otherwise false. Compare Rational Numbers: less than Determine if a/b<c/d : Step 1: Find the LCM of b and d. Step 2: If (a∗(LCM/b)<(c∗(LCM/d) return true, otherwise false. Use following main function to test your program. (have to use this main function)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply