Results 1 to 4 of 4
  1. #1
    Orteez's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    1
    My Mood
    Relaxed

    C++ programming HW NEED TO FINISH TONIGHT AND EMAIL TO MY TEACHER URGENT HELP NEEDED

    Right now we're doing loops and I have to make 2 little tiny mini programs. I don't know what code to right for the first program or the second program. First program is basically when you enter a 2 or more digit number like 463, the output displays the digits on different lines). Example...
    4
    6
    3
    This all is supposed to be done using do while and while.

    Second program is it starts with 2 numbers and the program keeps on adding up the sum of the numbers and only saving the one's digit. Some programmers might refer to this as "the necklace program."

  2. #2
    Orteez's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    1
    My Mood
    Relaxed
    noooooo i failed :'(

    it sucks to be me right now i hate programming
    Last edited by Orteez; 10-27-2010 at 07:00 PM.

  3. #3
    ж‡ Haxεr4€vεr ‡ж's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    108
    Reputation
    10
    Thanks
    19
    My Mood
    Relaxed
    Hmm, Why don't you try finding a guide online and also wrong section.

  4. #4
    Alen's Avatar
    Join Date
    Oct 2007
    Gender
    male
    Location
    Liquid Generator
    Posts
    27,920
    Reputation
    2548
    Thanks
    4,224
    My Mood
    Fine
    I posted the program before the database reset, you should have checked /

    Anyway, if it helps it was something like this (it's a quick rewrite, check for any errors):

    [php]#include <iostream>

    using namespace std;

    int main() {
    string x = ""; // our number, as a string
    int i = 0; // used to count
    cin >> x; // input number
    while(i < x.length()) { // cycle through the characters
    cout << x[i] << endl; // output characters
    i++; // make sure we actually move forwards every time we print out a character
    }
    }
    [/php]

    As for the necklace it was similar but with an infinite loop and the modulus operator (with 10).

Similar Threads

  1. This is the program i need to make
    By JusCaus in forum Coders Lounge
    Replies: 4
    Last Post: 10-04-2011, 11:55 AM
  2. need help with a map, rep and thanks given if you can help
    By supercarz1991 in forum Combat Arms Mod Discussion
    Replies: 7
    Last Post: 03-08-2011, 04:47 PM
  3. Make Rocket Go To finish Point And Have A Waittill To Finish Point?
    By Deathray75 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 2
    Last Post: 12-05-2010, 07:45 AM
  4. Finishing Hack and need help
    By ludikrimos in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 10
    Last Post: 09-28-2010, 04:11 PM
  5. last thing i made tonight and for the week
    By Luke420 in forum Showroom
    Replies: 6
    Last Post: 11-20-2009, 08:04 AM