求大神帮忙写到c语言的程序,关于体育场建筑物的!!谢谢

问题描述

求大神帮忙写到c语言的程序,关于体育场建筑物的!!谢谢

In this exercise you will design a structure in C that models a Major League Baseball stadium. You
will also write several supporting functions and methods that process and act on that data. Additional
details are provided in the stadium.h file.
The first step will be to design your structure(s). You will need to decide what fields and data types
should be included in this structure. At a minimum, you should support the following pieces of data:
? Stadium name
? Team name
? City
? State
? Year Built
? Latitude (scale: ["180, 180], negative is southern hemisphere)
? Longitude (scale: ["180, 180], negative is western hemisphere)
For completeness, we repeat how to compute the air distance between two latitude/longitude points
using the Spherical Law of Cosines:
d = arccos (sin('1) sin('2) + cos('1) cos('2) cos(")) ? R
where
? '1 is the latitude of location A, '2 is the latitude of location B
? " is the di?erence between location B’s longitude and location A’s longitude
? R is the (average) radius of the earth, 6,371 kilometers
Note: the formula above assumes that latitude and longitude are measured in radians r, "? ? r ? ?.
To convert from degrees deg ("180 < deg ?<180) to radians r, you can use the simple formula:
r = (deg /180)*PI

/**

  • Structure that models a Major League Baseball Stadium
    */
    typedef struct {
    //TODO
    } Stadium;![]

typedef enum {
NAME,
TEAM,
AGE,
AGE_NEWEST,
STATE_CITY,
LATITUDE,
LONGITUDE,
} Order;

/**

  • A builder function to create an instance of a Stadium with
  • the provided values.
    */
    Stadium * createStadium(const char *name,
    const char *teamName,
    const char *city,
    const char *state,
    int yearBuilt,
    double latitude,
    double longitude);

/**

  • A function to convert a Stadium instance to a human-readable
  • string representation.
    */
    char * stadiumToString(const Stadium *s);

/**

  • Returns the air distance (using the Spherical Law of Cosines
  • between the two stadiums based on their latitude/longitude.
    */
    double getAirDistance(const Stadium *s1, const Stadium *s2);

/**

  • Returns the total air distance between each contiguous
  • stadium in the given array containing n stadiums.
    */
    double getAirDistances(const Stadium *stadiums, int n);

/**

  • Comaprator function that orders stadiums by their name (alphabetic order)
    */
    int cmpStadiumByName(const void *s1, const void *s2);

/**

  • Comaprator function that orders stadiums by their team name (alphabetic order)
    */
    int cmpStadiumByTeamName(const void*s1, const void*s2);

/**

  • Comaprator function that orders stadiums by their age (oldest first)
    */
    int cmpStadiumByAge(const void*s1, const void*s2);

/**

  • Comaprator function that orders stadiums by their age (newest first)
    */
    int cmpStadiumByAgeNewestFirst(const void*s1, const void*s2);

/**

  • Comaprator function that orders stadiums by first by their state
  • then by their city (alphabetic order)
    */
    int cmpStadiumByStateCity(const void*s1, const void*s2);

/**

  • Comaprator function that orders stadiums by their name latitude, (south to north)
    */
    int cmpStadiumByLatitude(const void*s1, const void*s2);

/**

  • Comaprator function that orders stadiums by their name longitude (west to east)
    */
    int cmpStadiumByLongitude(const void*s1, const void*s2);

/**

  • A function that sorts the given array of stadiums (containing n elements) according
  • to the specified order.
    */
    void sortStadiums(Stadium *stadiums, int n, Order order);

解决方案

这很考验英语功底啊!!

解决方案二:

能不能得给翻译翻译,看起来都看不太懂啊。。。

时间: 2024-08-28 13:51:33

求大神帮忙写到c语言的程序,关于体育场建筑物的!!谢谢的相关文章

c语言基础-真的很着急,大一学生党,求大神指导写一个c语言拨号程序

问题描述 真的很着急,大一学生党,求大神指导写一个c语言拨号程序 能显示出通讯录中所有人姓名,当选中某个姓名时,屏幕上模拟打字机效果依次显示出此人的电话号码中的各个数字,并伴随相应的拨号声 解决方案 http://zhidao.baidu.com/link?url=svF4fjRTNuBmCJyCiRipzB_21UO5zvNc0hCye7qj8nxOY1lC78667ycDqYnJ7xHiGT00M4NuYqGIak2R5cEU961mjRl1ADLf-Eh1nDKpiBi

求大神帮忙,用C语言写个生日蛋糕出来

问题描述 求大神帮忙,用C语言写个生日蛋糕出来 各位大神帮帮忙,有个朋友过生日 不知道如何用C语言编个生日蛋糕,能力有限,特来请教大神们 解决方案 不是你能力有限,是C语言功能有限.C语言哪里能变出蛋糕来. 解决方案二: #include <stdlib.h> #include <math.h> #include <graphics.h> int size, color = 1; void *save1, *save2; void save(); void dsnow(

控件-求大神帮忙写个函数,以控制datagrideview行列变化

问题描述 求大神帮忙写个函数,以控制datagrideview行列变化 2C 我做一个小程序,里面用到了很多数据库和Datagriedview控件,希望写一个全局函数,控制datagridview的行列宽度变化,以及插入和删除行或列(点击鼠标右键时出现插入和删除行列.以及复制粘贴). 在调用数据库后,能不能实现对数据的多行粘贴和复制. 谢谢了,急求. 解决方案 http://bbs.csdn.net/topics/360108393 解决方案二: 设置datagridview行列格式的函数呢?

数据库-求大神帮忙写一个基于java的学生学籍管理系统

问题描述 求大神帮忙写一个基于java的学生学籍管理系统 具体功能有:1)设计入学.管理及查询界面 2)设计学生各学期.学年成绩输入及查询界 面,并打印各项报表 3)根据各年度总成绩,查询.输出学生学籍管理方案(优秀,合格,试读,退学) 4)毕业管理 5)系统维护,如数据安全管理(含系统备份 与恢复),操作员管理,权限设置 解决方案 这个说起来简单,但是要做的话还是要一点时间的,这应该是一个毕业设计的课题呀 解决方案二: 你确定你不花钱或者撒个娇有人会花时间帮你做这个 解决方案三: 需要定制么?

求大神帮忙写一个正则表达式php过滤编辑器的新闻内容

问题描述 求大神帮忙写一个正则表达式php过滤编辑器的新闻内容 从网站A数据库中读取的新闻内容(HTML源码格式)写入网站B的新闻表中,格式不统一,而且有很多冗余代码,很多是从office复制过去的,需要过滤掉网站A新闻内容中冗余的HTML代码.新闻内容在php的$NEWS字段中,给这个字段用正则表达式处理一下. 具体的代码说明写了个网页,方便大神看求助写正则表达式 后面是php连接查询的代码,方便大神测试,数据库mysql,表是editor,两个字段ID(INIT)和news(MEDIUMTE

c++-C++课程设计 求大神帮忙写下构造函数和析构函数

问题描述 C++课程设计 求大神帮忙写下构造函数和析构函数 1.网格世界类网格中每个元素存放各种生物对象的指针或者为空.模拟过程中,我们需要移动生物,还有繁殖和饥饿(死亡),所以在网格类中,我们可以将一只生物放到网格中:可以读取网格中的某个指定位置的生物,获取它的指针,以便在每一个time step中对它进行处理(移动.繁殖和饥饿死亡).在一个time step中,网格中每只生物都要处理一遍,先狮蚁,后蚂蚁.另外,应该有一个显示网格的成员函数.2.有机生物类生物要能够放到网格中,所以每一只生物都

c++-跪求大神帮忙写出程序啊~。

问题描述 跪求大神帮忙写出程序啊-. 大神??啊??朋友给我个题?我真作难了??是这样?: 有29组数字??,选任意8组为一组? 要求 1.?求这8组中共有的数字 ?2.要除掉 12345678 23456789 7 8 9 10 11 12 13 14---- ------23 24 25 26 27 28 29 30---- 2627 28 29 30 31 32 33 等等 这样紧挨着的8组 3.把每8组组合出来 的数字 一一列出??---------- 以下是29组数据: (01)?01

json-$.getJSO求大神帮忙写下ASP页面代码 小弟不胜感激

问题描述 $.getJSO求大神帮忙写下ASP页面代码 小弟不胜感激 var ghost = window.location.hostname+"":2258"";function Guard() { this.Users = new Array(); this.GetCount = function () { return this.Users.length; } this.FindObject = function (name) { var u = null;

字符串-求大神帮忙看看这个c语言他题目代码的缺陷~~

问题描述 求大神帮忙看看这个c语言他题目代码的缺陷~~ 7.1连接两个字符串 不使用 strcat 函数,编写一个程序将两个字符串连接起来,注意程序首先需要通过键盘输入两个字符串,然后将它们连接起来,将连接后的字符串存储于新的字符数组中,再打印数出. #include<stdio.h> int main() { char a[50],b[50],c[50];int i=0,j; gets(a); gets(b); while(a[i]!='') { c[i]=a[i]; i++; } j=i,