Question: Develop and test the following C# methods. 1). (4 marks) Write a BalanceTest method which receives a string of characters representing a math expression such

Develop and test the following C# methods.

1). (4 marks) Write a BalanceTest method which receives a string of characters representing a math expression such as 2*(a+b)/(c-d)+(2ef). If the opening brackets match the closing brackets, the method returns true. Otherwise, the method returns false. The method should use the C# Stack class. Test several expressions (with balanced or unbalanced brackets) and take screenshots;

2). (2 marks) Write a C# class named Car with three attributes: color, model and year. Implement necessary constructors and getters/setters;

3). (2 marks) Create five Car objects and store them in an ArrayList. Using the foreach loop to have each Car object in the ArrayList print its model. Run the program and take screenshots;

4). (2 marks) Create five Car objects and store them in a Queue. Use a loop to have each Car object in the Queue print its color (dequeue the objects one at a time). Run the program and take screenshots;

Please send me the screenshots too and provide the files names too with code.

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!