Home / Expert Answers / Computer Science / lab-4-2-working-with-console-c-creating-a-class-calc-write-a-program-in-c-console-net-frame-pa737

(Solved): Lab 4.2 - Working with Console C\# creating a class Calc Write a program in C\# console (.NET Frame ...



student submitted image, transcription available below
Lab 4.2 - Working with Console C\# creating a class Calc Write a program in C\# console (.NET Framework), and use/create the class Calc, having private fields, public Proprieties, Constructors (overloaded: default and one with two arguments) and five Methods to calculate (4) and to display (1) the results of the four basic arithmetical operations (see the images). Create and use the Properties; use the set and get for the two entries (private class fields for the two numbers). Decide for the type and the number of fields to create. You can use for the Methods the following signatures: public double Add(), public double Sub(), public double Mul(), public double Div(), public void Display(). For the method Display() use placeholders to display the text and the values and the results. Use In for having new lines. Create an object of the class Calc using the default Constructor, accept two numerical entries form the user (use try and catch to validate the entries) in Main(), and then, store the entered values using the Proprieties. Calculate and display the results similar like in the images . Create the second object in Main() by using the second overloaded Constructor (with two arguments); this time by passing as parameters the values and , then call again the method to calculate and display the results. Here are the screen shots of testing the application: With entered values 80 and 20.


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe