gregorygarver.com Forum Index gregorygarver.com
San Francisco Real Estate Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

C++ program need help?

 
Post new topic   Reply to topic    gregorygarver.com Forum Index -> Real Estate For Sale
Author Message
ajhe_82



Joined: 26 Jan 2004
Posts: 3

PostPosted: Thu Jul 15, 2004 12:43 am    Post subject: C++ program need help? Reply with quote

/******************************************************************************* fuwen xu 05/11/07 switch and looping.cpp ** This program compute the commissions for the real estate company ** Input:choice,agent_id,rsp,csp,msp,yesno, ** Output:nr,nc,nm,mc,trc,tcc, *************************************** HISTORY ***************************** WhoDate Description ********************************************************************************* Fuwen Xu 05/11/2007 calculate commissions *******************************************************************************/#include #include using namespace std;#define RCR 0.1/*residential commission rate*/#define CCR 0.2/*commercial commission rate*/#define MCR 0.15/*multiunt dwelling commission rate*/int main(){int id,/*five digit number ID*/price,/*selling pricce*/nr=0,/*number of residential commissions computed*/nc=0,/*number of commerical commissions computed*/nm=0,/*number of multiunit commissions computed*/yesno;/* program loops when = 1*/double trc=0.0 ,/*total of residential commissions*/ tcc=0.0 ,/*total of commerical commissions*/ tmc=0.0 ; /*total of multiunit dwelling commissions*/char choice,/*choose the what category r, c, m*/space = ''; /*space*/cout <<"\n\n\n\n";cout <<"\n***************Fuwen Commission Computer******************\n";cout <<"\nDo you have a commission to compute?(1 = yes, 0 = no)? ";cin >> yesno;while (yesno == 1){cout <<"\nPlease enter the Agent ID: ";cin >> id;cout <<"\nPlease enter the category of property sold";cout <<"\n(R = residential, C = commercial, M = multiunit): ";cin >> choice;switch(choice){case 'r':case 'R':trc-=trc;cout <<"Please enter the selling price: ";cin >> price;trc += (price*RCR);nr += 1;cout <<"\n\nThe commission for this sale for Agent "<> price;tcc += (price*CCR);nc+=1;cout <<"\n\nThe commission for this sale for Agent "<> price;tmc += (price*MCR);nm+=1;cout <<"\n\nThe commission for this sale for Agent "<> yesno;}trc+=trc;tcc+=tcc;tmc+=tmc;cout <<"\n\n********************End of Run Report************************";cout <<"\n\nTotal number of Residential commissions computed = "<
Back to top
JJ



Joined: 10 Dec 2006
Posts: 4

PostPosted: Fri Jul 23, 2004 1:34 pm    Post subject: C++ program need help? Reply with quote

Err, whats your question?
Back to top
godged5497



Joined: 14 Mar 2006
Posts: 10

PostPosted: Sun Aug 01, 2004 2:24 am    Post subject: C++ program need help? Reply with quote

Well, what's the problem?(You're better off telling us the problem is than just posting the code. When we see the code, Y!Answers will truncate long lines so we can't just cut and paste it into our compilers.)
Back to top
MichiganT



Joined: 21 Sep 2004
Posts: 4

PostPosted: Mon Aug 09, 2004 3:15 pm    Post subject: C++ program need help? Reply with quote

BigRez,who says u to "cut" and "paste".if u know the answer thenjust "select" and"copy" then "paste" to C++.Sorry i can't anser to question b/c i am C student not C++.
Back to top
PatriciaC



Joined: 21 Dec 2003
Posts: 8

PostPosted: Wed Aug 18, 2004 4:05 am    Post subject: C++ program need help? Reply with quote

Your code doesn't keep an accurate total count of sales. For example, for switch case r/R you have trc-=trc, basically setting trc = 0 EVERY TIME switch case r/R is run. So the count is essentially wiped out all the time and when you're done the count isn't correct.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gregorygarver.com Forum Index -> Real Estate For Sale All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group