1 /******************************************************************************
2 *
3 * Copyright (C) 2005, The Gentee Group. All rights reserved.
4 * This file is part of the Gentee open source project - http://www.gentee.com.
5 *
6 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE GENTEE LICENSE ("AGREEMENT").
7 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS
8 * ACCEPTANCE OF THE AGREEMENT.
9 *
10 * ID: square 17.10.06 0.0.A.
11 *
12 * Author: Alexey Krivonogov ( gentee )
13 *
14 ******************************************************************************/
15
16 func main<main>
17 {
18 str input
19 double width height
20
21 while 1
22 {
23 print("Enter the number of the action:
24 1. Calculate the area of a rectangle
25 2. Calculate the area of a circle
26 3. Exit\n")
27 switch getch()
28 {
29 case '1'
30 {
31 print("Specify the width of the rectangle: ")
32 width = double( conread( input ))
33 print("Specify the height of the rectangle: ")
34 height = double( conread( input ))
35 print("The area of the rectangle: \( width * height )\n\n")
36 }
37 case '2'
38 {
39 print("Specify the radius of the circle: ")
40 width = double( conread( input ))
41 print("The area of the circle: \( 3.1415 * width * width )\n\n")
42 }
43 case '3', 27 : break
44 default : print("You have entered a wrong value!\n\n")
45 }
46 }
47 }
48
Редактировать