狠狠干影院/欧美午夜电影在线观看/高黄文/国产精品一区二区在线观看完整版

安徽工業(yè)大學(xué)軟件工程實驗報告

| 瀏覽次數(shù):

 《軟件工程》實驗報告

 姓

 名: : 江文杰

 學(xué)

 號 :1390743 33

 班

 級: :網(wǎng) 網(wǎng) 133

 指導(dǎo)老師: : 周兵

 一.

 實驗?zāi)康?1.能按照軟件工程得思想,采用面向過程得方法開發(fā)出一個小型軟件系統(tǒng)。

 2.在軟件系統(tǒng)開發(fā)過程中,能綜合利用一門編程語言與軟件工程等多門課程得知識。

 3.培養(yǎng)良好得軟件開發(fā)習(xí)慣,了解軟件企業(yè)文化。

 4.掌握結(jié)構(gòu)化數(shù)據(jù)流分析技術(shù)。

 5.掌握結(jié)構(gòu)化程序設(shè)計得基本概念與技術(shù),并且養(yǎng)成良好得編碼風(fēng)格。

 6.掌握單元測試得一般步驟及技術(shù)。

 7.掌握集成測試得一般步驟與技術(shù)。

 二.

 實驗內(nèi)容 1 . 軟件需求分析

  ① 、功能需求分析

  ·輸入一個年份(13000),然后顯示 12 個月得月歷

  ·能解決閏年與平年問題

  ·能輸出顯示結(jié)果 ②、運行需求分析

  ·

 操作系統(tǒng): Windows9x,

 Windows2000, Windows XP 及更高版本 ③、數(shù)據(jù)流圖

  軟件結(jié)構(gòu)圖:

 2 . 軟件設(shè)計與編碼 #include <stdio、h> #include <ctype、h> #include <stdlib、h> #include <math、h> #define firstdayof1 1

  /* 定義第一年得第一天, 星期日=7 */ #define gap "

 "

  /* set gap between numbers of dates */ #define dent "

 "

  /* set right margin、 */ struct info {

  int month;

  int firstdayofmonth;

  int daysofmonth;

  int leap;

  }monthinfo; int checkinput(void); checkinput main output inputyear isleap

 setinit setinfo printhead printmonth 檢查輸入 確定年份 算 計算 1 月 月 1 日 示 顯示 1 月 示 顯示 2 月 示 顯示 12 月 顯示表頭 顯示其她月份 錯誤 非法 年份 年份 年份 年份 就是否閏開始信息 開始信息 任 意鍵

 int inputyear(void); int isleap(int y); void output(struct info); void printhead(struct info ); void printmonth(struct info); struct info setinit(int); struct info setmonthinfo(struct info ); /* 這個作用就是判斷年, 如果就是閏年,

 return 1, 否則

  return 0

  */ int isleap(int y) {

 return ((y%4==0 && y%100!=0)

 || y%400==0); } /* This module is to accept inputyear and check if it is correct、 if it is

 correct it return int year, otherwise ask user reenter

 */ int checkinput(void) {

 int y;

 do{

 y=inputyear;

 if(y<1 || y >3000)

  {

  printf("\n 輸入錯誤!。\n\n");

  y=0;

  }

  }while(y<1);

 return y;

 } /* This function is to accept the input year, if it is the integer, it returns

 it, otherwise it return 1

 */ int inputyear(void) {

 char s[80];

  int i, y;

 y=1;

 printf("請輸入年份(13000):");

 for(i=0;i<80;++i)

  {

  s[i]=getchar;

  if(s[i]==27)

  exit(0);

  if(s[i]==10)

  break;

 }

 for(i=0;i<80;++i)

 {

  if(s[i]==10) break;

  else if(!isdigit(s[i]))

 return y;

 }

 y=atoi(s);

 return y; } /*This module is to accept monthinfo, and print the whole year calender、

  */ void output(struct info monthinfo) {

  char ch;

 do{

 printhead(monthinfo);

 printmonth(monthinfo);

 printf("按任意鍵顯視下一月, 按 Esc 鍵退出、 \n");

 ch=getchar;

 if(ch==27)

 exit(0);

 monthinfo=setmonthinfo(monthinfo);

 }while(monthinfo、month<13); } /* This module is to accept monthinfo, amd print monthly head like"一

 月"

  */ void printhead(struct info monthinfo) {

 char *ss;

 printf("%s",dent);

 switch(monthinfo、month)

 {

 case 1:

  ss="一

 月";

  break;

  case 2:

  ss="二

 月";

  break;

  case 3:

  ss="三

 月";

  break;

  case 4:

  ss="四

 月";

  break;

  case 5:

  ss="五

 月";

  break;

  case 6:

  ss="六

 月";

  break;

  case 7:

  ss="七

 月";

  break;

  case 8:

  ss="八

 月";

  break;

  case 9:

  ss="九

 月";

  break;

  case 10:

  ss="十

 月";

  break;

  case 11:

  ss="十一

 月";

  break;

  case 12:

 ss="十二

 月";

 }

 printf("

 %s%s%s%s\n\n",gap,gap,gap,ss); } /* This module is to accept monthinfo, and print the numbered dates of the

 month 、

 */ void printmonth(struct info monthinfo) {

  int i,j,k;

  printf("%s",dent);

  printf(" 一 %s 二 %s 三 %s 四 %s 五 %s 六 %s 日\n\n",gap,gap,gap,gap,gap,gap);

  printf("%s",dent);

  for(i=1;i<monthinfo、firstdayofmonth;i=i+1)

 {

  printf("%s

 ",gap);

 }

  k=monthinfo、firstdayofmonth;

  for(j=1;j<=monthinfo、daysofmonth;j=j+1)

 {

  if(k>7)

  {

  k=k7;

  printf("\n\n%s",dent);

  };

  k=k+1;

  printf("%2d%s",j,gap);

 }

  printf("\n\n"); } /* This module is to accept the monthinfo, and set the monthinfo of next month、

 */

 struct info setmonthinfo(struct info monthinfo) {

  int m;

  monthinfo、firstdayofmonth= (monthinfo、firstdayofmonth+ \

  monthinfo、daysofmonth1)%7+1;

  monthinfo、month=monthinfo、month+1;

  monthinfo、daysofmonth=30;

  m=monthinfo、month;

  if(m==1 || m==3 || m==5 || m==7 || m==8 || m==10 || m ==12)

  monthinfo、daysofmonth=31;

  if(m==2)

  {

  if(monthinfo、leap)

 monthinfo、daysofmonth = 29;

  else

 monthinfo、daysofmonth = 28;

  }

  return monthinfo; } /* This module is to initialize the monthinfo、 */

 struct info setinit(int year) {

  int i,days,total;

  struct info monthinfo;

  monthinfo、month=1;

  monthinfo、firstdayofmonth=firstdayof1;

  for(i=1;i<year;i=i+1)

  {

  if(isleap(i))

 days=366;

  else

 days=365 ;

  monthinfo 、 firstdayofmonth=(monthinfo 、firstdayofmonth+days1)%7+1;

  }

  monthinfo、daysofmonth=31;

  monthinfo、leap=isleap(year);

  return monthinfo; } void main{ printf("

  \t\t************************************

 \n");

 printf("

  \t\t 歡 迎 使 用 萬 年 歷 演 示 程 序

 \n");

 printf("

  \t\t************************************

 \n");

  int year ;

  struct info monthinfo;

  year = checkinput;

  monthinfo = setinit(year);

  output(monthinfo); } 3 . 單元測試

 白盒測試

  ② ②. 黑盒測試 2015 年

  三月四月

  五月六月

 2016 年:

  三.

 總結(jié)體會 用 本次用 C 語言編寫得萬年歷系統(tǒng)主要實現(xiàn)了年歷、月歷、日歷得顯示。我根本就不喜歡敲代碼了, 瞧見代碼就頭疼。所以感覺厭惡這門專業(yè) 業(yè), 對學(xué)習(xí)也不感興趣了。而且, 還有一件更頭疼得事就是在寫一個簡單得程序時竟然老就是出錯, 難一點得,復(fù) 復(fù)懂 雜一點得程序竟然無從下手。但就是去瞧程序得參考答案時都瞧得懂, 又感覺很容易。學(xué)了軟件工程以后, 我就感覺我以前得學(xué)習(xí)方法就是錯誤得。以前我只注重于代碼 碼, 而不注重理論知識以及編程得思路, 程序得架構(gòu)。以至于在些程序時沒有寫程序得思路, 不能形成程序得架構(gòu)。只想到瞧腦袋里就是否有與此類似得代碼。越想程序越亂 亂, 最后腦袋里一片空白。不知道程序從哪個方面下手了。軟件工程這門課程就是做軟件開發(fā)得人必學(xué)得課程, 通過學(xué)這門課程,程 程 序員就會注重軟件開發(fā)得理論知識,以 以及做項目開發(fā)得思路。學(xué)了這門課程后您寫程序就不會去盲目得去套用代碼, 而就是

 理清此程序得架構(gòu)以及思路。程序該從什么時候開始, 什么時候結(jié)束。在中間需要添加什么樣得功能, 以完善該軟件。

 在設(shè)計初期, 首先溫習(xí)了課本內(nèi)容, 再次熟悉了一下 C 語言程序, 然后廣泛得查找有關(guān)萬年歷得資料, 并結(jié)合查找到得資料, 整理出設(shè)計得主要思路, 畫出流程圖, 最終寫出了源程序, 并編譯成功, 在實驗中, 碰到了不少問題, 其中包括如何獲取系統(tǒng)時間,如 如何計算任意時間得時間差, 這些困難, 都通過查閱資料與問同學(xué)得到了解決。當然 然,由 由于時間與能力得原因, 做得還不就是很完美。

 在這學(xué)期得課程序設(shè)計中, 收獲知識得同時, 還收獲了閱歷, 收獲了成熟, 通過查找大量資料, 請教老師, 以及不懈得努力, 不僅培養(yǎng)了獨立思考、 動手制作得能力, 在各種其它能力上也都有了提高。更重要得就是, 在課程序設(shè)計里, 我們學(xué)會了很多學(xué)習(xí)得方法 法, 知道了理論與實踐得巨大差別。而這就是以后最實用得, 真得就是受益匪淺。要面 對社會得挑戰(zhàn), 只有不斷得學(xué)習(xí)、實踐, 再學(xué)習(xí)、再實踐。同時在與老師與同學(xué)得交流過程中, 互動學(xué)習(xí), 將知識融會貫通。通過自己得努力, 做出了一個萬年歷, 對以后得學(xué)習(xí) 就是一個莫大得鼓舞, 激起了我得學(xué)習(xí)興趣與開發(fā)創(chuàng)新思維。

 在調(diào)試過程中主要得問題就就是結(jié)果得顯示問題, 顯示易錯位。以及函數(shù)之間調(diào)用問題。對于這些問題, 主要就是翻閱書籍與在網(wǎng)絡(luò)上尋找解決方案, 以及自己親自用找到得方法去測試, 最終成功得解決了問題。

 通過這次課程設(shè)計,對 使我對 C 語言了解不再停留在書面得了解, 而就是有了更深得理解, 培養(yǎng)了自己得分析能力與設(shè)計能力, 受益匪淺。

推薦訪問: 軟件工程 安徽 工業(yè)大學(xué)

【安徽工業(yè)大學(xué)軟件工程實驗報告】相關(guān)推薦

工作總結(jié)最新推薦

NEW