Thread: Help with programs

  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,688
    For the second one you could use nested for loops.
    Or do it the simpler way and use a load of cout statements
    Double Helix STL

  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
    Ireland
    Posts
    8,446
    Code... Show us code. We are remarkably incapable of solving problems. We are programmers, after all. We need code.
    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,688
    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 << '*';
    Double Helix STL

  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,688
    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.
    Double Helix STL

  12. #27
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    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
    Double Helix STL

  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
    Ireland
    Posts
    8,446
    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.
    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.

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, 07: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, 05: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