Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your objective is to ensure that all defined unit tests pass. No changes to the unit tests or form are permitted. The only two classes

Your objective is to ensure that all defined unit tests pass. No changes to the unit tests or form are permitted. The only two classes that require completion are ArrayFunctions.cs and MathFunctions.cs. Skills Used: reinforce C# fundamentals, file handling, unit tests, arrays, using existing classes User Experience:

1. At Startup, the user may utilize the mathematical functions or array manipulation functions

2. If a user selects the mathematical functions, he or she may:

a. Add two numbers b. Subtract two numbers c. Multiply two numbers d. Divide two numbers e. Calculate the modulus of two numbers

f. Calculate raising a number to a power g. Display Error when an invalid calculation is performed

3. If a user selects the array functions, he or she may: a. Store the current state of the 5 data values to a persistent file b. Load the state of the 5 data values from a persistent file

c. Randomize the results on the screen d. Shift the displayed items to the right with the right-most item becoming the first item

e. Shift the displayed items to the left with the left-most item becoming the last item f. Reverse the order of the items displayed

4. No input validation is performed on the input boxes, so a user could enter any textual entry. This is accounted for in the unit tests present in the project files. Project Instructions

Here is the code in C# for MathFunctions.cs

namespace PFW.CSIST203.Project1.Functions { public class MathFunctions { private log4net.ILog logger = log4net.LogManager.GetLogger(typeof(MathFunctions)); internal static readonly string ErrorMessage = "Error";

public string Add(string input1, string input2) { // TODO: Implement throw new NotImplementedException(); }

public string Subtract(string input1, string input2) { // TODO: Implement throw new NotImplementedException(); }

public string Multiply(string input1, string input2) { // TODO: Implement throw new NotImplementedException(); }

public string Divide(string input1, string input2) { // TODO: Implement throw new NotImplementedException(); }

public string Modulus(string input1, string input2) { // TODO: Implement throw new NotImplementedException(); }

public string Power(string input1, string input2) { // TODO: Implement throw new NotImplementedException(); }

}

}

Here is the code for the ArrayFunctions

namespace PFW.CSIST203.Project1.Functions {

public class ArrayFunctions {

///

/// The persistent file used to load and store data when the Store() and Load() methods are utilized /// /// internal string PersistentFile { get; set; }

public static readonly string DefaultPersistentFile = "data.txt";

internal Random Randomizer { get; set; }

public ArrayFunctions() : this("data.txt") { }

public ArrayFunctions(string persistentFile) : this(persistentFile, null) { }

public ArrayFunctions(string persistentFile, int? seed) { // TODO: Implement }

public void Store(string[] data) { // TODO: Implement throw new NotImplementedException(); }

public string[] Load(int dataCount) { // TODO: Implement throw new NotImplementedException(); }

public string[] Randomize(string[] data) { // TODO: Implement throw new NotImplementedException(); }

public string[] ShiftRight(string[] data) { // TODO: Implement throw new NotImplementedException(); }

public string[] ShiftLeft(string[] data) { // TODO: Implement throw new NotImplementedException(); }

public string[] Reverse(string[] data) { // TODO: Implement throw new NotImplementedException(); } }

}

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

Define ANN.

Answered: 1 week ago