943,965 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2059
  • C++ RSS
Nov 6th, 2009
-5

d.s. malik

Expand Post »
salam, hope u people ll fine , any body have solved excercises of CHAP 2, CHAP 3,CHAP4 AND CHAP 5 BY D.S AMLIK book i need these urgent so kindly help me my exams r very near n i w ant to prepare them
Similar Threads
Reputation Points: 8
Solved Threads: 0
Light Poster
IT seeker is offline Offline
38 posts
since Oct 2009
Nov 6th, 2009
-7
Re: d.s. malik
Why don't you solve them yourself? You won't learn anything by cheating.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Nov 7th, 2009
0
Re: d.s. malik
yeah i dont want to learn anything by cheating but i m nothing in progrmmaing i can make simple progrmas and in my book there r difficult question would u plz teach me i want to learn therefore i ve joined this forum, so tell me when u ll start to learn me ???????? i m wating
Reputation Points: 8
Solved Threads: 0
Light Poster
IT seeker is offline Offline
38 posts
since Oct 2009
Nov 7th, 2009
0
Re: d.s. malik
What part of programming is specifically giving you difficulty? (please provide code with well-written question)
Last edited by Clinton Portis; Nov 7th, 2009 at 2:05 pm.
Reputation Points: 237
Solved Threads: 117
Practically a Posting Shark
Clinton Portis is offline Offline
822 posts
since Oct 2005
Nov 7th, 2009
0
Re: d.s. malik
progrmming statments r difficult for me i dont know what i ve done in this progrme there r many but here it is

a cashier has currency notes of denomination 10,50,100. if the amount to be withdrawn is input through the keyboard in hunderds, find the total number of currency notes of each denomination the cashier will have to give the withdrawer??

n what do u mean by provide code??
Reputation Points: 8
Solved Threads: 0
Light Poster
IT seeker is offline Offline
38 posts
since Oct 2009
Nov 7th, 2009
3
Re: d.s. malik
>so tell me when u ll start to learn me ???????? i m wating
I'll learn you good. Start by not being so impatient. Everyone has to start from nothing and work their way up to something. Being given solutions doesn't help you learn nearly as much as working your way through to your own solution.

>n what do u mean by provide code??
He means try it first on your own before begging for help. I can guarantee that when (or if) you get into the real world as a programmer and try that BS, you'll be told to do your damn job and stop whining.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Nov 7th, 2009
0
Re: d.s. malik
ok i understand . first i ll try thank u
Reputation Points: 8
Solved Threads: 0
Light Poster
IT seeker is offline Offline
38 posts
since Oct 2009
Nov 7th, 2009
0
Re: d.s. malik
C++ Syntax (Toggle Plain Text)
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int note10,note50,note100;
  6. cout<<"enter the withdrawn ammount"
  7. cin>>amount;
(what is next step ?
Reputation Points: 8
Solved Threads: 0
Light Poster
IT seeker is offline Offline
38 posts
since Oct 2009
Nov 7th, 2009
0
Re: d.s. malik
Here is the pseudo code for what ye' wish to accomplish:

1. Accept user input in the proper format. In this case, since we are dealing with money, I would suggest a 'double' data type or something comparable that will handle decimal values. (if you want to deal with only whole dollar amounts, be sure to let the user know)

2. Now that you have the user input, try using simple division to determine what denominations of money is to be 'returned' to the user. I would start testing with the largest denomination possible... then when that no longer works, then you can start trying lower denominations (based on real-life cashiering logic).
C++ Syntax (Toggle Plain Text)
  1. //This is your lowest denomination, so when we get to this point, we know we don't need to continue to calculate change with this loop.
  2. while(change < 10)
  3. {
  4. //Test for your largest denomination first
  5. if(amount / 100)
  6. {
  7. //adjust user inputed amount to withdraw
  8. amount -= 100;
  9. //keep a running counter of how many $100 bills ye' have issued thus far
  10. hundreds++;
  11. }
  12. else if(amount / 50)
  13. {
  14. amount -= 50;
  15. fifties++
  16. }
  17. ...
  18. ...
  19. ...
  20. etc etc.
  21.  
  22. cout << "You get " << hundreds << " x $100" <<endl;
  23. cout << "You get " << fifties << " x $50"<<endl;
  24. cout << "You get " << tens << " x $10" <<endl;
  25. cout << "Remaining money: $" << amount;

This should get ye' pointed in some sort of direction.

This is untested/uncompiled code and may contain simple easy to fix errors.
Last edited by Clinton Portis; Nov 7th, 2009 at 4:42 pm.
Reputation Points: 237
Solved Threads: 117
Practically a Posting Shark
Clinton Portis is offline Offline
822 posts
since Oct 2005
Nov 8th, 2009
0
Re: d.s. malik
Click to Expand / Collapse  Quote originally posted by IT seeker ...
salam, hope u people ll fine , any body have solved excercises of CHAP 2, CHAP 3,CHAP4 AND CHAP 5 BY D.S AMLIK book i need these urgent so kindly help me my exams r very near n i w ant to prepare them
I guess all the solutions of the exercises of CHAP2 .. CHAP 5 are there at the appendix section of the book, if you do not find it there , just write a letter to the author of the book, he will oblige by sending you the answers via mail.
Reputation Points: 769
Solved Threads: 128
Banned
ithelp is offline Offline
1,910 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Can functions that return int, take files as parameters.
Next Thread in C++ Forum Timeline: Reverse digit array





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC