Home > Back-end >  Solving the freshman algorithm and data structure of the code!
Solving the freshman algorithm and data structure of the code!

Time:04-06

Topic is
Suppose expression allowed to contain three brackets, parentheses, square brackets and braces, write an algorithm to judge the expression in parentheses is properly matched,
Write the steps:
(1) through the console in the Visual Studio2017IDE tool development, create a XXXX applications, (2) write called CalculatorXXX1 class, the class access for the public property, the class will be mainly complete integer arithmetic, the class has four public methods, methods respectively, the add (int a, b int) method, integer addition, sub (int a, b int) method, to subtract the mul (int a, b int) method, carries on the multiplication, div (int a, b int) method, carries on the division, (3) write called CalculatorXXX2 class, the class access for the public property, the class mainly performs floating-point operation, and in the program to control the number of significant digits decimal, in keep two decimal digits, the output of the four methods in a class, respectively subfloat (float a, float b), will be floating-point addition, div (flaot a, float b) to subtract,...
(4) in CalculatorXXX2 classes of methods, by setting the format string, the output of the controlled numerical formats and decimal digits, mainly by XXXX XXXXXXXX implementation, and then through the Console class static methods in WriteLine output,
(5) in the main method of the console application, create a class of objects, such as the Calculator CC=new Calculator (); CC creating an object, and through the object CC call in the class method, and the value of operation, such as CC. XXX (5, 5); To create CalculatorXXX2 object, and through the object call XXXX () method, floating-point numerics,
  • Related