Thread: help me in Assignment

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    23

    help me in Assignment

    hi
    i am new user and please
    i have in my universty c Assignment about loob ineed help on it please
    this link
    http://cs111.gju.edu.jo/labs/assignment4.pdf

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Homework policy

    You need to post a more specific question, showing that what you are asking for is not "someone please do my homework for me", but rather "I know most of the answer, but I'm stuck on ....". Although many members here would be perfectly able to do your homework (probably fairly quickly too, seeing as this is probably the first or second assignment on C in your class).

    The more specific your question is, the more direct an answer you will be given. If you ask something that requires a "large" answer, then you will probably be given hints and suggestions on how to solve it (Example: How do I solve Question 1 on my assignment?. If you ask a very specific question on a particular subject, you will most likely be given a direct answer to that particular question (Example: Why does 3 divide by 5 make 2?).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    I was thinking of reporting you to your university, but then I realized that having you pass the course without knowing what the heck you're doing would be better.

    As my colleagues would like it to be put more nicely to you, please read the homework policy of this website. Asking us to do your homework for you is prohibited and will actually result in people like me saying not-so-nice things to you, like suggesting you read my signature.

    Edit: Bleh, beaten by 2 minutes. Must....post....faster......

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    23
    sorry
    the proplem i know what doing in c
    and i have last 3 lab full mark
    but proplem my friends need solutions
    because they didnt understand any thing and i dont have time now h have msce exam
    and my lab on Wednesday
    my friends lab tommorow
    i promise tell them solution
    and i need only first question
    if you dont want to help that fine

    but i next to help if i need help next time please not for homework but to make sure it right or not
    Last edited by thaer89; 10-29-2007 at 05:52 AM.

  5. #5
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    If you know the answer then why dont YOU tell them then. Easiest way is just give them what you done and let them copy it. You might get accused of plagiarism from your own work, but they wont be able to prove it

  6. #6
    Registered User
    Join Date
    Oct 2007
    Posts
    23
    okay i will give you tonight when i finished study to my mcse exam

  7. #7
    Registered User
    Join Date
    Oct 2007
    Posts
    23
    this soultion for q1
    Code:
    #include <stdio.h>
    int main ()
    {
             int i=1;
             int n;
             int f;
            while(i<77){
            f=i&#37;8;
              n=i/8;
             printf("%d \n",(int)n*10+f);
            i++;
            }
            return 0;
    }
    and this q3
    Code:
    #include <stdio.h>
    int main( )
    {
        int i;
        int f1;
        int s2;
        printf("Enter first number ");
        scanf("%i",&f1);
        printf("Enter second nimber ");
        scanf("%i",&s2);
        i=0;
        printf("the result of %i*%i is ",f1,s2);
        while(i<s2){
              printf("%i",f1);
            i=i+1;
            if(i<s2)
                printf("+");
    
    }
        return 0;
    }
    and this q5
    for i 3 times
    for j 9 times
    for k 10 times
    but i am not sure

    and remain to 2 question i will answer it tomorrow when i have time

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Code:
    80
    81
    82
    83
    84
    85
    86
    87
    90
    91
    92
    93
    94
    These are NOT valid octal numbers, but it's the output of your code for Q1 - so your friends will have failed the task.

    Fixing the obvious mistake still makes it finish one short.

    And you are actually not solving the problem as was hinted in the suggestion.

    Your indentation isn't exactly perfect.

    Is there any particular reason you don't like using for-loops when they are the obviously "best" loop?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #9
    Cogito Ergo Sum
    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    463
    Quote Originally Posted by MacGyver View Post
    I was thinking of reporting you to your university, but then I realized that having you pass the course without knowing what the heck you're doing would be better.

    That's sad.

  10. #10
    Registered User
    Join Date
    Oct 2007
    Posts
    23
    yes i have mistake but when i read it he want only to 77 in octal
    i change while(i<66)
    Last edited by thaer89; 10-29-2007 at 10:44 PM.

  11. #11
    Registered User
    Join Date
    Oct 2006
    Location
    Omaha, Nebraska
    Posts
    116
    oooh, college level programming ONLINE!?
    thank you!
    ive been looking for some good online challenges.
    oh, and uhm, work out what you can and then ask about what you are having problems with.
    (probably already been said, but... yeah).

  12. #12
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by thaer89 View Post
    yes i have mistake but when i read it he want only to 77 in octal
    i change while(i<66)
    How did you come up with the 66? It doesn't seem right to me.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  13. #13
    Registered User
    Join Date
    Oct 2007
    Posts
    23
    sorrry not 66 it 64

    and this is to answer q2:

    Code:
    #include <stdio.h>
    int main()
    {
    	int m;
    	int z=1;
    	int l;
    	int i=0;
    	int t=0;
    	int n;
    	int f;
    	scanf("&#37;i",&n);
    		l=n*1;
    		while(n!=0){
    		n=n/10;
    		t=t+1;
    	}
    
    	t=t-1;
    	while(i<t){
    		z=z*10;
    		i=i+1;
    	}
    
    		while(l!=0){
    		f=l/z;
    		l=l%z;
    		z=z/10;
    		for(m=0;m<f;m=m+1)
    			printf("*");
    
    		printf("\n");
    
    	}
    
    }
    Last edited by thaer89; 10-30-2007 at 02:41 PM.

  14. #14
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You are missing several oppurtunities of using <op>= (+= as example), and several places can use var++ or var-- to perform some operations.

    Your indentation is horrible [assuming your code actually looks like it does here - sometimes a mix of tabs and spaces will make the code look strange here but OK on your screen. In this case, use settings to disable "tabs" and only use spaces.]

    What is this supposed to do:
    Code:
    l=n*1;


    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Menu
    By Krush in forum C Programming
    Replies: 17
    Last Post: 09-01-2009, 02:34 AM
  2. Assignment Operator, Memory and Scope
    By SevenThunders in forum C++ Programming
    Replies: 47
    Last Post: 03-31-2008, 06:22 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Help with a pretty big C++ assignment
    By wakestudent988 in forum C++ Programming
    Replies: 1
    Last Post: 10-30-2006, 09:46 PM
  5. Replies: 1
    Last Post: 10-27-2006, 01:21 PM