Homework Help!!!!!

This is a discussion on Homework Help!!!!! within the C++ Programming forums, part of the General Programming Boards category; actually the project is due 2 weeks from now, and i am trying to learn this stuff as fast as ...

  1. #16
    Shake Zula- The Mic Rula!
    Join Date
    Sep 2004
    Posts
    69
    actually the project is due 2 weeks from now, and i am trying to learn this stuff as fast as i can, i don't want the entire solution to a problem, i just came to this forum to get tidbits of help to help me over things that i can't find in my books or online anywhere else, i know noone else that does C++ code, so i figured i would come here and get some help. and if i don't come to you guys with homework questions, then what other types of questions are there?? if i'm in at my job doing programming, i'm not gonna need anyone else's help. anyways, thanks alot for the help, and "prelude", thanks for tryin, but that code is WAY over my head right now... and to you "sean mackrory", eat a xanax and chill out brotha...

  2. #17
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    djz3r0 - you're assuming the numbers are entered in ascending order. This will rarely be the case.

  3. #18
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >good old fashoned c code
    Maybe old fashioned, but certainly not good.

    >void main(void)
    Don't make me switch to ANSI nazi mode. main returns int, it always has.

    >char char1,char2,char3,cahr4;
    Check your spelling, or write enough C code so that you're physically unable to misspell char.

    >scanf("%c%c%c%c",char1,char2,char3,char4);
    Eew. I say again, eew. First and foremost you need to use the ampersand in all of those charN's because scanf expects a pointer. Second, you need to check the return value of scanf because users can't follow directions (especially since you didn't give any in this program).

    >printf("%c%c%c%c",char4,char3,char2,char1);
    Okay, this is assuming that the characters are entered in ascending sorted order to begin with. I don't recall the OP mentioning that particular requirement. In fact, I can remember a specific example that suggests that the digits will be in random order, so your code is broken even if you fix it.
    My best code is written with the delete key.

  4. #19
    Shake Zula- The Mic Rula!
    Join Date
    Sep 2004
    Posts
    69
    alright, well thanks for the help i guess, "prelude", your dorkness far exceeds mine, and i mean that as a compliment, lol... i can't understand any of that code, yet, but alot of the other users have helped, thanks alot guys, i appreciate it

  5. #20
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >"prelude", your dorkness far exceeds mine, and i mean that as a compliment
    I'll take it as a compliment.

    >i can't understand any of that code
    That was the point really. We're glad to help with your C++ problems, provided you can prove that you've given it an honest attempt. If you have an idea of how to go about it, run it by us and we'll offer suggestions. But a request for code that solves your problem doesn't go over well, and you'll either get stoney silence, flames, or extreme sarcasm for your trouble.
    My best code is written with the delete key.

  6. #21
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Hint:
    Read the number as a char array. That gets it into a form that will make it easy to sort. And if you don't know how to use arrays (as your earlier post demonstrates), I suggest you read up on them (there's a tutorial on this site).

    **EDIT**
    Sorry Vicious, should've read the rest of the thread more carefully.
    Last edited by Hunter2; 09-12-2004 at 07:59 PM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Homework
    By kermi3 in forum C Programming
    Replies: 10
    Last Post: 09-27-2001, 04:49 PM
  2. Homework
    By kermi3 in forum C++ Programming
    Replies: 15
    Last Post: 09-26-2001, 03:16 PM
  3. Homework
    By kermi3 in forum Windows Programming
    Replies: 5
    Last Post: 09-15-2001, 11:48 AM
  4. Homework
    By kermi3 in forum C Programming
    Replies: 0
    Last Post: 09-10-2001, 01:26 PM

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