February 3, 2019
This time, you will have to start your project “from scratch” and shouldn’t try to edit a previous program.
.cs files opened and displayed in the Solution Explorer: Program.cs and Circle.cs.Circle.cs, of type double and named radius. Write a set and a get method for this instance variable.Program.cs, write statements that create a new Circle object and set its radius to 2.3. Display its radius at the screen using the method you defined previously.Math.PI is a double holding an approximation of π. In the Main method of Program.cs, write a statement that displays its value at the screen.Circle.cs file, add two methods:
Main program, by displaying at the screen the area and the circumference of the object you created at the previous exercise.double as argument, and set the value of the radius created to the value given as a parameter. Note that you can’t compile your program anymore. Why?Main method to make your program complilable again. Instead of the default constructor (that isn’t available anymore), use the constructor you just defined.Add a custom “no-args” constructor to your class, using
Edit your Main method so that two objects are created: one using the “no-args” constructor, one using the constructor that takes an argument.
Draw the UML diagram for the class you just implemented. Make sure it matches perfectly your implementation.
The following are two independent tasks, to widen your understanding of this class, sharpen your coding skills, and prepare you for the next labs.
Rectangle project from the previous lab and write three constructors:
Test them, and make sure they have the expected behavior.
Have a look at the Math class’s specification, at https://docs.microsoft.com/en-us/dotnet/api/system.math?view=netframework-4.7.1 Can you write a statement that display the result of Min(214, ⌊log(4000⌋)?