Help with programs

This is a discussion on Help with programs within the C++ Programming forums, part of the General Programming Boards category; I will....

  1. #16
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    I will.

  2. #17
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    For the second one you could use nested for loops.
    Or do it the simpler way and use a load of cout statements
    I'm just trying to be a better person - My Name Is Earl

  3. #18
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    for program number 2 what I need to do is ask for the number of asterisks in the bow tie and save that to a variable. Then take that variable and print out a bow tie looking thingamabob.

    Sort of like this.

    assuming 17 asterisks

    * *
    ** **
    *****
    ** **
    * *

  4. #19
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    lets try that again.

    assuming 17 asterisks

    *_____*
    **___**
    ***_***
    **___**
    *_____*

  5. #20
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    Code... Show us code. We are remarkably incapable of solving problems. We are programmers, after all. We need code.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #21
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    Well in that case create a variable to hold the value then use that value in a loop condtion to create the image you need.

    example

    Code:
    cout << "How many stars: ";
    cin >> stars;
    
    for ( int i = 1; i < stars; i++ )
       cout << '*';
    I'm just trying to be a better person - My Name Is Earl

  7. #22
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    BTW, I absolutly suck at math and have avoided it so far in my classes so please dont assume that I understand all of the jargon. I understand that I should probably go out and learn it but I have a right to be lazy and darnit I exercise my rights. If you could try to help me without confusing me that would be great, all of the other message boards I have tried have jargoned me to the point that they started calling me a hopeless n00b.

    Also the sort and search program is supposed to use something called bubble sort and binary search. I dont know what those are really.

  8. #23
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    Oops, that wasent directed at you swgh, just bad timing on the post.

  9. #24
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    By the way, would it be a problem if I am using 2 different compilers to write my programs?

  10. #25
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    If you know how to count then it shouldn't be hard. The number of spaces decreases while the number of stars increase, when it gets to the middle it does the opposite. It's

    Google either Bubble sort and binary seach, if you're no good in math ignore the O(logN) and O(N^2) etc but I don't see how you can use those without understanding basic concepts that slip your grasp.

    What's the name of the course BTW. If it has a I in its title you should kidnap your teacher's dog to teach him a lesson

  11. #26
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    By the way, would it be a problem if I am using 2 different compilers to write my programs?
    Not really but you should stick to one that you are happy with and avoid switching over
    unless needs arise. Bubble sort uses arrays to acheive the results. Other mehods for sorting are vectors, interators and algorithms. I advise you look up all you can on your problems too. Try buying a decent beginners book, check out the recomendations on this site for the ones to get.
    I'm just trying to be a better person - My Name Is Earl

  12. #27
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    What's the name of the course BTW. If it has a I in its title you should kidnap your teacher's dog to teach him a lesson
    I dont get that indigo
    I'm just trying to be a better person - My Name Is Earl

  13. #28
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    If it's an introductory programming course, I don't think he should be asking you to use anything but library implementations of bubble sort and binary search. In other words, is your teacher asking you to re-create these algorithms or just use the algorithm library. If not then kidnap his dog, gain leverage.

  14. #29
    Registered User
    Join Date
    Nov 2006
    Posts
    66
    computer science 165

  15. #30
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    Yes. It's always the teacher's fault. Students never say these things:

    Quote Originally Posted by nesagsar
    but I have a right to be lazy and darnit I exercise my rights.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Page 2 of 4 FirstFirst 1234 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Recommend upgrade path for C programs
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-22-2007, 06:32 AM
  2. Reroute where programs write to
    By willc0de4food in forum C Programming
    Replies: 7
    Last Post: 09-21-2005, 04:48 PM
  3. How come Dev C++ cant run some programs??
    By Sephiroth in forum C Programming
    Replies: 41
    Last Post: 09-17-2005, 05:35 AM
  4. POSIX/DOS programs?
    By nickname_changed in forum C++ Programming
    Replies: 1
    Last Post: 02-28-2003, 04:42 AM
  5. executing c++ programs on the web
    By gulti01 in forum C++ Programming
    Replies: 4
    Last Post: 08-12-2002, 03:12 AM

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