使用C ++开发调查结果 [英] develop survey results using C++

查看:49
本文介绍了使用C ++开发调查结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是.net程序员,因此我遇到了这个小问题,希望您能为此提供帮助.

我不太擅长c ++编程,但遇到了这个问题,我需要解决它.

我需要编写一个程序以绘制调查结果.
该调查是关于在线旅行社使用情况的.
如果用户始终使用在线服务(直到他从未使用在线服务)降至1,则将输入5.

用户输入完调查后,程序将打印调查结果,如下所示:

| 11
| * 10
| * *
| * 8 *
| * * *
| 6 * * *
| * * * *
| * * * *
| 3 * * * *
| * * * * *
| * * * * *
| * * * * *
| -----------------------------------------
1 2 3 4 5



因此,有人可以帮助我吗,因为我对c ++不熟悉

非常感谢您!!!!!

Hi everyone,

I am a .net programmer and I face this small issue and hope you are able to help me with this it.

I am not good in c++ programming but I have had this problem and I need to solve it.

I need to write a program to draw the survey results.
The survey is about the online travel agencies usage.
The user will enter 5 if he always use the online service down to 1 that he never use the online service.

When the user finishes entering the survey, the program will print the survey results as shown on the following :

| 11
| * 10
| * *
| * 8 *
| * * *
| 6 * * *
| * * * *
| * * * *
| 3 * * * *
| * * * * *
| * * * * *
| * * * * *
|-----------------------------------------
1 2 3 4 5



So, can anybody help me with this because I am not familiar with c++

thank you so much!!!!

推荐答案



我不确定我是否完全了解您想要做什么,但是也许您会发现此回复仍然很有用.
据我了解,图表中的垂直轴代表每个问题,水平轴打印的* s等于用户给出的答案等级?
您有12行,所以我将假设12个问题.假设问题的答案存储在数组答案中.

您会像这样阅读您的答案:


I''m not sure if I fully understand what you want to make, but maybe you''ll find this reply useful anyway.
From what I understand, the vertical axis in your chart represents each question and the horizontal axis prints a number of *s equal to the rating the user gave as answer?
You have 12 lines so I''ll assume 12 questions. Let''s say the answers to the questions are stored in an array answer.

You''d read your answers like so:
int answer[12];
printf("Question 1: How often do you use this online service? [1-5]\n");
scanf("%d",&answer[0]);
printf("Question 2: How often do you use this other online service? [1-5]\n");
scanf("%d",&answer[1]);
// Do this for every question you want to ask



现在,您可以像这样打印结果:



Now you print the results like so:

for(int i=0;i<12;i++){  // Loop through every question
    putchar(''|'');
    for(int j=0;j<answer[i];j++)>
        putchar(''*'');  // Print a number of *s equal to the rating
    putchar(''\n'');
}
printf("|-----------------------------------------\n1 2 3 4 5\n");



如果纵轴不是问题,而是例如有多少人投票给某个分数[1-5],则可以将这些分数存储在类似的数组中,并以与本示例相同的方式打印结果.



If the vertical axis doesn''t mean questions but for example how many people voted a certain score [1-5], you can store these scores in a similar array and print the results much the same way as in this example.


嘿,这根本不是赋值,

我是asp.net开发人员,我使用vb.net,但问题是我从未处理过c ++:thumbsdown:.我只需要全部语法,如果您想要vb.net中的代码,我可以为您提供支持. :omg:
hey people it''s not assignment at all ,

I am asp.net developer and i use vb.net but the problem is that i never deal with c++:thumbsdown:. i just need the syntax that is all ,if you want the code in vb.net i can support you with it . :omg:


非常感谢Thaddeus Jones.

几乎是正确的:)

我将立即尝试.

> Dalek Dave感谢您编辑我的主题,对我来说,这确实是一项艰巨的任务:((在c ++中解决这一问题.

这里有些人只需要修改旧系统.

这就是为什么我把这个放在这里.
Thank you so much Thaddeus Jones.

almost it''s the right :)

i will try it now.

>Dalek Dave thank you for editing my subject , and really it was very hard task for me :(( to solve this one in c++.

here some people needs just to modify the old systems.

that is why i put this one here.


这篇关于使用C ++开发调查结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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