Thread: homework help

  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    1

    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
    Object-Oriented Programming Using C++ - Joyce Farrell - Google Books
    please i need some one to help me this is do Tuesday at 11pm est

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    At least the code is more readable than here -> Homework help - Dev Shed

    int mediumdog;
    int LageDog = 35;
    int smalldog = 10;
    int shortstay;
    int longstay = 11;

    How about variables called
    int dogWeight; // was mediumdog
    int lengthOfStay; // was shortstay

    Then perhaps
    int dogCostPerDay;

    In your logic, you can do
    dogCostPerDay = 13;


    You can then end your output with the total cost by a simple calculation.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help for Homework!
    By alionas in forum C Programming
    Replies: 4
    Last Post: 11-20-2010, 10:36 AM
  2. Please help me with my c++ homework!
    By dmeyers81 in forum C++ Programming
    Replies: 35
    Last Post: 11-04-2010, 07:47 AM
  3. Homework
    By cagurtay in forum C Programming
    Replies: 3
    Last Post: 11-01-2010, 05:28 PM
  4. Homework Help
    By Lasian in forum C Programming
    Replies: 1
    Last Post: 10-01-2010, 12:12 AM
  5. Help with homework please
    By vleonte in forum C Programming
    Replies: 20
    Last Post: 10-13-2003, 11:16 AM