-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Branch_HW6' into 'main'
I think that's everything. Exponent order not working. See merge request sgraham1/cpts321-hws!3
- Loading branch information
Showing
20 changed files
with
341 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// <copyright file="AdditionNode.cs" company="Stephen Graham - 011706998"> | ||
// Copyright (c) Stephen Graham - 011706998. All rights reserved. | ||
// </copyright> | ||
|
||
namespace SpreadsheetEngine | ||
{ | ||
/// <summary> | ||
/// addition operator node. | ||
/// </summary> | ||
internal class AdditionNode : OperatorNode | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="AdditionNode"/> class. | ||
/// </summary> | ||
public AdditionNode() | ||
{ | ||
this.Precidence = 1; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override double Evaluate() | ||
{ | ||
return ExpressionTree.Evaluate(this.Left) + ExpressionTree.Evaluate(this.Right); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// <copyright file="DivisionNode.cs" company="Stephen Graham - 011706998"> | ||
// Copyright (c) Stephen Graham - 011706998. All rights reserved. | ||
// </copyright> | ||
|
||
namespace SpreadsheetEngine | ||
{ | ||
/// <summary> | ||
/// division operator node. | ||
/// </summary> | ||
internal class DivisionNode : OperatorNode | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DivisionNode"/> class. | ||
/// </summary> | ||
public DivisionNode() | ||
{ | ||
this.Precidence = 2; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override double Evaluate() | ||
{ | ||
return ExpressionTree.Evaluate(this.Left) / ExpressionTree.Evaluate(this.Right); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// <copyright file="ExponentNode.cs" company="Stephen Graham - 011706998"> | ||
// Copyright (c) Stephen Graham - 011706998. All rights reserved. | ||
// </copyright> | ||
|
||
namespace SpreadsheetEngine | ||
{ | ||
/// <summary> | ||
/// exponent operator node. | ||
/// </summary> | ||
internal class ExponentNode : OperatorNode | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ExponentNode"/> class. | ||
/// </summary> | ||
public ExponentNode() | ||
{ | ||
this.Precidence = 3; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override double Evaluate() | ||
{ | ||
return System.Math.Pow(ExpressionTree.Evaluate(this.Left), ExpressionTree.Evaluate(this.Right)); | ||
} | ||
} | ||
} |
Oops, something went wrong.