请帮我一下! [英] Please help me get started!

查看:68
本文介绍了请帮我一下!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须从头开始写这个,我该怎么做才能开始?我想要编写一个程序,计算每个费用分类中有多少人在某一天乘坐地铁(这是一组if语句)。地铁有三种费用分类:学生(17岁或以下)成人和高级(65岁或以上)。我必须假设售票员有一台笔记本电脑并进入每个骑手的年龄。您的指示告诉指挥在当天结束时输入-1以终止数据输入过程(循环将导致程序继续直到输入-1)。


输入-1后停止数据输入过程,您的程序必须显示每个费用类别中的客户数量。


从哪里开始?任何帮助将不胜感激

I have to write this from scratch, what do I do to start? I''m suppose to write a program that counts how many of each fee classification rode the subway on a given day (this is a set of if statements). The subway has three fee classifications: students (17 years old or less) adult, and senior (65 years old or more). I have to assume that the conductor has a laptop and enters the age of each rider. Your instructions tell the conductor to enter a -1 at the end of the day to terminate the data entry process ( a loop will cause the program to continue until a -1 is entered).

After the -1 is entered to stop the data entry process, your program must display the number of customers in each fee category.

Where to start? Any help would be greatly appreciated

推荐答案

从创建一个while循环开始,让你输入数字并在输入-1时停止(或者可以是任何减值)
Start with creating a while loop that lets you enter numbers and stops when you enter a -1 (or may be any minus value)


展开 | 选择 | Wrap | 行号


你需要使用cin,你能写一行吗?允许用户输入数字。
Well you are going to need to use cin, can you write a single line that allows the user to input a number.


这篇关于请帮我一下!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆