Forum Replies Created

Viewing 15 posts - 76 through 90 (of 93 total)
  • Author
    Posts
  • in reply to: Help with this C coding #3484
    GWILouisaxwzkla
    Participant

    try:

    in reply to: Please Help with this Question #3480
    GWILouisaxwzkla
    Participant

    What type of input are you using ( from the console , a file ) ??

    in reply to: Please help me #3478
    GWILouisaxwzkla
    Participant

    3.

    2.

    in reply to: Please help me #3477
    GWILouisaxwzkla
    Participant

    Do you have a formula for the sum of the first series ( or the name ) ?

    in reply to: please help me about turbo c prog problem? #3476
    GWILouisaxwzkla
    Participant

    Could do:

     

    in reply to: program to make spiral matrix #3475
    GWILouisaxwzkla
    Participant

    I think this does what you want it to:

    heres the ouput:

    enter the size of the matrix: 5

    1 6 11 16 21
    2 7 12 17 22
    3 8 13 18 23
    4 9 14 19 24
    5 10 15 20 25
    Press any key to continue

    in reply to: program to make spiral matrix #3473
    GWILouisaxwzkla
    Participant

    Can you give a definition of spiral matrix?

    in reply to: help combining strings #3472
    GWILouisaxwzkla
    Participant

    Could try:

    in reply to: Help with switch #3471
    GWILouisaxwzkla
    Participant

    This seems to work:

    in reply to: Help kids program … #3468
    GWILouisaxwzkla
    Participant

    Heres a list of free compilers:

    http://www.thefreecountry.com/compilers/cpp.shtml

    I would suggest the Borland or Microsoft compilers. Second, is your application to be a Windows or DOS program?

    in reply to: my own header file?? #3469
    GWILouisaxwzkla
    Participant

    Heres a link on making static header files with VC++.

    http://www.functionx.com/visualc/libraries/staticlib.htm

    VC++ is Microsoft’s trademark name for their C++ compiler. It uses standard C++ grammar…

    in reply to: C- help with Clear screen #3466
    GWILouisaxwzkla
    Participant

    This version works with this file format:

    A for loop is designed to

    a.)run only if the condition is false
    b.)run a set number of times
    c.)run at least once
    d.)run when there are no conditions
    @
    A while loop is designed to

    a.)run only if the condition is true
    b.) run a set number of times
    c.)run at least once
    d.)run when there are no conditions
    @

    in reply to: C- help with Clear screen #3464
    GWILouisaxwzkla
    Participant

    What I might do is put a marker in between each question in the file so that one can be read at a time , like:

    A for loop is designed to

    a.)run only if the condition is false
    b.)run a set number of times
    c.)run at least once
    d.)run when there are no conditions

    @

    A while loop is designed to

    a.)run only if the condition is true
    b.) run a set number of times
    c.)run at least once
    d.)run when there are no conditions

    so that you can read up to the ‘@’ character , stop and get the answer and then continue. You could make the while loop read one word at a time ( stopping when you read ‘@’ ) and then get the answer.

    in reply to: coin toss #3460
    GWILouisaxwzkla
    Participant

    heres a simpler version ( no driver function ). Seems to work fine – needs to be tested….

    /****************************************************************
    * File Name : c:programshelppermutations.cpp
    * Date : August,1,2002
    * Comments : new project
    * Compiler/Assembler :
    *
    *
    *
    *
    *
    * Program Shell Generated At: 5:59:12 p.m.
    =-=-=-=-=-=-=-=–=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

    #include < iostream >
    //#include < string.h >
    //#include < conio.h >
    //#include < math.h >
    //#include < iomanip >
    //#include < ctype.h >

    using namespace std;

    //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ FUNCTION PROTOTYPES @@@@@@@@@@@@@@@@@@@@@@@@@@

    void coinPermutations ( int flips , char * permutations );

    //##################################################################################

    //main function ******************************

    int main ( )
    {
    int numberOfFlips;

    cout << "enter number of flips: ";
    cin >> numberOfFlips;
    cout << "permutations: " << endl;
    char * permutations = new char [ numberOfFlips + 1 ];
    permutations [ numberOfFlips ] = 0;
    coinPermutations ( numberOfFlips – 1 , permutations );
    delete [] permutations;

    return 0 ;
    }

    /******************************* FUNCTION DEFINITION ******************************

    Name : coinPermutatins
    Parameters :

    face a(n) char

    Returns: Void type
    Comments:

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    void coinPermutations ( int flips , char * permutations )
    {

    if ( flips == 0 )
    {
    permutations [ flips ] = ‘t’;
    cout << permutations << endl;
    permutations [ flips ] = ‘h’;
    cout << permutations << endl;
    return;
    }

    permutations [ flips ] = ‘t’;
    coinPermutations ( flips – 1 , permutations ) ;
    permutations [ flips ] = ‘h’;
    coinPermutations ( flips – 1 , permutations );

    return;
    }

    in reply to: Oops! problem using c++ #3463
    GWILouisaxwzkla
    Participant

    What type of data structure are you to use ( linked list ? ).

Viewing 15 posts - 76 through 90 (of 93 total)