/*
File: H2.C
Description: travel guide book.
Programmer: Xinyue Wang
Date: 10/9/2008
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define L 9
#define C 4
/*数据初始化*/
int num, judge, i, seasonPrice[L][C]={{80,50,50,40},{80,50,80,50},{60,60,60,40},{40,30,40,30},{30,35,35,30},{35,35,35,30},{20,20,20,10},{0,0,0,0},{50,30,50,30}}, seasonLimit[L][C]={{20,15,15,20},{100,100,100,50},{50,50,50,50},{40,40,40,20},{30,35,30,25},{80,60,80,50},{80,60,60,50},{20,20,20,20},{100,100,100,80}}, discount[L]={5,6,6,6,5,5,5,0,0}, groupDiscount[L]={6,8,8,8,5,8,6,0,6}, warningAge[L]={0,1,0,0,0,0,0,1,0}, maintain[L]={200,1000,500,400,100,500,300,100,200}, time[L]={2,3,3,2,1,3,2,4,3}, peopleNum[L][C]={{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}};
long int earning[L], profit[L];
char aOt, identityCode[20], adminCode[20], touristCode[20], introduction[L][5000], name[L][100], level[L]={'A','A','A','A','B','A','A','B','B'};
void check_identity(char[], char[]);
int main()
{
char adminCode[20]="TurboC", touristCode[20]="Tourist";
void spot_infor();
spot_infor();/*数据初始化*/
printf("Hello, welcome to look up the travel spots in BEIJING!!!\n");
check_identity(adminCode, touristCode);
return 0;
}
void spot_infor()/*数据初始化*/
{
strcpy(name[0],"Dingling Mausoleum");
strcpy(introduction[0],"Dingling, the underground mausoleum of Emperor Wan Li, is one of the thirteen imperial tombs of the Ming Dynasty.\nDingling consists of the underground palace and surface structures, most of which are now in ruin, leaving the magnificent soul Tower still standing in a spacious courtyard.\nThe Underground Palace lies 27 metes below the surface, and consists of three aligned vaults.\nMost of the relics are on display in the Dingling Museum Exhibition Hall.");
strcpy(name[1],"The Great Wall");
strcpy(introduction[1],"The Great Wall is one of the great wonders of the world.\nStarting out in the east on the banks of the Yalu River in Liaoning Province, the Wall stretches westwards for 12,700 kilometers to Jiayuguan in the Gobi desert, thus known as the Ten Thousand Li Wall in China.\nThe Great Wall is divided into two sections, the east and west, with Shanxi Province as the dividing line.");
strcpy(name[2],"The Palace Museum");
strcpy(introduction[2],"The Palace Museum is the former Imperial Palace, popularly known as the Forbidden City, from which twenty-four emperors of the Ming and Qing Dynasties ruled China for some 500 years.\nAt present, the Palace is an elaborate museum that presents the largest and most complete ensemble of traditional architecture complex and more than 900,000 pieces of court treasures in all dynasties in China.\nNow the Forbidden City is no longer forbidding, but inviting. A visit to the Palace Museum will enrich the visitors' knowledge of history, economy, politics, arts as well as architecture in ancient China.");
strcpy(name[3],"Yuanmingyuan Park");
strcpy(introduction[3],"Yuanmingyuan is renowned throughout the world for its fabled charms and association with Chinese modern history.\nLocated in the northern part of Haidian District in Beijing, Yuanmingyuan is composed of three comparatively independent but interconnected gardens: Yuanmingyuan, Changchunyuan, and Qichunyuan.\nYuanmingyuan was not only famed for its beauty. It was also an imperial museum with a vast collection of cultural treasures.\nHaving been open to the public for a decade. Yuanmingyuan still has a long way to go to become a full-fledged park of historic ruins.");
strcpy(name[4],"Beihai Park");
strcpy(introduction[4],"Beihai Park has been a playground for emperors for hundreds of years. The island at the southern end of the lake is said to have been created by excavating the lake on the orders of Kublai Khan, and this location is associated with his great palace. This would have been the centre of Beijing before the Forbidden city was build in the Ming and Qing dynasties.\nThe most famous attraction in Beihai Park is the 9 Dragon Wall , sculpted in 7 colours of glazed tile, and it is definitely worth seeing when you visit.");
strcpy(name[5],"The Summer Palace");
strcpy(introduction[5],"The Summer Palace is the best-kept existing royal garden in Beijing. With a concentration of the best of ancient buildings as well as styles of gardening, it is a virtual museum of traditional Chinese gardening.\nFrom the peak, the winding Yongding River like a white silk belt fluttering among the western valleys, the Marco Polo Bridge on the river, Shijing Mountain, the Summer Palace and Jade Spring Mountain can all be seen from here, and on a clear day one can even make out the skyline of Beijing.");
strcpy(name[6],"Tian'anmen Rostrum");
strcpy(introduction[6],"Tian’anmen( the Gate of Heavenly Peace), is located in the center of Beijing.\nAt the end of the Ming Dynasty, it was seriously damaged by war. When it was rebuilt under the Qing in 1651, it was renamed Tian’anmen, and served as the main entrance to the Imperial City, the administrative and residential quarters for court officials and retainers.\nDuring the Ming and Qing dynasties, Tian’anmen was the place where state ceremonies took place.");
strcpy(name[7],"798 Art Zone");
strcpy(introduction[7],"The area occupied by Beijing 798 Art Zone was once the place for Beijing North China wireless joint equipment factory (namely, 718 Joint Factory), which was designed and built by the experts of former G.D.R in the 1950s.\nAttracted by ordered designing, convenient traffic, unique style of Bauhaus architecture, many art organizations and artists came to rent the vacant plants and transformed them. As the earliest area where the art organizations and artists moved in located in the original area of 798 factory, this place was named as Beijing 798 Art Zone.");
strcpy(name[8],"Olympic Green");
strcpy(introduction[8],"Olympic green laying at the north of the Forbidden City, and is a new area stands for prosperity, development, and future. The main venues of 29th Olympic Game are located in it.\nBesides Bird's Nest, Water Cube, The National Indoor Stadium, The Fancing Hall, MPC and IOC are in the Park too.\nPeople come here can not only enjoy the beautiful senery, but also experience the Olympic atmosphere.");
}
void check_identity(char admin[], char tourist[])
{
void tourists(char []), administrations(char[]);
char identityName[10];
do
{
printf("\nNow please enter the user name(tourist or admin):");
scanf("%s", identityName);
getchar();
printf("\nThen please enter the password(tourist for Tourist):");
scanf("%s", identityCode);
getchar();
judge=0;
if (strcmp(identityName,"admin")==0&&strcmp(identityCode,admin)==0)/*检查用户名及密码,以管理员身份进入*/
{
aOt='a';
administrations(tourist);
}
else if (strcmp(identityName,"tourist")==0&&strcmp(identityCode,tourist)==0)/*检查用户名及密码,以游客身份进入*/
{
aOt='t';
tourists(admin);
}
else/*用户名或密码错误*/
{
printf("\nSORRY, You can't enter the system!Please try again.");
judge=1;
}
}while(judge);
}
void tourists(char adminS[])
{
char chooseB;
void change_password(), look_up(), choose_where(), recommend(), compositor();
do /*返回菜单*/
{
printf("\nWhat do you like to do?\n1.change password\n2.look up\n3.choose where to sightseeing\n4.recommend\n5.compositor\n6.change identity\n7.EXIT");
scanf("%c", &chooseB);
getchar();
judge=1;
switch(chooseB)
{
case '1':
change_password();
break;
case '2':
look_up();
break;
case '3':
choose_where();
break;
case '4':
recommend();
break;
case '5':
compositor();
break;
case '6':
check_identity(adminS, touristCode);
break;
case '7':
exit(1);
default:/*容错处理*/
printf("\nYou have enter a w