| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1857 人关注过本帖
标题:高手帮下忙呀!编译器发出警告打不开graph.h文件
只看楼主 加入收藏
酒精
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2010-1-25
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:3 
高手帮下忙呀!编译器发出警告打不开graph.h文件
/*---------------------------------------------
Billing Log:Compute and print the daily billing log for action advertising


Program:  chapter4.c
Author:   yihun
Date:january 25 in 2010
Project:sample program
********************************************/


/*----------------PREPROCESSING DIRECTIVES-----------------*/
#include  <stdio.h>
#include  <string.h>
#include  <graph.h>



/*-------------FUNCTION PROTOTYPES--------------------------*/
void  PrnHeadings(void);                  /*print heading*/
void  ProcessLoop(void);                  /*process loop*/
void  InputName(void);                   /*input name*/
void  InputBillData(void);               /*input billing date*/
float CalcBill(void);                    /*calculate the cilent bill*/
void  PrnDetail(float);                    /*print detail line*/
float CalcAverBill(float);                  /*calculate averge bill*/
void  PrnTotals(float,float);               /*print the total line*/


/*------------------pragram setup-------------------*/


/*>      REPORT  TITLES AND HEADINGS      <*/

char PT1 []="  A C T I O N    A D V E R T I S I N G ";
char PT2 []="            Daily Billing Log          ";
char HT1 []="            Time spent   Hourly  Daily ";
char HT2 []="   Account  on Account   Charge   Bill ";
char TL1 []="Total Daily Billing:                  $";
char TL2 []="Averge Daily Billing:                 $";

/*>      PRAGRAM  VARIABLES               <*/
char sName [18];                          /*client name */
float fTime;                              /*time spent on account*/
float fCharge;                            /*charge for work*/
int  iCount;                              /*number of clients*/

/*----------------------------------------------------
MAINING   CONTROL
----------------------------------------------------*/

main()
{
    PrnHeadings();                          /*print report headings*/
    ProcessLoop();                          /*processing loop*/
    return 0;
 }


 /*-----------------------------------------------------
     PRINT    REPORT  HEADINGS
  -----------------------------------------------------*/

  void PrnHeadings(void)
{
    fprintf(stdprn,"\r\f");            /*reset to top of page*/
    fprintf(stdprn,PT1);               /*print page title 1 */
    fprintf(stdprn,"\r\n");             /*reset &single space*/
    fprintf(stdprn,PT2);                /*print page title 2*/
    fprintf(stdprn,"\r\n\n\n");          /*reset triple space*/
    fprintf(stdprn,HT1);               /*print heading line*/
    fprintf(stdprn,"\r\n");            /*reset &single space*/
    fprintf(stdprn,HT2);                /*reset &single space*/
    return;
 }


 /*------------------------------------------------------
      PROCESSING      LOOP
  ------------------------------------------------------*/
  void ProcessLoop(void)
  {
      float fBill;                          /*client bill*/
      float fTotBill;                       /*report total bill*/
      float fAvrBill;                      /*report averge bill*/

      _clearscreen(0);InputName();
      while(strcmp(sName,"stop")!=0 )
      {
      InputBillData;
      fBill=CalcBill();
      fTotBill=fTotBill+fBill;
      PrnDetail(fBill);
      -clearscreen(0);
      InputName();
   }
    fAvrBill=CalcAvrBill(fTotBill);
    PrnTotals(fTotBill,fAvrBill);
    return;
   }



   /*---------------------------------------------------------
           INPUT CLIENT NAME
   ------------------------------------------------------*/
   void InputName(void)
   {
       printf("\n\nEnter client or 'stop' to Qiut:");
       scanf("%[^\n]",sName);
       fflush(stdin);
       return;
   }

   /*-----------------------------------------------------------
          INPUT BILLING DATA
   --------------------------------------------------------*/
   void InputBillData(void)
   {
       printf("   Enter time spent on accout:" );
       scanf("%f",       &fTime);
       printf("   Enter hourly charge:");
       scanf("%f",&fCharge);
       fflush(stdin);
       return;
   }

   /*---------------------------------------------------------
             CALCULATE BILL
   ----------------------------------------------------------*/
   float CalcBill(void)
   {
       float fBill;

       iCount++;
       fBill=fTime*fCharge;
       return fBill;
   }

   /*-----------------------------------------------------------
              PRINT DFTAIL LINE
    -----------------------------------------------------*/
   void PrnDetail(float fBill)
   {
       fprintf(stdprn,"\r\n%-15s   %4.1f   %6.2f   %7.2f",
        sName, fTime,fCharge,fBill);
       return;
   }
   /*-----------------------------------------------------------
             CALCULATE AVERGE BILL
   ------------------------------------------------------------*/
   float CalcAvrBill(float fTotBill)
   {
       float fAvrBill;

       fAvrBill=fTotBill/iCount;
       return fAvrBill;
  }


  /*------------------------------------------------------------
               PRINT TOTAL LINES
 --------------------------------------------------------------*/
 void PrnTotals(float fTotBill,float fAvrBill)
 {
     fprintf(stdprn,"\r\n\n%-35s%7.2f",TL1,fTotBill);
     fprintf(stdprn,"\r\n%-35s%7.2f\r", TL2,fAvrBill);
     return;
  }
搜索更多相关主题的帖子: graph 警告 编译 文件 
2010-01-25 23:53
cnfarer
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:179
帖 子:3330
专家分:21157
注 册:2010-1-19
收藏
得分:5 
从哪儿弄来的,太老了吧?!
找DOS下编译器吧!

★★★★★为人民服务★★★★★
2010-01-26 08:17
cnfarer
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:179
帖 子:3330
专家分:21157
注 册:2010-1-19
收藏
得分:15 
还是花了一点时间给你找了头文件,并作适当修改,能编译运行!

一定要注意环境啊!

test.rar (8.92 KB)


[ 本帖最后由 cnfarer 于 2010-1-26 08:35 编辑 ]

★★★★★为人民服务★★★★★
2010-01-26 08:31
酒精
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2010-1-25
收藏
得分:0 
谢谢阁下!!!
2010-01-26 11:16
快速回复:高手帮下忙呀!编译器发出警告打不开graph.h文件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031908 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved