CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: TheStorm

Search: Search took 0.03 seconds.

  1. Replies
    8
    Views
    992

    Re: Fun with ASCII

    This is as far as I got. Dont know if it makes any sense. The idea is that I will be able to interchange the char used to create the triangle.



    // Draws a triangle
    #include <iostream>
    using...
  2. Replies
    8
    Views
    992

    Re: Fun with ASCII

    Thank you Alan, I thought "void displayOneLine(int sizeP)" was declairing only one int. Also the code below only shows # on the screen, in a continious loop. Not sure why but whenever I use "="...
  3. Replies
    8
    Views
    992

    Re: Fun with ASCII

    That worked a treat thank you. Now I would like to chnage the void function to only use one int statement. I tried the following but it does not work. Feels like the more I learn the more I dont...
  4. Replies
    8
    Views
    992

    Re: Fun with ASCII

    Here is what I have managed to do so far. The last thing I need to do is add an additional line at the top to complete the triangle. Below is the output that I get at the moment.
    ...
  5. Replies
    8
    Views
    992

    Fun with ASCII

    Hallo all, I am trying to create a program that will draw a nice little picture using ASCII. So far I have managed to draw half the triange I intended. My question is how would I draw the rest of the...
  6. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    That's what the assignment said.
  7. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    Thank you for your responses. The assignments requirements are that x must count towards the spoilt votes.
  8. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    Finally it works. Thank you for all your help.

    Here is the final code:




    #include <iostream>
    using namespace std;
  9. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    Thank you but the original assignment states that I can not use do..while. Part of the construct is given and it does not include do...while statemts.
  10. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    One last thing I need the code to see any character other than A B C as a spoilt vote. This should include X, as it stands now it reads every character except A B C and X as a spoilt vote.
  11. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    Changing the code to below worked. Thank you for your help.




    //Loop over voters
    cout << "Who are you voting for (A,B or C)? " << endl;
    cin >> vote;
    while ( vote != 'X' &&...
  12. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    You are right, what I meant to say was nested while statement. As I assume you know by now this is all pretty new to me and all the terms are at times confusing.
  13. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    Maybe this reads better:




    #include <iostream>
    using namespace std;

    int main ()
    {
  14. Replies
    25
    Views
    10,103

    Re: Nested switch statement

    Even if I exclude the vote in:

    cout << "Who are you voting for (A,B or C)? " << endl;
    cin >> vote; // This vote will never be counted

    The votes still dont add up also how would i include the...
  15. Replies
    25
    Views
    10,103

    Nested switch statement

    Yet another question from a student. For a assignment I was asked to create a program that will calculate the amount of votes in a election. There are four voting stations and three candidates.
    ...
Results 1 to 15 of 15





Click Here to Expand Forum to Full Width

Featured