Thread: Homework help

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    1
    Rep Power
    0

    Homework help


    Code:
    // DogDayCare.cpp : Defines the entry point for the console application. // Eric Vardinakis // 9'24'2012 #include "stdafx.h" #include<iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int mediumdog; int LageDog = 35; int smalldog = 10; int shortstay; int longstay = 11; cout << "How much does your dog way "; cin >> mediumdog; if (mediumdog < smalldog) cout << "You have a small dog."<< endl; else if (mediumdog > LageDog) cout << "You have a big dog." << endl; else cout <<"You have a medium size dog."<< endl; { cout << "How long wil you dog be staying here. " << endl; cin >> shortstay; if (shortstay < longstay) cout << "Thats a short stay."<< endl; else cout << "Thats a long stay."<< endl; } system("pause.exe"); return 0; }

    I am new to C++ and programming. the code i wrote works but my college professor wants me to make dogs that are under 10ld cost $12 dogs that are between 10-35lb cost $16 and dogs that are over 35lb cost $19. if they stay1-10 days. If they stay 11 or more days she wants it to say under10lb cost $10 10-35lb cost $13 and over 35lb cost $17
    This is the link to my book if you don't get what i am saying its page 119 Exercises 12 DogDayCare.cpp
    http://books.google.com/books?id=akzWMS9_PYoC&printsec=frontcover#v=onepage&q&f=false
    please i need some one to help me this is do Tuesday at 11pm est
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,379
    Rep Power
    1871
    Perhaps you could begin by editing your post, so that your code isn't one completely unreadable single line.

    Edit:
    Nevermind, it's readable on this other forum
    http://cboard.cprogramming.com/cplus...work-help.html
    Last edited by salem; September 25th, 2012 at 01:58 AM.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    Originally Posted by wormy677
    please i need some one to help me this is do Tuesday at 11pm est
    Where you have "i" use "I".

    For "do" substitute "due".

    I also expect a capitalized "p".

    Code:
    if (doggy_weight < 10) {
      /* actions for this sort of dog */
    } else if (doggy_weighs < 35) {
      /* more cleanup required for this beast */
    } else {
      /* gentle dog actions */
    }
    Maybe I should take up ada. I like dimensions.
    weight < 35 pound
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo