Quiz

Son Teslim Tarihi: 10 Kasım 2021 00:00
Bütçe: ~100 TL
C Language
Write a program that calculates the area and perimeter of square, rectangle, triangle and circle. Your program first asks the type of shape (by "Please input the shape type: ") and after shape value is provided by means of first letter of the shape (either by 's','r', 't' or 'c' characters, lowercase), it will ask for the sides based on the shape type.

*For square, it will request one side info, "Input the sides of the square: "

*For rectangle, it will request two side info, "Input the sides of the rectangle: "

*For triangle, it will request three sides info,"Input the sides of the triangle: "

*For circle, it will request radius info,"Input the radius of the circle: "



Having provided the shape type and sides info, the area and the perimeter will be calculated. All the areas and perimeters except circle will be calculated as an integer, but for circle I expect print results as float or double.



If any other shape type is entered, an error indicating that operator is not found will be raised. Copy and paste your entire working program into the box below.



The screen dialogue should appear as follows:

Please input the shape type: s

Input the sides of the square: 5

The area of the shape is 25

The perimeter of the shape is 20



Please input the shape type: r

Input the sides of the rectangle: 5 10

The area of the shape is 50

The perimeter of the shape is 30



Please input the shape type: k

Invalid shape!
Eklenen dosyaları görmek için giriş yapınız !

Bu Görev Yayında Değil