Thread: Assignment Help...maybe..

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    2

    Assignment Help...maybe..

    Hey everyone.

    I have been out sick from school for the last week. I get back here and I get a hand out assignment from my teacher to do.
    Now we have no text book in C ( im not even sure why I need this course to begin with but that's another story) we are supposed to find
    the information ourselves because C is such a small unit in our course and really I will probably never look at the stuff after about 4 more weeks.

    Anyway, I scanned through the forum rules and didn't see anything against this... If it is, im sorry i'll delete this. If you dont weant to help thats cool too.
    Anyway this is a very small assignment, here it is as follows.


    1. Use a printf statement to print out the value of the integer variable sum

    2. Use a printf statement to print out the text string "Welcome", followed by a newline

    3. Use a printf statement to print out the character variable letter

    4. Use a printf statement to print out the float variable discount

    5. Use a printf statement to print out the float variable dump using two decimal places

    6. Use a scanf statement to read a decimal value from the keyboard, into the integer variable sum

    7. Use a scanf statement to read a float variable into the variable discount_rate

    8. Use a scanf statement to read a single character from the keyboard into the variable operator. Skip leading blanks, tabs and newline characters.

    Even if you cant help thanks for reading through this. Peace.

  2. #2
    Registered User
    Join Date
    Dec 2005
    Location
    Australia - Melbourne
    Posts
    63
    Those questions are the fundamentals of C.

    It would be bad for you if i told you the answers.

    However, i will point you in the right direction.

    --> http://www.cprogramming.com/tutorial/c/lesson1.html

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    you should post your attemp and describe the concrete problem, not the whole assignment
    about homework - read this http://cboard.cprogramming.com/annou...t.php?f=4&a=39

    if you wonder how the printf works, here is the sample
    printf("%d",sum);
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Anyway, I scanned through the forum rules and didn't see anything against this...
    http://cboard.cprogramming.com/annou...t.php?f=4&a=39
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Jan 2007
    Posts
    2
    Im sorry I didn't see that part, I will delete this post. Sorry everyone.

    Or let it Die, I'm not sure how to delete my topic.

  6. #6
    Registered User
    Join Date
    Nov 2006
    Posts
    65
    bro come on, did you even try? Did you go to class? Do you need with the syntax or the body of the program. Its strange that you know its called printf() and scanf() and yet have no clue to use them. He is some prototype for your printf("data to be printed") if you wanted to print a value
    Code:
    int x;
    x=12;
    printf("%d",x);
    %d= decimal int
    %c= char
    %e=float in scientific e notation
    %f=float
    %i=decimal int
    %s= string
    \a makes a funny noise lol
    \n is a new line, make sure to include it after every printf statement.


    Bro just try and post what you can do up here and we can walk you through it young padiwan but we wont hook you up with a light saber yet.
    You rant and rave about it, but at the end of the day, it doesn't matter if people use it as long as you don't see.
    People are free to read the arguments, but if the only way for you to discover gravity is by jumping off a cliff, then that is what you're going to have to experience for yourself.
    Eventually, this "fast and loose" approach of yours will bite you one too many times, then you'll figure out the correct way to do things. - Salem

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