Like Tree4Likes
  • 3 Post By grumpy
  • 1 Post By rags_to_riches

Newbie needs help/ assistance !

This is a discussion on Newbie needs help/ assistance ! within the C++ Programming forums, part of the General Programming Boards category; Hello! I am new at this and am having troubles with using PLEASE(C++ with training wheels). I understand loops, statements, ...

  1. #1
    Registered User
    Join Date
    Mar 2013
    Location
    Cumming, Georgia, United States
    Posts
    4

    Newbie needs help/ assistance !

    Hello! I am new at this and am having troubles with using PLEASE(C++ with training wheels). I understand loops, statements, function, ect....but I think I am tripping up on the math part. I have search the web all over for examples but have not found anything. I'm taking a class online, and we are not provided with many examples, so it's very difficult for someone like me.

    I am currently tripped up on this. i need to ask a user for a number between 5-12 and reject any others. Then I need to take the number, display a times table up to that number. so if I choose 5 then the output needs to look like this...

    1 2 3 4 5
    2 4 6 8 10
    3 6 9 12 15
    4 8 12 16 20
    5 10 15 20 25

    Make sense to any one? Heres my screen shot of the program so far. the highlighted part is literally what i have been playing with for 5 hours now(we have 30 min to complete each one and then we get a new problem). I want to know how to do this regardless if this problem expired. I feel I would benefit from it. I've got 7 of these to get done this weekend, and am getting no where, so I would REALLY appreciate any direction or help! thank you!

    I should add that it HAS TO BE in this format, or the program will not run. Its set up like this to get people like me to learn it first...like i said before, training wheels.


    Name:  help1.JPG
Views: 449
Size:  45.4 KB
    Last edited by Lauren Nicole; 03-28-2013 at 11:46 PM.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,266
    That bit you've highlighted is the result of six hours work?????? Pull the other leg, it plays jingle bells. To put it bluntly, people here are not THAT gullible.


    The code before the stuff you've highlighted will read a number, complain if the number is invalid, but not do anything to prevent subsequent code receiving invalid input. You need a loop there as well (loop until valid input is received).


    In any event, since you claim to understand loops, all you need (assuming input value is 5, and those 5 lines of output are required) is two nested loops. There is nothing more complex mathematically in those loops than incrementing and multiplying.
    Right 98% of the time, and don't care about the other 3%.

  3. #3
    Registered User
    Join Date
    Mar 2013
    Location
    Cumming, Georgia, United States
    Posts
    4
    Actually, it is. I have tried numerous ways to get it to work partially, not at all, and getting infinite loops. Doesnt help that I have a fussy baby pulling at my leg 24-7, a needy hubby, and 9000 other things going on right now. So yes, that is what I got in 6 hours. Not to mention the research online to find help and re-reading the book over and over.

    And yes, I understand how while loops work, the theory of it....it makes sense to me but I cant work it.

    "There is nothing more complex mathematically in those loops than incrementing and multiplying." And how do I increment and multiply? I kow what the IF statement will do, and I know what a loop will do, just what you stated. Unfortunately, I am new(intro class) and am pretty much clueless on how to increment something this complex. I can do a loan calculator and give a user how many number of months to pay off a loan with a given payment and loan amount. But thats it . Otherwise I would not be here right now.

  4. #4
    Registered User
    Join Date
    Mar 2013
    Posts
    10
    In Your Highlighted Part of while loop Code You did n't Close If Statement Also!!
    You need a loop there as well subsequent code receiving valid input

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,266
    Quote Originally Posted by Lauren Nicole View Post
    Doesnt help that I have a fussy baby pulling at my leg 24-7, a needy hubby, and 9000 other things going on right now.
    You need to address those other things before trying to learn anything to do with software development.

    A baby needs to be the priority of both you and hubby. If hubby is unwilling or unable to help you with that, the baby still needs to be your priority - an adult male can accept responsibility for himself, but a baby cannot. And you need to work out what the relative priority of those "9000 other things" are too. Drop or postpone the least important ones.

    Software development - contrary to what a lot of people who don't actually do it will tell you - is an activity that requires significant mental effort and concentration. If you can't apply that effort because other things in your life are more important, then don't do it now. Postpone the learning until you can do it without unnecessary distraction or burden on the conscience. Prioritise.

    Asking questions in a forum is not a way to bridge gaps because your circumstances don't allow you to apply the necessary effort to learning. If you expect that, you are wasting both your time and ours. No amount of help we give you will help you, unless you can apply the effort to understanding the advice. You certainly will not learn if someone simply gives you code to solve your problem for you.


    Quote Originally Posted by Lauren Nicole View Post
    And yes, I understand how while loops work, the theory of it....it makes sense to me but I cant work it.
    Sorry, but you've provided no evidence here that you understand how while loops (or any other type of loops) work. You might be able to rattle off a few words that describe how a while loop works, but that is not the same as being able to apply that knowledge. The primary value of what you learn about programming (or coding, writing C++, or whatever you think of yourself as doing) is being able to apply that knowledge. In other words, if you "can't work it", you can't claim to understand it.

    Quote Originally Posted by Lauren Nicole View Post
    "There is nothing more complex mathematically in those loops than incrementing and multiplying." And how do I increment and multiply?
    Incrementing means "the act of adding one to". A variable that has value 2 may be incremented, after which it has the value 3. Multiplying has it's normal mathematical meaning (2 multiplied by 3 is 6).

    Within loops there is typically a defined sequence of steps that is done repeatedly (over and over) until some end condition or criterion is met. All I was saying that, for your problem, the sequence of steps only needs to involve incrementing some variables, and possibly multiplying other variables together.

    Anyway, I repeat my advice. Sort out other things in your life before trying to learn C++. C++ will still be there to learn once you have time to apply effort to learning it, without excessive distractions.
    Right 98% of the time, and don't care about the other 3%.

  6. #6
    Registered User
    Join Date
    Mar 2013
    Location
    Cumming, Georgia, United States
    Posts
    4
    Academic bullying? Really? I did not ask for code, but for help and explanations so that I UNDERSTOOD the code. This class is just a requirement. You think I like being pushed around mentally by a bunch of guys whom most do not speak English as a first language?

    Regardless of my situation, my priorities are my business, not yours. I just like to make the most of any situation, this class for an example. Unfort, I have come across too many in this field who are not good educators. Sure I respect they know their stuff, but they have no business teaching- they are awful! Repeating something over and over and expecting different result is ridiculous. If only you knew how hard I try. But I dont think that would matter to you. Regardless, its not a good learning environment and it only makes people like me resent people like you. What is so hard about being kind? Or is it because people nowadays are utterly and completely socially inept due to the dependency on technology. I swear, I come across so many people who can't hold a simple conversation because they don't know how to! Do get me wrong, I LOVE my smart phone, but it too needs to be put down.

    I hold two other degrees in Criminology and Biochem. When I tutored, no matter if I felt it was a waste of time, I could see how how students were trying, as I am here. I would try several methods until the student understood.

    But maybe your right, I should prioritize. I guess it would be best for me to quit and go on welfare at your expense. I know I need to concentrate, but not everyone lives in this perfect bubble where they can be left alone with their computers untouched.

    btw, my hubby is a medical resident. Can you imagine if a really sick person walked into his office and my husband told them that they were wasting his time and he couldn't help them until they prioritized? Instant lawsuit and front page news! Never judge unless you walked in their shoes.

    You might be a parent and a dang good one. Based on my limited interaction here, I'd pity those kids. But I dont know, you might be awesome. Ever come across people who are proud to be a-holes but are married with kids, and you wonder how the heck that happened? Why not treat everyone the same and be proud that you helped contribute to something good and to better some one else.

    Oh thats right, I forgot the field I'm in. Cut-throat competition where everyone is afraid someone might do something better than them. Just not smart enough to figure out a 30 year old mom asking for help here probably wont be competition, even if she understood everything.

    I cringed when I read the Tweets of Adria Richards. I thought that she was a cold, callous woman, who obviously hated the world. But now, I see that she has to be this way, she was probably treated the same right from the beginning as I am now.

    If anything, I am frustrated that I am no closer to solving this, BUT I did learn a few things from this. The stereotypes have truth, as most do, and I DEF DO NOT want to touch this field EVER! Not that I was going to, lol! Sorry for the rant, too.....

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    2,370
    who's bullying?

    Quote Originally Posted by Lauren Nicole View Post
    btw, my hubby is a medical resident. Can you imagine if a really sick person walked into his office and my husband told them that they were wasting his time and he couldn't help them until they prioritized? Instant lawsuit and front page news! Never judge unless you walked in their shoes.
    the difference here is that we aren't getting paid to help you. you have to convince us that you deserve help. that means being receptive to criticism, putting forth effort, and not acting entitled.

    Quote Originally Posted by Lauren Nicole View Post
    You might be a parent and a dang good one. Based on my limited interaction here, I'd pity those kids. But I dont know, you might be awesome. Ever come across people who are proud to be a-holes but are married with kids, and you wonder how the heck that happened? Why not treat everyone the same and be proud that you helped contribute to something good and to better some one else.
    judging someone's ability to parent, whom you have never met, based on the way they treat someone who isn't following the rules of this community, is incredibly presumptuous and arrogant.

    Quote Originally Posted by Lauren Nicole View Post
    Oh thats right, I forgot the field I'm in. Cut-throat competition where everyone is afraid someone might do something better than them. Just not smart enough to figure out a 30 year old mom asking for help here probably wont be competition, even if she understood everything.
    using your motherhood and family as a tool to gain our sympathy. good luck with that. your priorities are not ours, and are entirely irrelevant here. help was offered, and you rejected it. what more do you want?

    Quote Originally Posted by Lauren Nicole View Post
    I cringed when I read the Tweets of Adria Richards. I thought that she was a cold, callous woman, who obviously hated the world. But now, I see that she has to be this way, she was probably treated the same right from the beginning as I am now.
    if you look back through forum posts (which you should have searched in the first place), you'll see that the members of this community treated you exactly as they treat anyone else who tries to coerce us to provide answers instead of real help.

    Quote Originally Posted by Lauren Nicole View Post
    If anything, I am frustrated that I am no closer to solving this, BUT I did learn a few things from this. The stereotypes have truth, as most do, and I DEF DO NOT want to touch this field EVER! Not that I was going to, lol! Sorry for the rant, too.....
    and personally, I will be happy to see you go. it's clear that you don't have the right mental attitude for this kind of work, and as a result, you'd probably make a lousy programmer.

    edit:
    you'd do well to read this link: Ask Questions the Smart Way. if you have even the slightest ability to look at yourself objectively, you'll be able to identify a number of mistakes you've made.
    Last edited by Elkvis; 03-29-2013 at 08:26 AM. Reason: added link

  8. #8
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,650
    The key is to look at the relationships between the numbers here.

    Code:
    1 2 3 4 5
    2 4 6 8 10
    3 6 9 12 15
    4 8 12 16 20
    5 10 15 20 25
    Now, take this program, compile and run it, and see if it shakes anything loose for you.

    Code:
    #include <stdio.h>
    
    #define NUM_COLS 5
    #define NUM_ROWS 10
    
    int main()
    {
    	printf("\nFormat is ROW:COLUMN\n");
    	printf("====================\n\n");
    	for (int row = 1; row <= NUM_ROWS; ++row)
    	{
    		for (int column = 1; column <= NUM_COLS; ++column)
    		{
    			printf("%d:%d\t", row, column);
    		}
    		printf("\n"); // End of row
    	}
    	printf("\n");
    	return 0;
    }
    stahta01 likes this.

  9. #9
    Registered User
    Join Date
    Jun 2005
    Posts
    6,266
    Quote Originally Posted by Lauren Nicole View Post
    If anything, I am frustrated that I am no closer to solving this, BUT I did learn a few things from this. The stereotypes have truth, as most do, and I DEF DO NOT want to touch this field EVER! Not that I was going to, lol! Sorry for the rant, too.....
    Read this.
    Right 98% of the time, and don't care about the other 3%.

  10. #10
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,554
    @Lauren:
    The first step is to have a solid plan for how one would accomplish such a thing.
    So can you give, in pseudo code or a flow chart, how you would accomplish this feat if you were given this task in real life? Break it down into small logical statements and write them out.
    From there, we can translate it to code.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need Assistance?
    By shewj in forum C Programming
    Replies: 8
    Last Post: 04-09-2008, 07:57 AM
  2. Newbie c programmer need assistance plz...
    By Nexus-ZERO in forum C Programming
    Replies: 17
    Last Post: 12-27-2007, 03:05 PM
  3. Need some more assistance
    By Thantos in forum Windows Programming
    Replies: 6
    Last Post: 08-14-2003, 12:13 PM
  4. need assistance
    By Unregistered in forum C Programming
    Replies: 20
    Last Post: 07-05-2002, 05:11 AM
  5. Help..Need Assistance
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 05-05-2002, 02:31 PM

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