Search:

Type: Posts; User: rushhour

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    3,377

    subtracting fractions in classes

    Hi

    I am having difficulty in creating a function for subtracting fractions in a class. I was given this advice to do it


    and my attempt is shown below:



    void Fraction::subtract(Fraction...
  2. Replies
    4
    Views
    4,269

    yes, but what if you want to test for say 100...

    yes, but what if you want to test for say 100 numbers, and you want to know if the number of compares and swaps are correct. we know that trying to do this by hand is quite long, how can the program...
  3. Replies
    4
    Views
    4,269

    testing a bubble sort algorithm

    Hi.

    I have created a program which uses the bubble sort to generate random numbers and sort them using a bubble sort. I then created two functions which would count the number of compares and...
  4. Replies
    21
    Views
    3,596

    Thank you very much for helping me. Seemed simple...

    Thank you very much for helping me. Seemed simple now that I have thought about it.
  5. Replies
    21
    Views
    3,596

    So how would I go about correcting it? Sorry to...

    So how would I go about correcting it? Sorry to be of bother but it has been a long day trying to get this working, and now more problems seem to appear as I go on seems like I will never make the...
  6. Replies
    21
    Views
    3,596

    #include #include #include...

    #include <iostream>
    #include <cstdlib>
    #include <ctime>
    using namespace std;

    typedef int intArray[];
    void generate(intArray nums, int size, int low, int high);
    void bubSort(intArray nums, int...
  7. Replies
    21
    Views
    3,596

    I mean 35 before sorting, not after sorting.

    I mean 35 before sorting, not after sorting.
  8. Replies
    21
    Views
    3,596

    Ok, but can you tell me why it still replaces one...

    Ok, but can you tell me why it still replaces one of the numbers? e.g. the output is:


    How many numbers to sort? 10
    Numbers generated...
    24 44 99 1 37 13 96 5 98 72
    After...
  9. Replies
    21
    Views
    3,596

    So must the for loop be changed like this? ...

    So must the for loop be changed like this?


    for(int s = 0; s < size; s++)


    Really sorry, but i really am struggling to find the solution to the problem at hand.
  10. Replies
    21
    Views
    3,596

    Ok well I've changed it, but it seems to be...

    Ok well I've changed it, but it seems to be missing a number again, which was the second problem that I was having. My output now displays:


    How many numbers to sort? 10
    Numbers generated...
    ...
  11. Replies
    21
    Views
    3,596

    Sorry but, I really am struggling to know why it...

    Sorry but, I really am struggling to know why it is doing this. Is the problem within the bubSort code?
  12. Replies
    21
    Views
    3,596

    Ok, well I've sorted out one problem in that it...

    Ok, well I've sorted out one problem in that it now doesn't replace numbers and the output is the following:



    How many numbers to sort? 10
    Numbers generated...
    73 93 48 50 86 62 45 ...
  13. Replies
    21
    Views
    3,596

    There is one other problem though, it seems as...

    There is one other problem though, it seems as though my program sorts the numbers out, but some just disappear such as what happens in this one:



    How many numbers to sort? 10
    Numbers...
  14. Replies
    21
    Views
    3,596

    Sorry, I seem really stupid now not noticing the...

    Sorry, I seem really stupid now not noticing the most important part of the program not being there!! Thanks very much.
  15. Replies
    21
    Views
    3,596

    bubble sort not sorting numbers in order.

    Hi,

    I was wondering if you can help me figure out why my bubble sort is not sorting the random numbers in order. My code is the following:



    #include <iostream>
    #include <cstdlib>
    #include...
  16. Replies
    4
    Views
    1,678

    So I just need to take out the new lines and it...

    So I just need to take out the new lines and it should display as normal? Also I have not completed the elapsed() function yet, so I will expect the output to be 0:0
  17. Replies
    4
    Views
    1,678

    There appeas to be no erros now when I compile...

    There appeas to be no erros now when I compile it, but my output displays the following:




    9 jaguar% g++ time.cc
    10 jaguar% ./a.out
    Enter start hh mm : 7 30
    Enter finish hh mm : 7 29
    Time...
  18. Replies
    4
    Views
    1,678

    Problem with time program

    Hi, I have a program which is supposed to give the time elapsed from a given time to another given time. There were three functions which were incomplete setTime(), display1Time()and elapsed(). I...
  19. Replies
    20
    Views
    3,019

    No Ive just forgotten how I did it.

    No Ive just forgotten how I did it.
  20. Replies
    20
    Views
    3,019

    Very true, but with my illness its hard to...

    Very true, but with my illness its hard to concentrate, and really cant remember how I did it, so if you could please help me, I would be grateful.
  21. Replies
    20
    Views
    3,019

    Ok thanks, I did use this, but I honestly forget...

    Ok thanks, I did use this, but I honestly forget how to use this getline command can you tell me how to use this to solve the problem of continuing to display the menu options untill i press control...
  22. Replies
    20
    Views
    3,019

    And what would that be? (sorry I'm asking alot,...

    And what would that be? (sorry I'm asking alot, my illness doesn't help me concentrate, but i'd rather get it done now)
  23. Replies
    20
    Views
    3,019

    Thanks it works now, but now I am getting a...

    Thanks it works now, but now I am getting a further problem. Every time I enter an author's name in the format Brook, Frederick it seems that the program goes into a continuous mode of displaying the...
  24. Replies
    20
    Views
    3,019

    Can you please help me with a solution to solve...

    Can you please help me with a solution to solve this problem them. I'm sorry but I don't want to use vectors, I at least want to try solving the problem this way before using vectors. I also tried it...
  25. Replies
    20
    Views
    3,019

    So what should be there instead? Sorry I can't...

    So what should be there instead? Sorry I can't exactly understand it, just feeling a little ill and can usually correct these things, but today I just want someone to help me so I can get on with the...
Results 1 to 25 of 42
Page 1 of 2 1 2