Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

9.7 List and briefly discuss four management development methods.

Answered: 1 week ago