jumping into c++ chapter 5 problem 7

This is a discussion on jumping into c++ chapter 5 problem 7 within the C++ Programming forums, part of the General Programming Boards category; Question:Write a program that provides the option of tallying up the results of a poll with 3 possible values. The ...

  1. #1
    Registered User
    Join Date
    Mar 2014
    Posts
    16

    jumping into c++ chapter 5 problem 7

    Question:Write a program that provides the option of tallying up the results of a poll with 3 possible values. The first input to the program is the poll question; the next three inputs are the possible answers. The first answer is indicated by 1, the second by 2, the third by 3. The answers are tallied until a 0 is entered. The program should then show the results of the poll—try making a bar graph that shows the results properly scaled to fit on your screen no matter how many results were entered?

    I have no idea what this means and what i have to do.

    Someone please help me.

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,768
    You should be a little more specific about what part you do not understand. This makes it easier to help you.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Mar 2014
    Posts
    16
    I really don't get the whole thing. Can you please try and explain it in a simpler way? I also have no idea how to code a graph. If you do, can you please tell me? Thanks!

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,768
    Is a "graph" really part of the requirements? That sounds like an awfully complex thing for a newbie. Anyway, as I interpret the assignment, it says:

    - First ask the title of the poll.
    - Then let users enter 1, 2 or 3 representing what vote they chose.
    - Continue let users enter 1, 2 or 3 until the user enters 0.
    - At that time, show how many 1, 2 and 3 votes the user entered (along with the poll title).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Nov 2013
    Posts
    79
    It means a side on, ascii bar graph, such as,

    Code:
    cout << "*****";
    cout << "***";
    cout << "*******";
    Now you have to work out a way as to how many "*" you display, you could use a for loop or switch statement etc ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 02-24-2014, 04:51 PM
  2. Jumping Into C++ - Chapter 8 Problem[3]
    By Mohamed Adel in forum C++ Programming
    Replies: 3
    Last Post: 08-28-2013, 09:14 AM
  3. Jumping To C++ - Chapter 8 Problem
    By Mohamed Adel in forum C++ Programming
    Replies: 4
    Last Post: 08-27-2013, 01:02 PM
  4. Jumping into C++ chapter 7 help
    By DarthOrmus in forum C++ Programming
    Replies: 2
    Last Post: 06-03-2013, 01:48 AM
  5. Jumping into C++ Chapter 5 problem 6 - Critique please
    By Kranky in forum C++ Programming
    Replies: 8
    Last Post: 03-07-2012, 04:44 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21