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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started