C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[7685] error display
kim [] 1591 읽음    2001-05-22 21:58
무엇이 잘못인지 알려주세요.
숫자 입력후에 디스플레이가 안돼요.

#include <iostream.h>
#include <ctype.h>
void DisplayIntroduction(void);
void DisplayMainMenu(void);
int GetMenuSelection(int Min, int Max);
void MenuSelection(int Select);
int GetIntegers(void);
void DisplayStatistics (void);


void Pause (void);
const int
          MAX_NBR_INTEGERS = 30;

void main(void)
{
      //int
       //    Nums[MAX_NBR_INTEGERS] = {0},
        // NbrInteger = 0;
        DisplayIntroduction();
      //GetIntegers();
}
void DisplayIntroduction(void)
{
        cout  <<"This program calculates the mean, median, and mode"
              <<"\nof up to 30 integers (each between 0 and 9)";
      DisplayMainMenu();
}
void DisplayMainMenu(void)
{
        cout  <<"\n\nMain Menu"
            <<"\n\t1. Enter integers"
            <<"\n\t2. Display statistics"
            <<"\n\t3. Clear integers"
            <<"\n\t0. Exit"
            << "\n Choose an option ==>  : ";
      GetMenuSelection(0, 3);
}
int GetMenuSelection (int Min, int Max)
{
      int
          Select = Min - 1;

      cin   >> Select;
      while((Select < Min)||(Select > Max))
        {
              cout << "\n ********** Error ********** !" << endl
                 << " Please enter number in range 0 to 3 >  ";
            cin >> Select;
      }
      MenuSelection(Select);
      return Select;

}
void MenuSelection(int Select)
{
      int
         Nums[30];
      if (Select == 1)
      {
            GetIntegers();
      }
      else if (Select == 2)
      {
              DisplayStatistics();
            for (int i = 0; i < MAX_NBR_INTEGERS; i++ )
                cout  << Nums[i] << "  ";

      }
}
int GetIntegers(void)
{
        int
            Nums[MAX_NBR_INTEGERS];
        cout  <<"\nEnter a string of integers (each between 0 and 9),ending in -1."
            <<"\nAny more than 30 integers will be ignored."
            <<"\nExample: 9 3 3 4 1 1 7 2 -1\n";
      for (int i = 0; i < MAX_NBR_INTEGERS; i++ )
      {
              cin  >> Nums[i];
             if    ((Nums[i] >9)||(Nums[i] < -1))
                   {
              cout  << "\nERROR:An invalid integer has been ignored:  ";
                  cout  << Nums[i]
                    << "\n";
            }
            else if (Nums[i] == -1)
            DisplayMainMenu();
         }
        return Nums[MAX_NBR_INTEGERS];
}


void DisplayStatistics (void)
{
      int
            Nums[MAX_NBR_INTEGERS];
        cout  << "Sorting Integers\n"
              << "\n================"
            << "\nThe unsorted integers:\n" ;




}



void Pause (void)
{
        cout<<"\n\n\n\n      Press enter to continue...";
        char
            ch = '\0';
        cin.get(ch);
        while ((ch != '\n')&&(ch != '\r'))
            cin.get(ch);
}



+ -

관련 글 리스트
7685 error display kim 1591 2001/05/22
7693     Re:error display 박지훈.임프 1473 2001/05/23
7696         Re:Re:error display kim 1625 2001/05/23
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.