in C# i need to Add an operator*() method to the Fraction class created in Programming Exercise 11a so that it correctly multiplies two Fractions. The result should be in proper, reduced format. Demonstrate that the method works correctly in a program named FractionDemo2. my errors are he Fraction class operator*() method defined for Fraction class 4 0 out of 4 checks passed. Review the results below for more details. Checks Unit Test Incomplete Fraction's operator*() multiplication test 1 Build Status Build Failed Build Output Compilation failed: 1 error(s), 0 warnings NtTestac341aa4.cs(18,29): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) Test Contents [TestFixture] public class FractionClassMultiplyTest { [Test] public void FractionMultiplyTest() { Fraction f1 = new Fraction(5, 3, 9); Fraction f2 = new Fraction(16, 2, 7); Fraction res; res = f1 * f2; Assert.AreEqual(86, res.WholeNum); Assert.AreEqual(6, res.Numerator); Assert.AreEqual(7, res.Denominator); } } Unit Test Incomplete Fraction's operator*() multiplication test 2 Build Status Build Failed Build OutputCompilation failed: 1 error(s), 0 warnings NtTest1a622ccc.cs(19,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) Test Contents [TestFixture] public class FractionClassMultiplyTest { [Test] public void FractionMultiplyTest2() { Fraction f1 = new Fraction(2, 0, 1); Fraction f2 = new Fraction(4, 1, 8); Fraction res; res = f2 * f1; Assert.AreEqual(8, res.WholeNum); Assert.AreEqual(1, res.Numerator); Assert.AreEqual(4, res.Denominator); } } Unit Test Incomplete Fraction's operator*() multiplication test 3 Build Status Build Failed Build Output Compilation failed: 1 error(s), 0 warnings NtTest4e97e3d6.cs(18,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) Test Contents [TestFixture] public class FractionClassMultiplyTest { [Test] public void FractionMultiplyTest2() { Fraction f1 = new Fraction(1, 0, 1); Fraction f2 = new Fraction(4, 0, 1); Fraction res; res = f2 * f1; Assert.AreEqual(4, res.WholeNum); Assert.AreEqual(0, res.Numerator); Assert.AreEqual(1, res.Denominator); } } Unit Test Incomplete Fraction's operator*() multiplication test 4 Build Status Build Failed Build Output Compilation failed: 2 error(s), 0 warnings NtTest8dd488f5.cs(18,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) NtTest8dd488f5.cs(19,30): error CS1061: Type `Fraction' does not contain a definition for `FracString' and no extension method `FracString' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) Test Contents [TestFixture] public class FractionClassMultiplyTest { [Test] public void FractionMultiplyTest2() { Fraction f1 = new Fraction(0, 1, 1); Fraction f2 = new Fraction(0, 1, 1); Fraction res; res = f2 * f1; Assert.AreEqual(1, res.WholeNum); Assert.AreEqual("1", res.FracString()); } } my code is in the pictures
in C# i need to Add an operator*() method to the Fraction class created in Programming Exercise 11a so that it correctly multiplies two Fractions. The result should be in proper, reduced format. Demonstrate that the method works correctly in a program named FractionDemo2. my errors are he Fraction class operator*() method defined for Fraction class 4 0 out of 4 checks passed. Review the results below for more details. Checks Unit Test Incomplete Fraction's operator*() multiplication test 1 Build Status Build Failed Build Output Compilation failed: 1 error(s), 0 warnings NtTestac341aa4.cs(18,29): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) Test Contents [TestFixture] public class FractionClassMultiplyTest { [Test] public void FractionMultiplyTest() { Fraction f1 = new Fraction(5, 3, 9); Fraction f2 = new Fraction(16, 2, 7); Fraction res; res = f1 * f2; Assert.AreEqual(86, res.WholeNum); Assert.AreEqual(6, res.Numerator); Assert.AreEqual(7, res.Denominator); } } Unit Test Incomplete Fraction's operator*() multiplication test 2 Build Status Build Failed Build OutputCompilation failed: 1 error(s), 0 warnings NtTest1a622ccc.cs(19,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) Test Contents [TestFixture] public class FractionClassMultiplyTest { [Test] public void FractionMultiplyTest2() { Fraction f1 = new Fraction(2, 0, 1); Fraction f2 = new Fraction(4, 1, 8); Fraction res; res = f2 * f1; Assert.AreEqual(8, res.WholeNum); Assert.AreEqual(1, res.Numerator); Assert.AreEqual(4, res.Denominator); } } Unit Test Incomplete Fraction's operator*() multiplication test 3 Build Status Build Failed Build Output Compilation failed: 1 error(s), 0 warnings NtTest4e97e3d6.cs(18,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) Test Contents [TestFixture] public class FractionClassMultiplyTest { [Test] public void FractionMultiplyTest2() { Fraction f1 = new Fraction(1, 0, 1); Fraction f2 = new Fraction(4, 0, 1); Fraction res; res = f2 * f1; Assert.AreEqual(4, res.WholeNum); Assert.AreEqual(0, res.Numerator); Assert.AreEqual(1, res.Denominator); } } Unit Test Incomplete Fraction's operator*() multiplication test 4 Build Status Build Failed Build Output Compilation failed: 2 error(s), 0 warnings NtTest8dd488f5.cs(18,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) NtTest8dd488f5.cs(19,30): error CS1061: Type `Fraction' does not contain a definition for `FracString' and no extension method `FracString' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error) Test Contents [TestFixture] public class FractionClassMultiplyTest { [Test] public void FractionMultiplyTest2() { Fraction f1 = new Fraction(0, 1, 1); Fraction f2 = new Fraction(0, 1, 1); Fraction res; res = f2 * f1; Assert.AreEqual(1, res.WholeNum); Assert.AreEqual("1", res.FracString()); } } my code is in the pictures
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
in C# i need to
Add an operator*() method to the Fraction class created in Programming Exercise 11a so that it correctly multiplies two Fractions. The result should be in proper, reduced format. Demonstrate that the method works correctly in a program named FractionDemo2.
my errors are
he Fraction class operator*() method defined for Fraction class
4
0 out of 4 checks passed. Review the results below for more details.
Checks
Unit Test
Incomplete
Fraction's operator*() multiplication test 1
Build Status
Build Failed
Build Output
Compilation failed: 1 error(s), 0 warnings
NtTestac341aa4.cs(18,29): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error)
[TestFixture]
public class FractionClassMultiplyTest
{
[Test]
public void FractionMultiplyTest()
{
Fraction f1 = new Fraction(5, 3, 9);
Fraction f2 = new Fraction(16, 2, 7);
Fraction res; res = f1 * f2;
Assert.AreEqual(86, res.WholeNum);
Assert.AreEqual(6, res.Numerator);
Assert.AreEqual(7, res.Denominator);
}
}
Unit Test
Incomplete
Fraction's operator*() multiplication test 2
Build Status
Build Failed
Build OutputCompilation failed: 1 error(s), 0 warnings NtTest1a622ccc.cs(19,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error)
[TestFixture]
public class FractionClassMultiplyTest
{
[Test]
public void FractionMultiplyTest2()
{
Fraction f1 = new Fraction(2, 0, 1);
Fraction f2 = new Fraction(4, 1, 8);
Fraction res; res = f2 * f1;
Assert.AreEqual(8, res.WholeNum);
Assert.AreEqual(1, res.Numerator);
Assert.AreEqual(4, res.Denominator);
}
}
Unit Test
Incomplete
Fraction's operator*() multiplication test 3
Build Status
Build Failed
Build Output
Compilation failed: 1 error(s), 0 warnings
NtTest4e97e3d6.cs(18,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error)
[TestFixture]
public class FractionClassMultiplyTest
{
[Test]
public void FractionMultiplyTest2()
{
Fraction f1 = new Fraction(1, 0, 1);
Fraction f2 = new Fraction(4, 0, 1);
Fraction res; res = f2 * f1;
Assert.AreEqual(4, res.WholeNum);
Assert.AreEqual(0, res.Numerator);
Assert.AreEqual(1, res.Denominator);
}
}
Unit Test
Incomplete
Fraction's operator*() multiplication test 4
Build Status
Build Failed
Build Output
Compilation failed: 2 error(s), 0 warnings
NtTest8dd488f5.cs(18,28): error CS1061: Type `Fraction' does not contain a definition for `WholeNum' and no extension method `WholeNum' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error)
NtTest8dd488f5.cs(19,30): error CS1061: Type `Fraction' does not contain a definition for `FracString' and no extension method `FracString' of type `Fraction' could be found. Are you missing an assembly reference? FractionDemo2.cs(3,14): (Location of the symbol related to previous error)
[TestFixture]
public class FractionClassMultiplyTest
{
[Test]
public void FractionMultiplyTest2()
{
Fraction f1 = new Fraction(0, 1, 1);
Fraction f2 = new Fraction(0, 1, 1);
Fraction res; res = f2 * f1;
Assert.AreEqual(1, res.WholeNum);
Assert.AreEqual("1", res.FracString());
}
}
my code is in the pictures
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education