C语言课程设计报告文档格式.docx

上传人:b****6 文档编号:21353764 上传时间:2023-01-29 格式:DOCX 页数:48 大小:177.52KB
下载 相关 举报
C语言课程设计报告文档格式.docx_第1页
第1页 / 共48页
C语言课程设计报告文档格式.docx_第2页
第2页 / 共48页
C语言课程设计报告文档格式.docx_第3页
第3页 / 共48页
C语言课程设计报告文档格式.docx_第4页
第4页 / 共48页
C语言课程设计报告文档格式.docx_第5页
第5页 / 共48页
点击查看更多>>
下载资源
资源描述

C语言课程设计报告文档格式.docx

《C语言课程设计报告文档格式.docx》由会员分享,可在线阅读,更多相关《C语言课程设计报告文档格式.docx(48页珍藏版)》请在冰豆网上搜索。

C语言课程设计报告文档格式.docx

此题可以根据所给曲线大致形状,运用常规的编制图形的方法来绘制。

也可以根据下面的方程来绘制滴定曲线。

[H+]=CHCl(1-a)/2+[(1-a)CHCl2/4+Kt-1]

其中,[H+]为氢离子浓度,CHCl为盐酸浓度,Kt=1014.00,a为滴定分数(令a在0-2范围内取值,步长为0.001),a=Vb/20,Vb为氢氧化钠加入到盐酸中的瞬时浓度。

6.YearDay

已知2000年1月1日为星期六,请输入任一年的年份后,打印该年的年历。

7.GoodBye!

这里除了输出一个信息外,还必须结束程序运行。

【三.系统分析】

根据系统功能要求,可以将问题解决分为以下步骤:

(1)应用系统分析,建立该系统的功能模块框图以及界面的组织和设计;

(2)分析系统中的各个实体及它们之间的关系;

(3)根据问题描述,设计系统的类层次;

(4)完成类层次中各个类的描述;

(5)完成类中各个成员函数的定义;

(6)完成系统的应用模块;

(7)功能调试;

(8)完成系统总结报告。

本程序运用switch……case语句实现了七个菜单项的演示程序,并分别定义了几个功能函数分别为上述菜单配上相应的功能,通过主函数调用各个函数而实现趣味菜单程序。

(9)本大题的流程图大体如下:

运行时,如下图顺序:

【四.测试数据及伪代码】

#include"

stdio.h"

conio.h"

math.h"

Process.h"

#defineYES1

#defineNO0

intcount2=0;

voidfindnum();

voidfindroot(floatgen[],floatx1,floatx2);

voiddetective();

voidyearday(intyear);

intbear(intdays);

main()

{intch1,t1=1;

floatgen[100];

intyear;

while(t1)

{

system("

cls"

);

printf("

1.FindNum\n2.FindRoot\n3.Detective\n4.Bear\n5.Curve\n6.YearDay\n7.GoodBye!

\n"

Pleaseinputanumberwhichisbetween1and7:

"

fflush(stdin);

scanf("

%d"

&

ch1);

switch(ch1)

case1:

findnum();

break;

case2:

findroot(gen,-8.0,8.0);

printf("

一共有%d个解:

x1=%fx2=%fx3=%f\nPressanykeytoreturn.\n"

count2,gen[0],gen[1],gen[2]);

getch();

break;

case3:

detective();

case4:

地里一共有%d个玉米\nPressanykeytoreturn.\n"

(2*(bear(9)+1)));

case6:

\n输入年份:

fflush(stdin);

year);

yearday(year);

\nPressanykeytoreturn.\n"

getch();

case5:

case7:

goodbye!

t1=0;

default:

Only1~7,please!

Pressanykeytoreturn.\n"

continue;

}

}

intpanduan(ints[10],intx)

{

intt;

for(t=0;

t<

x;

t++)

if(s[x]==s[t])return1;

return0;

voidfindnum()

inta[10],count=0;

longintji=1;

for(a[0]=1;

a[0]<

=9;

a[0]++)

for(a[1]=0;

a[1]<

a[1]++)

{if(panduan(a,1))continue;

for(a[2]=0;

a[2]<

a[2]++)

{if(panduan(a,2))continue;

for(a[3]=0;

a[3]<

a[3]++)

{if(panduan(a,3))continue;

for(a[4]=0;

a[4]<

a[4]++)

{if(panduan(a,4))continue;

for(a[5]=0;

a[5]<

a[5]++)

{if(panduan(a,5))continue;

for(a[6]=1;

a[6]<

a[6]++)

{if(panduan(a,6))continue;

for(a[7]=0;

a[7]<

a[7]++)

{if(panduan(a,7))continue;

for(a[8]=0;

a[8]<

a[8]++)

{if(panduan(a,8))continue;

for(a[9]=0;

a[9]<

a[9]++)

{if(panduan(a,9))continue;

if(100*a[0]+10*a[1]+a[2]+100*a[3]+10*a[4]+a[5]!

=1000*a[6]+100*a[7]+10*a[8]+a[9])continue;

%d%d%d+%d%d%d=%d%d%d%d\n"

a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]);

count++;

Thereare%ldpossibleanswersinall.\nPressanykeytoreturn."

count);

floathanshu(floatx)

floatjie;

jie=x*x*x-3*x-1;

returnjie;

floatqiudao(floatx)

floatdao;

dao=3*x*x-3;

returndao;

voidfindroot(floatgen[],floatx1,floatx2)

floatnear1,l=x1,h=x2,j,d;

intkey1=-1;

near1=(l+h)/2;

j=hanshu(near1);

while

(1)

d=qiudao(near1);

near1=near1-j/d;

x=%lf,y=%lf\n"

near1,j);

if(near1>

h||near1<

l){key1=0;

}

if(j<

0.0001&

&

j>

-0.0001){key1=1;

gen[count2++]=near1;

if(key1==1)

findroot(gen,near1,x2);

findroot(gen,x1,near1);

elsereturn;

voiddetective()

inttemp1,temp2;

intpai3,pai5;

for(pai3=0;

pai3<

pai3++)

for(pai5=0;

pai5<

pai5++)

temp1=1100*pai3+11*pai5;

temp2=(int)sqrt(temp1);

if(temp2*temp2==temp1)printf("

车牌号为:

31%d%d%d%d\n"

pai3,pai3,pai5,pai5);

elsecontinue;

Pressanykeytoreturn."

intbear(intdays)

if(days==1)return1;

elsereturn(2*(bear(days-1)+1));

intisleap(intyear)

intleap=NO;

if(year%4==0&

year%100!

=0||year%400==0)leap=YES;

returnleap;

intweek_of_newyears_day(intyear)

intn=year-2000,leaps_num;

if(year>

2000)

leaps_num=1+(n-1)/4-(n-1)/100+(n-1)/400;

n=n+leaps_num-1;

n=n%7;

returnn;

if(year==2000)return6;

if(year<

leaps_num=(n+1)/4-(n+1)/100+(n+1)/400;

n=n+leaps_num;

n=6+n%7;

voidyearday(intyear)

intmonth,day,weekday,len_of_month,i;

weekday=week_of_newyears_day(year);

for(month=1;

month<

=12;

month++)

\n%d年%d月\n"

year,month);

---------------------------------\n"

SUMMONTUEWEDTHUFRISAT\n"

for(i=0;

i<

weekday;

i++)printf("

"

if(month==4||month==6||month==9||month==11)len_of_month=30;

elseif(month==2)

if(isleap(year))

len_of_month=29;

else

len_of_month=28;

else

len_of_month=31;

for(day=1;

day<

=len_of_month;

day++)

if(day>

9)

printf("

%2d"

day);

%1d"

weekday++;

if(weekday==7){weekday=0;

【五.运行结果】

1.FindNum

2.FindRoot

3.Detective

4.Bear

5.Curve

6.YearDay

7.GoodBye!

1

246+789=1035

249+786=1035

264+789=1053

269+784=1053

284+769=1053

286+749=1035

289+746=1035

289+764=1053

324+765=1089

325+764=1089

342+756=1098

346+752=1098

347+859=1206

349+857=1206

352+746=1098

356+742=1098

357+849=1206

359+847=1206

364+725=1089

365+724=1089

423+675=1098

425+673=1098

426+879=1305

429+876=1305

432+657=1089

437+589=1026

437+652=1089

439+587=1026

452+637=1089

457+632=1089

473+589=1062

473+625=1098

475+623=1098

476+829=1305

479+583=1062

479+826=1305

483+579=1062

487+539=1026

489+537=1026

489+573=1062

537+489=1026

539+487=1026

573+489=1062

579+483=1062

583+479=1062

587+439=1026

589+437=1026

589+473=1062

623+475=1098

624+879=1503

625+473=1098

629+874=1503

632+457=1089

637+452=1089

652+437=1089

657+432=1089

673+425=1098

674+829=1503

675+423=1098

679+824=1503

724+365=1089

725+364=1089

742+356=1098

743+859=1602

746+289=1035

746+352=1098

749+286=1035

749+853=1602

752+346=1098

753+849=1602

756+342=1098

759+843=1602

764+289=1053

764+325=1089

765+324=1089

769+284=1053

784+269=1053

786+249=1035

789+246=1035

789+264=1053

824+679=1503

826+479=1305

829+476=1305

829+674=1503

843+759=1602

847+359=1206

849+357=1206

849+753=1602

853+749=1602

857+349=1206

859+347=1206

859+743=1602

874+629=1503

876+429=1305

879+426=1305

879+624=1503

Thereare96possibleanswersinall.

Pressanykeytoreturn.

2

x=-0.333333,y=-0.037037

x=-0.347222,y=-0.000196

x=-0.347296,y=0.000000

x=2.762340,y=11.791083

x=2.169573,y=2.703559

x=1.926472,y=0.370286

x=1.880948,y=0.011883

x=1.879387,y=0.000014

x=3.448102,y=29.651591

x=2.540444,y=7.774325

x=2.065286,y=1.613427

x=1.900587,y=0.163600

x=1.879711,y=0.002475

x=1.879385,y=0.000001

x=-1.532097,y=-0.000031

x=-2.931592,y=-17.399994

x=-2.167854,y=-4.684463

x=-1.745783,y=-1.083378

x=-1.569432,y=-0.157397

x=-1.533573,y=-0.006008

x=-1.532091,y=-0.000010

x=1.879442,y=0.000428

x=-3.308333,y=-27.284940

x=-2.393812,y=-7.535910

x=-1.862778,y=-1.875395

x=-1.609682,y=-0.341762

x=-1.538082,y=-0.024389

x=-1.532129,y=-0.000163

x=-1.532089,y=0.000000

一共有3个解:

x1=-0.347296x2=1.879387x3=-1.532091

3

310000

317744

4

地里一共有1534个玉米

6

输入年份:

2005

2005年1月

---------------------------------

SUMMONTUEWEDTHUFRISAT

1

2345678

9101112131415

16171819202122

23242526272829

3031

2005年2月

12345

6789101112

13141516171819

20212223242526

2728

2005年3月

2728293031

2005年4月

12

3456789

10111213141516

17181920212223

24252627282930

2005年5月

1234567

891011121314

15161718192021

22232425262728

293031

2005年6月

1234

567891011

12131415161718

19202122232425

2627282930

2005年7月

SUMMONTUE

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 节日庆典

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1