1) Difference between C and C++
2) overloading and overriding .. differentiate them?
3) what is object slicing ?
4) Define procedural language
5) Explain why C++ is not a fully OOP language and why JAVA is?
6) Write a program to swap 2 variables without using temporary variables.
7) write sql cmd to generate first 100 lines of tables.
8) security in C++
9) write a query to extract only the duplicate records from a table
10) How is a C program compiled?
11) Differences between DBMS and RDBMS?
12) What is the differences between i++, ++i. Is it different to write for(i=0;i%26lt;10;i++) then to write for(i=0;i%26lt;10;++i)
13) a)What is the output of for(;;) ?
b)What is the output of for(;;); ?
14) Whats Referential Integrity in RDBMS?
Doubts in C,JAVA, DBMS,Some Programs...?
So, do you want us to take the test for you or just do your homework for you?
Reply:is it a 3 hr exam to the answerers
Reply:google.com, yahoo.com, live.com, wikipedia.com, those are your answers
Friday, July 31, 2009
Show that p(B|C)=p(B|~C)?
hey, can anyone help me to answer that question?
given that: P(A|B)%26lt;P(A|~B)
P(A|B,C)%26gt;P(A|~B,C)
P(A|B,~C)%26gt;P(A|~B,~C)
where ~B mean 'not B'
Question: show that if p(B|C)=p(B|~C), then not all of the above three inequalities can occur simultaneously
thanks so much
Show that p(B|C)=p(B|~C)?
rashers .
given that: P(A|B)%26lt;P(A|~B)
P(A|B,C)%26gt;P(A|~B,C)
P(A|B,~C)%26gt;P(A|~B,~C)
where ~B mean 'not B'
Question: show that if p(B|C)=p(B|~C), then not all of the above three inequalities can occur simultaneously
thanks so much
Show that p(B|C)=p(B|~C)?
rashers .
Unable to Format C drive?
Recently I wanted to install Window XP SP2 on my C drive but
some how it went to install on my D-drive .and run from there .
However I needed space and decided to format my C drive ( originally to have Window XP Home ) . However when I tried format C , my
computer said "Window was unable to complete the format " and then left my C drive intact.
Why unable ??
Since unable to format C, can someone tell me how to uninstall Window first so that I have some extra space in my c-drive to
run other files...
Appreciate some useful hints from friends around ?.
tks in anticipation.
andy
Unable to Format C drive?
All of the above answers are WRONG, as is the one directly below mine. If you follow most of those instructions you will brick your machine and it will NOT run.
If Windows is on your D: drive, just delete the C:\Windows folder. If you haven't installed any programs to the C: drive since you installed Windows on the D: drive, you can also delete the C:\Program Files folder. Those two folders aren't needed now that Windows is running from D: and will free up a lot of space.
If you formatted your C: drive, Windows would not run because the startup files are still on the C: drive. That's why you couldn't format it.
In order for Windows to start, 3 files must be on the first drive that the BIOS sees when the machine is booted. That drive will show under Windows as the C: drive. Those files are:
Ntdetect.com
Ntldr
Boot.ini
Even if Windows runs from the D: drive, those files must be on the C: drive.
Reply:try sticking the hard drive as a slave in another computer that already has windows xp on it. try formatting the hard drive through windows xp on that computer. there is no way to uninstall windows correctly; unless you upgraded. normally u just format the hard drive.
Reply:If you tried to format the C Drive, you should have everything but the keyboard and mouse unhooked from your computer. If you are still booting up on the C drive, then you can't uninstall Windows or format it without the system disk. You can't format the disk or uninstall the OS while it is running the computer.
Ron
Reply:If this is a seagate drive you can download a program from their site called seatools that should take care of this. Maxtor and the rest use a program called Disk Manager that you can also get to handle this. Hope this helps and Happy New Year
Reply:Click on Start than Settings than Control panel.
Click on Administation tools
Click on Computer management
Select storage and find the C drive, you will be able to format it from there
Reply:You don't need to format the C: drive to free up more space. Formatting the C: drive will remove the operating system, which will make the computer nearly worthless.
You can do to the Control Panel and use "Add or Remove Software" to remove unwanted programs to free up space.
You can also run Disk Cleanup from the Assessories, System Tools folder to have Windows attempt to free up some drive space.
If all else fails and you still want to reinstall Windows, boot from the Windows CDand it will format the C: drive for you, just follow the prompts.
some how it went to install on my D-drive .and run from there .
However I needed space and decided to format my C drive ( originally to have Window XP Home ) . However when I tried format C , my
computer said "Window was unable to complete the format " and then left my C drive intact.
Why unable ??
Since unable to format C, can someone tell me how to uninstall Window first so that I have some extra space in my c-drive to
run other files...
Appreciate some useful hints from friends around ?.
tks in anticipation.
andy
Unable to Format C drive?
All of the above answers are WRONG, as is the one directly below mine. If you follow most of those instructions you will brick your machine and it will NOT run.
If Windows is on your D: drive, just delete the C:\Windows folder. If you haven't installed any programs to the C: drive since you installed Windows on the D: drive, you can also delete the C:\Program Files folder. Those two folders aren't needed now that Windows is running from D: and will free up a lot of space.
If you formatted your C: drive, Windows would not run because the startup files are still on the C: drive. That's why you couldn't format it.
In order for Windows to start, 3 files must be on the first drive that the BIOS sees when the machine is booted. That drive will show under Windows as the C: drive. Those files are:
Ntdetect.com
Ntldr
Boot.ini
Even if Windows runs from the D: drive, those files must be on the C: drive.
Reply:try sticking the hard drive as a slave in another computer that already has windows xp on it. try formatting the hard drive through windows xp on that computer. there is no way to uninstall windows correctly; unless you upgraded. normally u just format the hard drive.
Reply:If you tried to format the C Drive, you should have everything but the keyboard and mouse unhooked from your computer. If you are still booting up on the C drive, then you can't uninstall Windows or format it without the system disk. You can't format the disk or uninstall the OS while it is running the computer.
Ron
Reply:If this is a seagate drive you can download a program from their site called seatools that should take care of this. Maxtor and the rest use a program called Disk Manager that you can also get to handle this. Hope this helps and Happy New Year
Reply:Click on Start than Settings than Control panel.
Click on Administation tools
Click on Computer management
Select storage and find the C drive, you will be able to format it from there
Reply:You don't need to format the C: drive to free up more space. Formatting the C: drive will remove the operating system, which will make the computer nearly worthless.
You can do to the Control Panel and use "Add or Remove Software" to remove unwanted programs to free up space.
You can also run Disk Cleanup from the Assessories, System Tools folder to have Windows attempt to free up some drive space.
If all else fails and you still want to reinstall Windows, boot from the Windows CDand it will format the C: drive for you, just follow the prompts.
C- Section?
Okay, I got a C section with my first baby. I am now pregnant again, and my new doctor recommends that I get another c- section. My other doctor who gave me the c section said that I should be able to give natural birth with my second child. I prefer to give natural birth. But there are consequences. have any of you had c sections and given natural birth afterwards?
C- Section?
My suggestion is this. Find out what hospitals in your area do VBACs. Then ask the nurses which doctors do VBACs. Make an appointment with that doctor. You are more likely to get the best, least biased advice from that doctor as to whether a vaginal birth is an option.
Most of the cases of uterine rupture during VBAC were CAUSED by doctors using induction or labor enhancing drugs. These are no longer used. In fact, EVERY case in MN was caused by these drugs.
If you go back to that doctor, which I don't think you should, you should ask him why he says you shouldn't have a VBAC when your doctor WHO DID THE SURGERY said it wouldn't be a problem? What medical factor has changed? (It is likely that the hospital he practices at does not do VBAC).
Roughly 75% of women who choose VBAC, have a successful vaginal birth. If a hospital does not allow VBAC, then women who have normal births are at risk because that means there is no doctor available in an emergency.
Reply:I'm the oldest and my mom had me through C-section. But had my 3 other brothers naturally. So I doubt there is any consequences. Maybe your doctor is saying it because the scar is already there and can easily be opened again. Good luck :)
Reply:I dont know anyone that has tried and successfully done it. Its too dangerous.
Reply:Yes I have seen many One is my own sister she had natural birth for 1st, C-section for the second and again natural birth in the third with no complicaations absolutely normal.
Reply:They really don't recommend you have a vaginal birth after having a c-section but you will find the occasional doctor that will let you try. If this is what you choose to do be prepared that you'll more than likely end up having to have the c-section anyways. Good luck!
Reply:Yes VBAC (Vaginal Birth After C-section) are very common. Do some research into it on the internet and make your decision. Your current doctor is suggesting it because once you have a c-section it weakens your uterian wall and can cause compications if you try to have a vaginal birth later on. It depends on how are apart your pregnancies were, if you had any compications after your c-section, if you have had any complications during this pregnancy etc.
I only have one child, and don't plan on having anymore but if I did I would definately try to have my next child naturally. I had an an emergency c-section with my first son so I never got to "go into labor" or anything like that.
Good luck %26amp; congrats
Reply:I actually never gave birth.. but i have an older brother and a younger sister my brother was natural i was c section and my sister was natural.. and my mom was just fine and so was my little sister... the doctor who closed you up knows how your last pregnancy went so i would say that your probably safe to give natural birth.. best of luck to you.. and congrats
Reply:http://www.childbirth.org/articles/stori...
I don't have any personal experience with it but there is a whole section on VBAC on this site. Also, you do what you feel is right, you may end up with another c-section but who knows.
Good luck
Reply:i have had a friend who had 2 c sections and then gave delivery to her last child. she said she preferred c section though because it was easier for her knowing what to expect and all. i gave birth to my 1st 3 babies then had a c section. natural child birth can be tiring with all the pushing and stuff. you have to do what you think is right for your body. i prefer child birth naturally but some women tend to think that the c section is easier. so it's really up to you and your condition when that time comes. hope this helps
Reply:As long as your uterine incision is bikini cut, then you should be able to attempt a VBAC (vaginal birth after c/section), provided that the circumstances are ideal.
I had an emergency c/section with my son, both he and I were in distress. While pg with my daughter I decided that I want to try for VBAC.
Keep in mind that a vbac won't always happen. I ended up needing another emergency c/section b/c my my daughter went into distress, the cord was wrapped around her leg.
Natural birth is a vaginal birth without meds. I think it's awesome that you want to try that. Good luck to you. If you do have a vaginal birth but end up needing an epidural, that's OKAY, just remember that.
A friend of mine had a c/section with her first and was able to go through with a vbac with the second. It wasn't natural, though, she had an epidural.
Always remember that the safety of your baby will define how you give birth. If the vbac isn't possible, it's okay. As long as the little one comes safely, that's all that matters. :)
thank you cards
C- Section?
My suggestion is this. Find out what hospitals in your area do VBACs. Then ask the nurses which doctors do VBACs. Make an appointment with that doctor. You are more likely to get the best, least biased advice from that doctor as to whether a vaginal birth is an option.
Most of the cases of uterine rupture during VBAC were CAUSED by doctors using induction or labor enhancing drugs. These are no longer used. In fact, EVERY case in MN was caused by these drugs.
If you go back to that doctor, which I don't think you should, you should ask him why he says you shouldn't have a VBAC when your doctor WHO DID THE SURGERY said it wouldn't be a problem? What medical factor has changed? (It is likely that the hospital he practices at does not do VBAC).
Roughly 75% of women who choose VBAC, have a successful vaginal birth. If a hospital does not allow VBAC, then women who have normal births are at risk because that means there is no doctor available in an emergency.
Reply:I'm the oldest and my mom had me through C-section. But had my 3 other brothers naturally. So I doubt there is any consequences. Maybe your doctor is saying it because the scar is already there and can easily be opened again. Good luck :)
Reply:I dont know anyone that has tried and successfully done it. Its too dangerous.
Reply:Yes I have seen many One is my own sister she had natural birth for 1st, C-section for the second and again natural birth in the third with no complicaations absolutely normal.
Reply:They really don't recommend you have a vaginal birth after having a c-section but you will find the occasional doctor that will let you try. If this is what you choose to do be prepared that you'll more than likely end up having to have the c-section anyways. Good luck!
Reply:Yes VBAC (Vaginal Birth After C-section) are very common. Do some research into it on the internet and make your decision. Your current doctor is suggesting it because once you have a c-section it weakens your uterian wall and can cause compications if you try to have a vaginal birth later on. It depends on how are apart your pregnancies were, if you had any compications after your c-section, if you have had any complications during this pregnancy etc.
I only have one child, and don't plan on having anymore but if I did I would definately try to have my next child naturally. I had an an emergency c-section with my first son so I never got to "go into labor" or anything like that.
Good luck %26amp; congrats
Reply:I actually never gave birth.. but i have an older brother and a younger sister my brother was natural i was c section and my sister was natural.. and my mom was just fine and so was my little sister... the doctor who closed you up knows how your last pregnancy went so i would say that your probably safe to give natural birth.. best of luck to you.. and congrats
Reply:http://www.childbirth.org/articles/stori...
I don't have any personal experience with it but there is a whole section on VBAC on this site. Also, you do what you feel is right, you may end up with another c-section but who knows.
Good luck
Reply:i have had a friend who had 2 c sections and then gave delivery to her last child. she said she preferred c section though because it was easier for her knowing what to expect and all. i gave birth to my 1st 3 babies then had a c section. natural child birth can be tiring with all the pushing and stuff. you have to do what you think is right for your body. i prefer child birth naturally but some women tend to think that the c section is easier. so it's really up to you and your condition when that time comes. hope this helps
Reply:As long as your uterine incision is bikini cut, then you should be able to attempt a VBAC (vaginal birth after c/section), provided that the circumstances are ideal.
I had an emergency c/section with my son, both he and I were in distress. While pg with my daughter I decided that I want to try for VBAC.
Keep in mind that a vbac won't always happen. I ended up needing another emergency c/section b/c my my daughter went into distress, the cord was wrapped around her leg.
Natural birth is a vaginal birth without meds. I think it's awesome that you want to try that. Good luck to you. If you do have a vaginal birth but end up needing an epidural, that's OKAY, just remember that.
A friend of mine had a c/section with her first and was able to go through with a vbac with the second. It wasn't natural, though, she had an epidural.
Always remember that the safety of your baby will define how you give birth. If the vbac isn't possible, it's okay. As long as the little one comes safely, that's all that matters. :)
thank you cards
If f '(c) = 0 and f ''(c) > 0, then f has a local minimum at x = c?
If f '(c) = 0 and f ''(c) %26gt; 0, then f has a local minimum at x = c (true or false)
If f '(c) = 0 and f ''(c) %26gt; 0, then f has a local minimum at x = c?
True.
If f'(c) = 0, then c could be a local max or min.
If f''(c) %26gt; 0, then f(x) is concave up. You know what concave up looks like, right? It's kind of like a U.
That will be a local min.
If f '(c) = 0 and f ''(c) %26gt; 0, then f has a local minimum at x = c?
True.
If f'(c) = 0, then c could be a local max or min.
If f''(c) %26gt; 0, then f(x) is concave up. You know what concave up looks like, right? It's kind of like a U.
That will be a local min.
Thursday, July 30, 2009
Language programming C,C++ and Java?
I havent ever learned the languages like C, C++ and Java
But as its necessary for my major i want to do java
Canany one help me guiding that shoulld i take C or C++ before doing my Java
By the way i will be majoring in Computer Science !
Language programming C,C++ and Java?
You can go with Java straight without having any knowledge of C or C++. After that you should learn C as well. I highly recommend it.
C++ is not really necessary, and I don't consider it as a good computer programming language.
--
Best,
Adeil
Reply:Hi
I am a Computer Science teacher. First you need to find out from your college what programming language is used in the first course. Most colleges have already switched to Java. In fact the AP exam has been in Java as of 2003. Other schools are using C++ but very few are starting out with C. Java is modeled after C++ so it won't be hard make a transition from one to the other. If you are not in college yet I highly recommend you start with Java and use the free tutorials at java.sun.com. Good luck.
Reply:Personally, I think that you should learn Java first. It is a good language to learn first because it is fun object oriented language. As soon as you start learning it you will be making windows, menus, buttons, and etc. Learning that first will help you decide if programming is really want you want to do for a career. Next build on your knowledge and move to C and C++ and make more complex programs.
Reply:If u will be majoring in Computer Science, you will learn C Language first.
After learning C Language (procedural language), your syllabus will make u learn C++ (Object-oriented Language).
Then, after these 2 languages Java comes into picture.
No doubt, Java is more in use than C or C++.
My Advice wud be : Learn C, then C++ and finally Java.
Reply:C++ is more like Java than C. the more "natural" progression to learn would be C, C++ then Java.
But as its necessary for my major i want to do java
Canany one help me guiding that shoulld i take C or C++ before doing my Java
By the way i will be majoring in Computer Science !
Language programming C,C++ and Java?
You can go with Java straight without having any knowledge of C or C++. After that you should learn C as well. I highly recommend it.
C++ is not really necessary, and I don't consider it as a good computer programming language.
--
Best,
Adeil
Reply:Hi
I am a Computer Science teacher. First you need to find out from your college what programming language is used in the first course. Most colleges have already switched to Java. In fact the AP exam has been in Java as of 2003. Other schools are using C++ but very few are starting out with C. Java is modeled after C++ so it won't be hard make a transition from one to the other. If you are not in college yet I highly recommend you start with Java and use the free tutorials at java.sun.com. Good luck.
Reply:Personally, I think that you should learn Java first. It is a good language to learn first because it is fun object oriented language. As soon as you start learning it you will be making windows, menus, buttons, and etc. Learning that first will help you decide if programming is really want you want to do for a career. Next build on your knowledge and move to C and C++ and make more complex programs.
Reply:If u will be majoring in Computer Science, you will learn C Language first.
After learning C Language (procedural language), your syllabus will make u learn C++ (Object-oriented Language).
Then, after these 2 languages Java comes into picture.
No doubt, Java is more in use than C or C++.
My Advice wud be : Learn C, then C++ and finally Java.
Reply:C++ is more like Java than C. the more "natural" progression to learn would be C, C++ then Java.
C++ program need help?
/***************************************...
* 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 ****************************
* Who Date Description *
**************************************...
* Fuwen Xu 05/11/2007 calculate commissions *
**************************************...
#include %26lt;iostream%26gt;
#include %26lt;iomanip%26gt;
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 %26lt;%26lt; "\n\n\n\n";
cout %26lt;%26lt; "\n***************Fuwen Commission Computer******************\n";
cout %26lt;%26lt; "\nDo you have a commission to compute?(1 = yes, 0 = no)? ";
cin %26gt;%26gt; yesno;
while (yesno == 1)
{
cout %26lt;%26lt; "\nPlease enter the Agent ID: ";
cin %26gt;%26gt; id;
cout %26lt;%26lt; "\nPlease enter the category of property sold";
cout %26lt;%26lt; "\n(R = residential, C = commercial, M = multiunit): ";
cin %26gt;%26gt; choice;
switch(choice)
{
case 'r':
case 'R':
trc-=trc;
cout %26lt;%26lt;"Please enter the selling price: ";
cin %26gt;%26gt; price;
trc += (price*RCR);
nr += 1;
cout %26lt;%26lt;"\n\nThe commission for this sale for Agent "%26lt;%26lt;space%26lt;%26lt;id;
cout %26lt;%26lt;" is: "%26lt;%26lt;setw(2)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;trc;
break;
case 'c':
case 'C':
tcc-=tcc;
cout %26lt;%26lt;"Please enter the selling price: ";
cin %26gt;%26gt; price;
tcc += (price*CCR);
nc+=1;
cout %26lt;%26lt;"\n\nThe commission for this sale for Agent "%26lt;%26lt;space%26lt;%26lt;id;
cout %26lt;%26lt;" is: "%26lt;%26lt;setw(2)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tcc;
break;
case 'M':
case 'm':
tmc-=tmc;
cout %26lt;%26lt;"Please enter the selling price: ";
cin %26gt;%26gt; price;
tmc += (price*MCR);
nm+=1;
cout %26lt;%26lt;"\n\nThe commission for this sale for Agent "%26lt;%26lt;space%26lt;%26lt;id;
cout %26lt;%26lt;" is: "%26lt;%26lt;setw(2)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tmc;
break;
default:
cout %26lt;%26lt; "\nAn invalid value was entered.\n";
}
cout %26lt;%26lt; "\n\n";
cout %26lt;%26lt; "\nDo you have another commission to compute?(1 = yes,0 = no)? ";
cin %26gt;%26gt; yesno;
}
trc+=trc;
tcc+=tcc;
tmc+=tmc;
cout %26lt;%26lt; "\n\n********************End of Run Report************************";
cout %26lt;%26lt; "\n\nTotal number of Residential commissions computed = "%26lt;%26lt;nr;
cout %26lt;%26lt; "\nTotal number of Commercial commissions computed = "%26lt;%26lt;nc;
cout %26lt;%26lt; "\nTotal number of Multiunit commissions computed = "%26lt;%26lt;nm;
cout %26lt;%26lt; "\nTotal number of all commissions computed = "%26lt;%26lt;(nr+nc+nm);
cout %26lt;%26lt; "\n\nTotal amount of Redidential commissions computed = "%26lt;%26lt;setw(9)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tr...
cout %26lt;%26lt; "\nTotal amount of Commercial commissions computed = " %26lt;%26lt;setw(9)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tcc;
cout %26lt;%26lt; "\nTotal amount of Multiunit commissions computed = "%26lt;%26lt;setw(9)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tm...
cout %26lt;%26lt; "\n\nTotal amount of all commissions computed = "%26lt;%26lt;" $ "%26lt;%26lt;setw(12)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;(tr...
cout %26lt;%26lt; "\n";
return 0;
}
C++ program need help?
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.
Reply:BigRez,
who says u to "cut" and "paste".
if u know the answer then
just "select" and"copy" then "paste" to C++.
Sorry i can't anser to question b/c i am C student not C++.
Reply: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.)
Reply:Err, whats your question?
* 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 ****************************
* Who Date Description *
**************************************...
* Fuwen Xu 05/11/2007 calculate commissions *
**************************************...
#include %26lt;iostream%26gt;
#include %26lt;iomanip%26gt;
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 %26lt;%26lt; "\n\n\n\n";
cout %26lt;%26lt; "\n***************Fuwen Commission Computer******************\n";
cout %26lt;%26lt; "\nDo you have a commission to compute?(1 = yes, 0 = no)? ";
cin %26gt;%26gt; yesno;
while (yesno == 1)
{
cout %26lt;%26lt; "\nPlease enter the Agent ID: ";
cin %26gt;%26gt; id;
cout %26lt;%26lt; "\nPlease enter the category of property sold";
cout %26lt;%26lt; "\n(R = residential, C = commercial, M = multiunit): ";
cin %26gt;%26gt; choice;
switch(choice)
{
case 'r':
case 'R':
trc-=trc;
cout %26lt;%26lt;"Please enter the selling price: ";
cin %26gt;%26gt; price;
trc += (price*RCR);
nr += 1;
cout %26lt;%26lt;"\n\nThe commission for this sale for Agent "%26lt;%26lt;space%26lt;%26lt;id;
cout %26lt;%26lt;" is: "%26lt;%26lt;setw(2)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;trc;
break;
case 'c':
case 'C':
tcc-=tcc;
cout %26lt;%26lt;"Please enter the selling price: ";
cin %26gt;%26gt; price;
tcc += (price*CCR);
nc+=1;
cout %26lt;%26lt;"\n\nThe commission for this sale for Agent "%26lt;%26lt;space%26lt;%26lt;id;
cout %26lt;%26lt;" is: "%26lt;%26lt;setw(2)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tcc;
break;
case 'M':
case 'm':
tmc-=tmc;
cout %26lt;%26lt;"Please enter the selling price: ";
cin %26gt;%26gt; price;
tmc += (price*MCR);
nm+=1;
cout %26lt;%26lt;"\n\nThe commission for this sale for Agent "%26lt;%26lt;space%26lt;%26lt;id;
cout %26lt;%26lt;" is: "%26lt;%26lt;setw(2)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tmc;
break;
default:
cout %26lt;%26lt; "\nAn invalid value was entered.\n";
}
cout %26lt;%26lt; "\n\n";
cout %26lt;%26lt; "\nDo you have another commission to compute?(1 = yes,0 = no)? ";
cin %26gt;%26gt; yesno;
}
trc+=trc;
tcc+=tcc;
tmc+=tmc;
cout %26lt;%26lt; "\n\n********************End of Run Report************************";
cout %26lt;%26lt; "\n\nTotal number of Residential commissions computed = "%26lt;%26lt;nr;
cout %26lt;%26lt; "\nTotal number of Commercial commissions computed = "%26lt;%26lt;nc;
cout %26lt;%26lt; "\nTotal number of Multiunit commissions computed = "%26lt;%26lt;nm;
cout %26lt;%26lt; "\nTotal number of all commissions computed = "%26lt;%26lt;(nr+nc+nm);
cout %26lt;%26lt; "\n\nTotal amount of Redidential commissions computed = "%26lt;%26lt;setw(9)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tr...
cout %26lt;%26lt; "\nTotal amount of Commercial commissions computed = " %26lt;%26lt;setw(9)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tcc;
cout %26lt;%26lt; "\nTotal amount of Multiunit commissions computed = "%26lt;%26lt;setw(9)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;tm...
cout %26lt;%26lt; "\n\nTotal amount of all commissions computed = "%26lt;%26lt;" $ "%26lt;%26lt;setw(12)%26lt;%26lt;fixed%26lt;%26lt;setprecision(2)%26lt;%26lt;(tr...
cout %26lt;%26lt; "\n";
return 0;
}
C++ program need help?
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.
Reply:BigRez,
who says u to "cut" and "paste".
if u know the answer then
just "select" and"copy" then "paste" to C++.
Sorry i can't anser to question b/c i am C student not C++.
Reply: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.)
Reply:Err, whats your question?
Subscribe to:
Posts (Atom)