![]() ![]() If (answer.Equals("Y",StringComparison.CurrentCultureIgnoreCase))Ĭonsole.WriteLine("You can now close this program. Height = double.Parse(Console.ReadLine()) Ĭylarea = 2 * pi * radius * height + 2 * pi * Math.Sqrt(radius) Ĭonsole.WriteLine("The area of the cylinder is +cylarea") Ĭonsole.WriteLine("Do you want to get another calculation?") Ĭonsole.WriteLine("You can now close this program.") Ĭonsole.WriteLine("Please enter the radius of the circle :") Ĭonsole.WriteLine("The area of the circle is :"+ cirarea) Ĭonsole.WriteLine("The area of the rectangle is :" + triarea) Ĭonsole.WriteLine("The area of the cylinder is :"+ cylarea) Width = double.Parse(Console.ReadLine()) Ĭonsole.WriteLine("The area of the rectangle is +triarea.") Ĭonsole.WriteLine("Please enter the radius of cylinder: ") Ĭonsole.WriteLine("Please enter the height of the cylinder: ") Length = double.Parse(Console.ReadLine()) Ĭonsole.WriteLine("Please enter the width of the rectangle: ") ![]() where A is the surface area, r is the radius of the circle and h is the height of the cylinder. For example, if the length is 5 m, and width is 2 ft, convert both to either m or ft. The surface area of a closed cylinder is: A 2 r ( r + h) The surface area of an open-top cylinder is: A r ( r + 2 h) The surface area of an open cylinder (or tube) is: A 2 r h. From there, we’ll tackle trickier objects, such as cones and spheres. SA You can find the SA of any prism by using the basic formula for SA which is 2B + LSA SA LSA lateral Surface area LSA perimeter of the base x height of the prism B the base of the prism. We’ll start with the volume and surface area of rectangular prisms. We must measure them both in the same unit. 5 questions Koch snowflake fractal Heron's formula Unit test 14 questions About this unit Volume and surface area help us measure the size of 3D objects. Radius = double.Parse(Console.ReadLine()) Ĭonsole.WriteLine("The area of the circle is +cirarea") Ĭonsole.WriteLine("Please enter the length of the rectangle: ") To find the surface area of a rectangle, you require its length and width: Convert the length and width into the same unit. using System Ĭonsole.WriteLine("Area of rectangle") Ĭonsole.WriteLine("Area of cylander") Ĭonsole.WriteLine("Please enter the radius of the circle: ") ![]() Can someone please explain me why the following code does not work? Appreciate it. I made it but for some reason it does not run and I am unable to find any bugs in my code and I need help with it. I am writing a C# program that should calculate the area of circles, triangles and cylinders. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |