佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

搜索
查看: 666|回复: 0

help me solve the c++ problem

[复制链接]
发表于 29-4-2015 04:37 PM | 显示全部楼层 |阅读模式
During the family day at TADIKA UPSI, acomputer system gaming competition is designed for 5-6 years old children. 3children are registered for the competition. In the competition, the childrenare required to enter 50 numbers. These numbers will be categorize into 3categories which are positive numbers, negative numbers and zeros. As aprogrammer you are required to write acomplete program in C++ to produce the output of the following tasks:
a)        total numbers that are entered bythe 3 children for each category (positive, negative and zero).
b)         themost category of number that are entered.
c)         displaytotal numbers for each category that are entered and most category number that areentered.

You should:
a)        Analyzethe problem (input, process and output).
b)        Drawa flow chart.                                          
c)        Developa program based on the above flow chart.

d)        Printout an output of the program.   

我做了還是錯,誰可以幫我看看哪裏錯了嗎?
感激不盡~

#include <iostream.h>
using namespace std;

int main()
{
    int student;
    int number[50],x;
    int count[50];
    char category;
   
    cout<<"*****Student*****"<<endl;
    for (student=0; student<=3; student++)
   
    {   // penting
    cout<<"Enter your number:";
    cin>>number[50];
   
    for (x=0; x<=50; x++)
    { // 1 open
        cout<<"Enter your number:";
        cin>>number[x];
        }
    {
        if (number>0)
        {
           cout<<"Positive numbers."<<endl;
           }
        else if (number<0)
        {
             cout<<"Negative numbers."<<endl;
             }
        else if (number==0)
            {
              cout<<"Zero!"<<endl;
              }
        else
            {
              cout<<"Error."<<endl;
              }
   
    } // 1 close
   
    } // penting
   
    cout<<"The most category printed is: "<<endl;
    for (x=0; x<=50; x++)
    cout<<category<<endl;

    system("PAUSE");
    return 0;
}

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

所属分类: 欢乐校园


ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2026 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 26-4-2026 10:29 AM , Processed in 0.069481 second(s), 13 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表