freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

簡易股票投資管理系統(tǒng)說明(存儲版)

2025-05-09 05:21上一頁面

下一頁面
  

【正文】 //若id=1為非正確會員 { result=search_club(clubs,id)。 if (passwd==clubs[result].pwd) { printf(順利登入,%s先生請繼續(xù)使用\n,clubs[result].name)。 int profit_pre。//呼叫副程式:讀取交易紀錄與內容 } else { trade_file = fopen(, w)。 printf(\n)。 printf(\n)。 switch(choice) { case 39。 //記錄買進行為 break。: profit_pre=calculate_pfo(my_pfo)。: print_portfolio(my_pfo)。: print_trade(trade)。 /*********儲存交易記錄結果**********/ save_trade(trade,index)。stock[i].code)。stock[i].EPS)。i++ ) { fscanf(fp,%d,amp。 fscanf(fp,%d,amp。 fscanf(fp,%d,amp。j++) { fscanf(fp,%f,amp。num)。trade[i].mount_buy)。 //傳回『交易記錄個數』}int search_stock(struct STOCKINFO stock[],int choice){ int i。i++ ) { if(clubs[i].id==choice) { return i。 int code。code)。 result1=search_pfo(my_pfo,code)。 my_pfo[rec_pfo].mount=m。 strcpy(trade[rec_trade].name,stock[result2].name)。 my_pfo[result1].mount=my_pfo[result1].mount+m。/*記錄買進歷史平均價*/ /***************在交易記錄檔中記錄買進動作**********/ rec_trade=rec_trade+1。 int code。code)。 result=search_pfo(my_pfo,code)。 printf(此次交易實現損益=%d\n,temp_ca。m)。 //temp用_計算實際交易價差 printf(請輸入股票代碼)。 } else { printf(請重新選擇\n)。i++) //計算買進歷史平均價 { temp_sum=temp_sum+my_pfo[result1].price_buy[i]。amp。 //記錄買進歷史平均價 /***************在交易記錄檔中記錄買進動作**********/ rec_trade=rec_trade+1。 //投資組合種類+1 my_pfo[rec_pfo].code=stock[result2].code。m)。 //temp用_加總 printf(請輸入股票代碼)。 //搜尋正確,則傳回該輸入代碼之pointer } } return 1。 for(i=1 。trade[i].price_sell)。trade[i].name)。 int num。 //讀入個股現價 for(j=1。 fscanf(fp,%s,amp。 //讀入會員密碼 }}int load_pfo(struct PORTFOLIO my_pfo[],FILE *fp){ int i,j。 for(i=1 。stock[i].equity)。 i=STOCK_NUM 。q39。 case 39。 switch(choice) { case 39。 case 39。: print_stock(stock)。choice)。 printf(\n)。 printf(\n)。 //已實現損益初始值=0 } fclose(pfo_file)。 }}void user_main(int index,struct STOCKINFO stock[],struct PORTFOLIO my_pfo[],struct REPORT trade[]){ FILE *pfo_file。 scanf(%d,amp。 scanf(%d,amp。: exit(1)。 //呼叫副程式:查詢是否在會員名單中 if(result==1) { printf(會員ID輸入錯誤,請重新執(zhí)行\(zhòng)n)。 case 39。clubs[i].name)。 scanf(%d,amp。 scanf(%c,amp。 printf( d. 刪除會員)。 int id。339。 //呼叫副程式manager_main } else { printf(密碼輸入錯誤!!!!請輸入正確密碼\n)。choice)。 printf(=========================================================)。 //輸入選項用_user_id /*************open stock file****************************/ if(stock_file = fopen(, r)) { load_stock(stock,stock_file)。 FILE *club_file。void save_portfolio(struct PORTFOLIO my_pfo[],int index)。int search_stock(struct STOCKINFO stock[],int choice)。int user_exam(struct CLUB clubs[])。 int mount_sell。 float price_avg。 float equity。 scanf(%c,amp。 int temp_sum=0。 //儲存現價 for(j=1。 // } fprintf(pfo_file,%d\n,rec_pfo)。 //列印代碼 printf(%s\t,stock[i].name)。i=STOCK_NUM 。trade[i].price_buy)。 i=num 。■ struct PORTFOLIO my_pfo[]:儲存資料的陣列。 default: printf(無效的選項\n)。 default: printf(無效的選項\n)。 printf(已實現損益=%d\n,profit_real)。 fflush(stdin)。s39。: view_info(stock)。 printf(\n)。 printf(\n)。 //投資組合種類初始值=0 } fclose(trade_file)。 //重要數值_紀錄未實現損益 char choice。passwd)。 printf(\n)。 default: printf(無效的選項\n)。id)。 } break。 exit(1)。: for(i=1。printf(==================================================)。printf(====================main menu=====================)。: printf(歡迎使用此系統(tǒng),請繼續(xù)\n)。 } break。 //輸入選項 switch(choice) { case 39。 printf(\n)。 //呼叫副程式:讀入股票檔內容 } else { printf(無法開啟股票資料檔,程式終結!\n)。 /******定義四大arrry******/ struct STOCKINFO stock[STOCK_NUM+1]。 投資組合結構(PORTFOLIO)欄位意義欄位名稱股票代碼int code股票名稱char name[80]張數int mount買入歷史平均價float price_avg個股現價float price_now買入的價格float price_buy[50]4. 交易記錄的資料結構檔(REPORT):用來存放每次交易的資料。 ● 股票名稱 ● 價格 ● 股本● EPS :每股稅後盈餘● 本益比● 每股淨值:例 :含有3筆資料的股票資訊檔代碼 名稱 (某日)現價 股本 EPS(估) 每股淨值1101 臺泥 1216 統(tǒng)一 1301 臺塑 2. 會員資料檔: (程式預設數量2)提供系統(tǒng)執(zhí)行身份認證時,檢查會員之帳號、密碼。可供查詢之項目分別為:股票代碼、股票名稱、股票價格、股本、EPS、本益比、每股淨值。這個系統(tǒng)包含以下幾種的基本功能:查詢: 查詢方面,提供使用者查詢個股資訊,並可以細部查詢個股之詳細資料。包含下例欄位:● 股票代碼:證交所每支股票都有其編號,以方便交易。股票資料(STOCKINFO)欄位意義欄位名稱股票代碼int code股票名稱char name[80]價格float price股本float equityEPSfloat EPS本益比int ratio每股淨額char netvalue[10]2. 會員的資料結構會員資料(CLUB)欄位意義欄位名稱會員idint code會員名稱char name[80]會員密碼float price3. 會員手中持有投資組合結構(PORTFOLIO)。 FILE *club_file。 //輸入選項用_user_id /**********************open stock file************/ if(stock_file = fopen(, r)) { load_stock(stock,stock_file)。 //關閉讀檔 printf(=========================================================)。choice)。 //呼叫副程式manager_main } else { printf(密碼輸入錯誤!!!!請輸入正確密碼\n)。339。printf(\n)。printf(\n)。a39。 if(result!=1) { printf(會員ID重複輸入,新增失敗,請重新登入\n)。clubs[i].pwd)。 scanf(%d,amp。 //呼叫副程式:儲存結果 break。id)。 scanf(%d,amp。 //開啟交易記錄檔 int profit_pre。 //開一新檔案 rec_trade=0。 printf(b. 紀錄買進個股)。 printf(======================================)。v39。 case 39。//副程式:計算未實現損益 printf(p列印投資組合結果\tt列印交易記錄結果\n請選擇)。 //副程式:印出持有投資組合 printf(未實現損益=%d\t,profit_pre)。 //副程式:印出交易記錄 break。 /*************結束程式**************/ exit(1)?!?參數:■ struct STOCKINFO stock[]:儲存資料的陣列。 //讀入『交易記錄個
點擊復制文檔內容
公司管理相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1