Sunday, August 2, 2009

C# Questions - Please Help ASAP!?

i am having some difficulty with these C# questions! i will give you the questions and 4 possible answers, please can you provide me with the correct answer and please explain how you got that answer.... thanks in advance





7. What is the term used to describe a method that can be used in the code without creating an object of the class containing it?





a. protected


b. public


c. final


d. static





8. What is this called: int weight;?





a. Method declaration


b. Primitive declaration


c. Class declaration


d. Object declaration





9.What does the public modifier in method tiger mean?


public tiger()


{


my_set(100,"tiger");


show();


}





a. it is available to the animal class


b. it is available to all objects of the class


c. it is available to the lion class


d. it is available to any class

C# Questions - Please Help ASAP!?
I only know numbers 7 and 8 (because I barely know C#).





7. d. static, I think (by definition, I think)


8. d. Object declaration (because you are declaring the object weight as an int)


At 25°C, the standard enthalpy for the conversion of graphite to diamond is +1.895 kJ and the change in the..

At 25°C, the standard enthalpy for the conversion of graphite to diamond is +1.895 kJ and the change in the standard entropy for this reaction is -3.363 J/K. Based on these data





A. graphite cannot be converted to diamond at 1 atm pressure.


B. diamond is more stable than graphite at all T's at one atmosphere.


C. diamond is more stable than graphite below 290°C and graphite is more stable than diamond above this T.


D. graphite is more stable than diamond below 290°C and diamond is more stable than graphite above 290°C.

At 25°C, the standard enthalpy for the conversion of graphite to diamond is +1.895 kJ and the change in the..
to happen spontaneously we want a dG = -





dG = dH - T(dS)





dG = +1.895 kJ - T( -3.363 J/K)


@ no temperature can dG = -


------------------





A. TRUE : graphite cannot be converted to diamond at 1 atm pressure.





B. FALSE: diamond is more stable than graphite at all T's at one atmosphere.





C. FALSE: diamond is more stable than graphite below 290°C and graphite is more stable than diamond above this T.





D. FALSE: graphite is more stable than diamond below 290°C and diamond is more stable than graphite above 290°C.


C/C++ anyone?

is C++ hard to learn? i wanna know cuz soon i plan on making games one day...if anyone learnt C/C++, plz tell me how hard it was....

C/C++ anyone?
Actually, C and C++ are pretty easy languages to learn.





The hard part is "Windows Programming" including the Windows API, MFC, and any other graphic API's (DirectX or other).





Most people who post on this site are really commenting on the Windows API and not the C/C++ language itself: "difficult, steep learning curve, etc." This is the trouble, if you're thinking of programming a Windows game, you're going to have to learn the Windows stuff--the hard part.





In your mind, always separate the language from the platform. It'll make understanding easier. And remember, the Mars rover does not have a Windows OS. Yet, most of it is programmed in C/C++. (I believe the underlying system is VxWorks).





Good luck.
Reply:C/C++ is a pretty difficult language. In my opinion, it's because it's so versatile. You can do so much with it and the syntax isn't as limiting for many functions like other languages (example: even though this many not mean much to you yet, C/C++ lets you do almost any kind of Overloading. This can pose troubleshooting problems if you don't know what you're doing). This makes it very powerful to use, but, you have to know exactly what you want the compiler to do.
Reply:It all depend on how good you are.
Reply:Depends on how well good your are with computers





I would say it's so-so, there are harder ones. I started learning in Augest during school. I can now make games like War, tic-tac-toe, ect.


Wasn't extreamly hard, but takes alot of logical thinking.
Reply:C++ is one of the harder programming languages to learn, however it isn't to bad to learn. It took me 3 years to learn it from my college. However, if you want to make games such as Halo 3 (which is written in C++) or other "state of the art" games that have intense graphics math plays a huge role in the programming. You'd be shocked to see how much higher level math as calculus and linear algebra goes into the making of such games. So a good word of advice to you would be to get really really really good at math and physics such as calc 3 by the time ur done with school. Just because you know C++ doesn't mean you can write games because it is probably the hardest form of programming. For now though start off simple and just learn the basic parts of C++, because it will take a few years before you can do sweet graphic work, but in the end it will all pay off!
Reply:its ez mode
Reply:it depends on how much programing experience you have. i leanred C last term and it was fairly easy but i have been in CS for 5 years

dracaena

C/D Car Changer Needs Re-Programming?

I have just recently purchased a BMW 850 csi which has a c/d changer that will not play my own c/d music--just new c/d's


Is there any way I can get this machine programmed to accept my discs


I have another 840 Bm which also has the same c/d changer and that one plays all my discs





Any help or advice will be much appreciated





I am in the London area in case there is someone I can contact or see





Thanks

C/D Car Changer Needs Re-Programming?
Make sure you're using CD-R discs, not CD-RW. You might try burning the CDs in another format.


Programming in Dev C++...Please Help?

I know C++ programming in Turbo C++.


But my same source codes from Turbo C++ are not working in Dev C++


Are the codes in Dev C++ different?





In turbo i wrote


#include%26lt;iostream.h%26gt;





but when i write the same thing in Dev C++ it jus doesn't accept it.

Programming in Dev C++...Please Help?
C++ libraries don't use .h anymore. Some compilers still support .h C++ includes, but most don't anymore.





Instead of





[code]


#include %26lt;iostream.h%26gt;


[/code]





You will have to use





[code]


#include %26lt;iostream%26gt;





using namespace std;


[/code]





If you don't know what a namespace is, you better google it, but to put it short, the C++ objects are into the std namespace, so you will have to either type that, or to type std:: before each object.





For example: std::cout %26lt;%26lt; "hello world";





(However as I said, "std::" is not necessary if you type "using namespace std;" in the start, becuase you tell the compiler the default namespace is std).








Other C++ includes are:


%26lt;vector%26gt; %26lt;string%26gt; %26lt;ctime%26gt; %26lt;cmath%26gt; (...)





As you can see, the names are the same, but without a .h and into the namespace std.
Reply:To see the output you could pause the program.


Try adding a "system("pause");" statement before the return.





Note that the function system() is basically Windows only. Report It

Reply:you can run your application through the DOS console:


go to start%26gt;run%26gt;cmd you will go to dos mode


then write the applicaiton name (ie. .exe), the result will be the following lines so no need to pause the system. Report It

Reply:Also instead of system("PAUSE"), you could put cin.get();





It makes you press enter to exit, and works good in Hello world, but if you want to create something that has input, I recommend using system("PAUSE"), its just that you never know if cin.get(); will work with input... Report It

Reply:It might accept





# include%26lt;iostream%26gt;
Reply:i have same problem can u help to find turbo C++ pls my ID is grubb128 now i'm online pls help me%26gt;%26gt;%26gt;

morning glory

C language help regarding Mouse pointer?

i am not using any server or .. it plain winxp and plain turbo c editor have made a game using graphics and ofcourse keyboard i want to have mouse interface too ?help?








C language help regarding Mouse pointer?


well.. how to make the mouse pointer appear on a project in c??


i have the coding writen in a book which makes the mouse pointer appear in the program also reads if the mouse bottom is clicked or not but i just can seem to understand the terms used in making the program i searched the net but cannot find a specific article related to implement or initializemouse in c with clear deiscription ?? any particular sites would be helpful or a detail explanation thanku?

C language help regarding Mouse pointer?
Bestever resource is


http://www.programmersheavan.com








Cheers:)
Reply:C language? So let me get this, you created a game using the graphics api? Why not use opengl/direct3d or whatever. Is your game fullscreen?


M.A.C Studio Fix ? Is it a big problem for causing skin problem?

I have used M.A.C Studio Fix (foundation with powder). I also have acne problem on my face too. Since high school was over for me and summer time begins I havent used my M.A.C Studio Fix every since and getting major breakout problems on my face. But.. what I have notice is that everytime I put M.A.C Studio Fix on my breakout vanished just like that. Its weriod.. I heard that M.A.C Studio fix is not good for your skin and can cause more breakouts. Is this true? If so should I switch to the M.A.C Foundation? or something?

M.A.C Studio Fix ? Is it a big problem for causing skin problem?
MAC studio Fix is 1 of my best foundations ever. it gives me this celebrity glow on my face


dont listen to people, use it if it works for u


we all have different skin types and reactions


what works for 1 person might not work for the other. it will b unfair to brand it bad just because a few people didnt choose the right product range.
Reply:My feeling is that no the MAC does not break you out. You however gave me a bit to think about though. I have mild acne, but only on my cheeks and I have been using MAC studio fix (powder only) for a while now. I absolutely LOVE the way it matches my skin and covers blemishes. I just find it hard to believe that such a popular makeup line as MAC would be harsh on even sensitive skin! Maybe try for a while using one without the other. Also try using a big soft brush for applying your powder, instead of the pad that comes with it.


best wishes


C++ computer programming question 3.please help!?

Write a function with a char* argument s and int argument length whichreserves the string so that the first letter becomes the last and so on.


The following sample tasks may help:





sample task 1


write a function with a const char* arguments, an int argument length and a character argument c,which which returns the number of characters c in s








int count(const char* s, int length, char c)


{


int i, cnt;


for(i=0, cnt=0; i%26lt; length; ++i)


if(*(s + 1) == c)


++cnt;


return cnt;


}








sample task 2:


write a function with int* argument a and int argument length which reurns the maximum element in the memory block a





int max_element(int* a, int length)


{


int i, max;


for (max = *a, i=1; i%26lt;length; ++1)


if(max%26lt; *(a+i))


max= *(a+i);


return max;


}

C++ computer programming question 3.please help!?
I'll tell U something that could help in the reverse task





U can use one of two things





1-


by includeing %26lt;string%26gt; %26amp; %26lt; algorithm%26gt;





void revers(char* a,int length)


{


string s = a;


reverse(s.begin() , s.end());


a = s;


}





2-


by using a loop





void reverse(char *a,int length)


{


int i=0;


for(i=0;i%26lt; = (length/2) ;i++)


a[length-i-1] = a[i];


}


Doubts in C,JAVA, DBMS,Some Programs...?

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

geranium

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 .


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.


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. :)


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.

sweet pea

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.


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?


How Much C# Does ASP.NET Development requires?

I believe ASP%26gt;NET comes with its own controls etc.. Now I read that C# is sometimes requires to write code that ASP.NET does not provide. My question is simple.:


I know that at this point C# is needed but how much C# should i know? The basics? I am sure that to develop ASP.NET you don't need to know as much C# than if you are a C# software developer.





Thank you.

How Much C# Does ASP.NET Development requires?
.NET (dot net) is a framework which is used, typically, for web development. To that end, you can choose a few different languages to code in. C# and ASP are two such languages. If you are writing a .NET application, you do not need any knowlege of C#. You may choose to write the application in another language if you'd like.
Reply:You will need C# as if you are a software developer because thats what a web developer is; a software developer.





In general how much C# you will need depends on what you want your application to accomplish.





With ASP.NET controls you might end up writing less code, however you you will still need to write C#.





You will not need to go and read an in-depth C# programming book. Just learn the C# as presented in an ASP.NET book for beginners as you go. Usually that suffices for a beginner.





Hope that helps.
Reply:ASP.net isn't a language on it's own. it's part of Microsofts dotnet framework. It supports C#, VB.Net, J# and maybe others. I'm using vb.net myself but c# can be more powerfull if you want to create usercontrols etc. But 99.9% you can stick with vb.net which is a neat language. You'll learn it within a few weeks, you can follow microsofts excellent video-tutorials to get you started
Reply:Boy... a question straight to my heart...





Having just been through this dilemma not more than a month ago, I can tell you that ASP.Net only requires C# (or any other language) if you want to actually do more things than you can get from drag/drop elements and setting properties. If you want any database interaction that isn't 100% canned, you NEED custom programming.





How much do you need? Well, that depends upon what you are doing. Simple processing of webforms to handle what the user inputs requires some or all of the fundamentals of the launguage: Types, Variables and Constants, Expressions, Statements, and Operators. If you want to do any database interaction that isn't canned, you need Classes and Objects, Preprocessor Directives, Arrays, Indexers, Collections, Strings and Regular Expressions.





The only thing you don't need that a desktop application developer does is a knowledge of Windows Forms and how to interact with them. But I find it does help to be at least familiar with the concepts.





Feel free to contact me if you need help. Also, here are a couple of good books for you to read...


C HD is slave to E HD If I rmv C wil E stil work.How do I fnd which Drv holds OS I wnt 2 use C drv 4 other use

Will the E drv default to C and relabel all files and folders C


What are my options

C HD is slave to E HD If I rmv C wil E stil work.How do I fnd which Drv holds OS I wnt 2 use C drv 4 other use
If you remove the C hard drive, it will relabel your other drives.





Your operating system is probably on C:. Look for the drive that has a "WINDOWS" or "WINNT" folder in the root (it's nearly always C:). You will probably have to install your operating system again.





If you are using IDE drives (they have the 2-3 inch wide flat cables), you may need to change the E: drive from "Slave" to "Master" to make it work. This may be done by changing the cable plugged into it, or it may be done by changing a jumper switch on the back of the drive itself, depending on how old your machine is.

rose

C++ Classes?

I've programmed in Java, C#, and VB (6.0 and .NET) for years, so I understand the concepts of private, public, protected, and object oriented programming. Recently here in college, we've started learning C++. We're going a bit to slow to peak my interest so I decided to do a bit of studying on my own. I know C++ is object oriented, but I haven't found a good way to create classes in C++. If anybody could point me to a site with an example for creating constructors, destructors, and the methods in the class, or just give me an example of one, then I'd greatly appreciate it! Thanks.

C++ Classes?
I have listed a site in my source. You could always look ahead in the book and see what kind of examples they have in their.


What's wrong with my vb C program???

#include "stdAfx.h"


#include %26lt;stdlib.h%26gt;


#include %26lt;string.h%26gt;


#include %26lt;ctype.h%26gt;


#include %26lt;conio.h%26gt;


#include %26lt;windows.h%26gt;





int create();


void inputData();


void createFile();


int addRec();


void DisplayTrans();


int update();


void addFile();


void deleteRec();





void printfRecord();


int isFound(char *target,int cnt);


void deleteRec(char *target,int cnt);





void displayTitle();


void search(char[],int*,int*);


void displayRec();


void updateRec(int);


void searchUpdate();


void searchNdisplay();





struct


{


char transNum[5];


char studID[11];


char dateBorrowed[11];


}trHeaderRec,trHeaderTemp[4];








FILE *trHeaderFile;











int main (void)


{


int choice;





trHeaderFile = fopen("TRHEADER.DAT","r");





if((trHeaderFile = fopen("TRHEADER.DAT","r"))==NULL)


trHeaderFile = fopen("TRHEADER.DAT","w+");


printf("File could not be opened!");





else


{


switch(choice)


case 1: create();


break;


case 2: DisplayTrans();


break;


case 3: addRec();


break;


case 4: deleteRec();


break;


default:searchNdisplay;


break;


}





int create()


{


char response;





trHeaderFile = fopen("TRHEADER.DAT","rb");





if(trHeaderFile != NULL)


printf("FILE ALREADY EXISTS...\n");





do


{


fflush(stdin);


printf("Hit 'Y' to OVERWRITE, otherwise hit 'N'?\t");


scanf("%c",%26amp;response);


}while(toupper(response) != 'Y'%26amp;%26amp;toupper(response) != 'N');





if(toupper(response) == 'Y')


{





createFile();


fclose(trHeaderFile);


}





else


{


createFile();


fclose(trHeaderFile);


}








return 0;


}





void createFile()


{


char response;


trHeaderFile = fopen("TRHEADER.DAT", "wb");


do


{


inputData();


fwrite(%26amp;trHeaderRec, sizeof(trHeaderRec), 1, trHeaderFile);


do


{


printf("Hit 'Y' to ADD MORE, hit 'N' to save and exit....\t");


fflush(stdin);


scanf("%c", %26amp;response);





}while(toupper(response) != 'Y' %26amp;%26amp; toupper(response) != 'N');





}while(toupper(response) == 'Y');


}








void inputData()


{


system("cls");


printf("4-character Transaction Number: ");


scanf("%s", trHeaderRec.transNum);


printf("10-character Student I.D.: ");


scanf("%s", trHeaderRec.studID);


printf("10-character Date Borrowed[mm/dd/yyyy]: ");


scanf("%s", trHeaderRec.dateBorrowed);





}





//display





void DisplayTrans()


{





system("cls");





trHeaderFile=fopen("TRHEADER.dat","r")...


if((trHeaderFile= fopen("TRHEADER.dat","r"))==NULL)


{


printf("The file does not exist.");


}


else


{


fread(%26amp;trHeaderRec,sizeof(trHeaderRec)...





if(feof(trHeaderFile))


printf("File is empty");











else





{








printf("\t\t\t ***Transaction Report***\n");


printf("\n%5s%s%8s%s%4s%s", "", "TransNum", "", "studID", "", "dateBorrowed", "");








}





do





{





printf("\n%7s%s%12s%s%8s%s", " ", trHeaderRec.transNum, "", trHeaderRec.studID, "", trHeaderRec.dateBorrowed, "");


fread(%26amp;trHeaderRec,sizeof(trHeaderRec),1...











}while(!feof(trHeaderFile));














}fclose(trHeaderFile);





}





//add

















int addRec()


{


char reply;





trHeaderFile=fopen("TRHEADER.DAT","wb"...





if(trHeaderFile!=NULL)


printf("THE FILE ALREADY EXISTS\n");





do


{


fflush(stdin);


printf("Overwrite[Y/N]?\n");


scanf("%c",%26amp;reply);


}while(toupper(reply)!='Y'%26amp;%26amp;toupper(...





if(toupper(reply)=='Y')


{ addFile();


fclose(trHeaderFile);


}


else


{ addFile();


fclose(trHeaderFile);





}


return 0;


}








void addFile()


{


char reply;


trHeaderFile=fopen("TRHEADER.DAT","wb...


do


{


inputData();


fwrite(%26amp;trHeaderRec,sizeof(trHeaderR...


do


{


printf("Add more[Y/N]?:");


fflush(stdin);


scanf("%c",%26amp;reply);


}while(toupper(reply)!='Y'%26amp;%26amp;toupper(r...





}while(toupper(reply)=='Y');


}








//void deleteRec()





//{


//headerFile=fopen("TRHEADER.DAT","r"...


//if(headerFile==NULL)


// {





// printf("The file does not exist!\n");


// printf("Press any key to end!!");


// fflush(stdin);


// getch();


// }


// else


//{


//fread(%26amp;headerRec,sizeof(headerRec)...


//if(feof(headerFile))


// {


// printf("The file is empty");


// fflush(stdin);


// getch();


// }


// else


// searchNdisplay();


// }


// fclose(headerFile);





// return 0;


//}


void searchNdisplay()


{


char target[11],ans,ANS;








trHeaderFile=fopen("TRHEADER.DAT","r"...





int cnt=0,found=0;


fread(%26amp;trHeaderRec,sizeof(trHeaderRec...


while(!feof(trHeaderFile))


{





strcpy(trHeaderTemp[cnt].studID,trHe...


strcpy(trHeaderTemp[cnt].transNum,tr...


strcpy(trHeaderTemp[cnt].dateBorrowe...


fread(%26amp;trHeaderRec,sizeof(trHeaderRe...


cnt++;


}


fclose(trHeaderFile);


do


{


printf("Input studentID:");


fflush(stdin);


gets(target);





if(isFound(target,cnt))


{


printfRecord();


do


{


printf("Do you want to delete this record?(y/n): ");


fflush(stdin);


scanf("%c",%26amp;ans);


}while(ans!='y'%26amp;%26amp;ans!='Y'%26amp;%26amp;ans!='n'...





if(ans=='y'||ans=='Y')


{


deleteRec(target,cnt);


printf("\nThe record has been deleted\n");


}





do


{


printf("Do you want to search another record?(y/n): ");


fread(%26amp;trHeaderRec,sizeof(trHeader...


fflush(stdin);


scanf("%c",%26amp;ANS);


}while(ANS!='y'%26amp;%26amp;ANS!='Y'%26amp;%26amp;ANS!='n'...


}


else


printf("Record is not in the list!");





trHeaderFile=fopen("TRHEADER.DAT","...





int cnt=0,found=0;


fread(%26amp;trHeaderRec,sizeof(trHeaderRec...


while(!feof(trHeaderFile))


{


strcpy(trHeaderRec.studID,trHeaderTe...


strcpy(trHeaderRec.transNum,trHeader...


strcpy(trHeaderRec.dateBorrowed,trHe...


fread(%26amp;trHeaderRec,sizeof(trHeaderRe...


cnt++;


}


fclose(trHeaderFile);


}while(ANS=='y'||ANS=='Y');





fclose(trHeaderFile);


}


int isFound(char *target,int cnt)


{


int found;





for(int a=0;a%26lt;cnt;a++)


{


if(strcmp(trHeaderTemp[a].studID,tar...


{


found=1;


}


else


fread(%26amp;trHeaderRec, sizeof(trHeaderRec),1,trHeaderFile);





}


return found;


}


void printfRecord()


{





printf("%s\t%s\t%s\t%s\t%s\t%s\t\n",t... trHeaderRec.dateBorrowed);


}


void deleteRec(char *target,int cnt)


{


int num=0;


for(int a=0;a%26lt;cnt;a++)


{


if(strcmp(trHeaderTemp[a].studID,tar...


{


for(int b=cnt;b%26gt;=num;b++)


{


trHeaderTemp[cnt]=trHeaderTemp[cnt...


}


break;


}


else


num++;


}


}





// update


int update()


{


trHeaderFile=fopen("TRHEADER.DAT","r")...





if(trHeaderFile==NULL)


{


printf("The file does no exist\n\n press any key to continue\n");


getch();





}


else


{


fread(%26amp;trHeaderRec,sizeof(trHeaderRec...


if(!feof(trHeaderFile))


printf("file is empty...\n\n");


else


searchUpdate();


}


return 0;


}





void searchUpdate()


{


char answer,target[5];


int found,size,len;





displayTitle();





do{


do{


printf("record to be update\n");


printf("transaction code");


scanf("%s",target);


len=strlen(target);





}


while(len!=4);


search(target,%26amp;found,%26amp;size);


if(!found)


printf("the record does not exist");


else


{


displayRec();


do{


printf("update this record [Y/N]?");


fflush(stdin);


scanf("%c",%26amp;answer);


answer=toupper(answer);





}


while(answer!='Y'%26amp;%26amp; answer!='N');





if(answer=='Y')


updateRec(size);





do


{


printf("update this record [Y/N]?");


fflush(stdin);


scanf("%c",%26amp;answer);


answer=toupper(answer);


}


while(answer!='Y'%26amp;%26amp; answer!='N');





}


}


while(answer=='Y');


}





void displayTitle()


{


printf("\n\n");


printf("USJR\n");


printf("\tlibrary");


printf("\trecords of books borrowed");





}





void search(char tar[],int*fnd,int*sz)


{


int cnt=0;





trHeaderFile=fopen("TRHEADER.DAT","r"...





fread(%26amp;trHeaderRec,sizeof(trHeaderRec...


*fnd=0;


*sz=0;





while(!feof(trHeaderFile)%26amp;%26amp;*fnd!=1)


{


if(tar==trHeaderRec.transNum)


*fnd=1;


else


{


cnt++;


fread(%26amp;trHeaderRec,sizeof(trHeaderR...





*sz=cnt*sizeof(trHeaderRec);


}


}


}


void displayRec(){


printf("transaction number: %s\n",trHeaderRec.transNum);


printf("studID: %s\n",trHeaderRec.studID);


printf("dateBorrowed: %s\n",trHeaderRec.dateBorrowed);


}





void updateRec(int size)


{


char reply;


int choice;





do{


clearScrn();





do{





printf("which field you want to update?\n");


scanf("%d",%26amp;choice);


}


while(choice%26lt;4);





switch (choice)


{


case 1:


printf("transaction #\n");


scanf("%s",trHeaderRec.transNum);


break;


case 2:


printf("dateBorrowed\n");


scanf("%s",trHeaderRec.dateBorrowed);


break;


case 3:


printf("studID\n");


scanf("%s",trHeaderRec.studID);


break;


default:printf("unexpected choice of field\n");


}


do{


printf("do you want to update another?/n");


fflush(stdin);


scanf("%c",%26amp;reply);


}


while(reply!='Y'%26amp;%26amp;reply!='N');


}


while(reply=='Y');





fseek(trHeaderFile,size,SEEK_SET);


fwrite(%26amp;trHeaderRec,sizeof(trHeaderRec),...


fclose(trHeaderFile);


}

What's wrong with my vb C program???
You're not asking for much are you.





NB: Part of your code gets cut off by Y!A then you paste it in, so you might have to rely on the compiler to tell you what's wrong
Reply:Can you add additional infos?? i don't want to read all of them.. When you compile it what does it say?? and what line??
Reply:Do you have a compiler error message; or was it producing an unexpected output? Please provide additional info
Reply:1. What is it supposed to do?


2. What does it do?


3. What errors do you get?


4. Where is the complete source?


C++ calculator program?

I made this c++ calculator program, but for some reason it only multiplies. How can this be fixed? Here's the Program:


#include %26lt;iostream%26gt;


using namespace std;





double operate (double x, double y)


{


return (x*y);


}





float operate (float m, float n)


{


return (m/n);


}





int operate (int a, int b)


{


return (a+b);


}





long operate (long c, long d)


{


return (c-d);


}


int main(int argc, char *argv[])


{


double x, y;


float m, n;


int a, b;


long c, d;


char operation;


cout %26lt;%26lt; "Choose operation" %26lt;%26lt;endl;


cout %26lt;%26lt; "1: *, 2:/, 3:+, 4: - "%26lt;%26lt;endl;


cin %26gt;%26gt; operation;





while (operation = 1)


{


cout %26lt;%26lt; "enter x:" %26lt;%26lt;endl;


cin %26gt;%26gt; x;


cout %26lt;%26lt; "enter y:" %26lt;%26lt;endl;


cin %26gt;%26gt; y;


cout %26lt;%26lt; operate (x,y) %26lt;%26lt; endl;


cout %26lt;%26lt; "Choose operation" %26lt;%26lt;endl;


cout %26lt;%26lt; "1: *, 2:/, 3:+, 4: - "%26lt;%26lt;endl;


cin %26gt;%26gt; operation;


}





while (operation = 2)

C++ calculator program?
This is the easiest mistake to make. while (operation = 1) is actually RESETTING operation to 1. You need to do (operation == 1) instead.





Even experienced developers make this typo. To prevent it, get in the habit of putting the const first. While (1 == operation). The compiler will prevent you from ever messing up again.





The second problem is that operation is a char, but you are comparing it to an int. The compiler doesn't complain, because under the covers a char is really an int of the ASCII value of the char. If you fix the = to ==, you will fall through. You need to write while ('1' == operation) or define operation as an int instead of a char.





Once you fix that, you should be good to go. There is no problem with ambiguity with the operate functions. Your overloads are fine.
Reply:try operator overloading. . .it might make the program a bit shorter. . .
Reply:All your functions are called "operate", which is confusing, rename them to something more meaningful "MyMultiply", "MyDivide" etc.





Also, your while loop is only spinning if "operation" is "1". So it needs to loop if "operation" is less than four.





You'll will also need some extra logic inside the loop to determine the correct function to call.
Reply:Okay, going to try and tackle a couple of your issues, some which have already been mentioned:





1. Your while loops are using assignment "=" instead of comparison.





2. It seems that you are attempting to do operator overloading. You will call the different "operate" functions based on what types you feed in. Since you are stuck in your first while loop, you are always feeding in doubles 'x' and 'y' and therefore will always call your operator that deals with doubles.





3. The general structure of your program is a bit odd. It seems that what you generally want to do is loop infinitely(hopefully this is what you meant to do). If that is the case, you need a single while loop. Your current setup would make it so that you could at best, do some number of multiplies, then some number of divisions, then some addition, and then some subtraction, but you could never do addition, then multiplication, etc. Use a case/switch statement if you are familiar with it. If you aren't, you can use if statements. Then main thing is just to have one overall loop.
Reply:Why are you using While? While is a loop.





Change the while to a an If statement. Or better yet change to a switch statement (If you covered switch statements in your class).





switch (operations)





case '1'


{


cout %26lt;%26lt; "enter x:" %26lt;%26lt;endl;


cin %26gt;%26gt; x;


cout %26lt;%26lt; "enter y:" %26lt;%26lt;endl;


cin %26gt;%26gt; y;


cout %26lt;%26lt; operate (x,y) %26lt;%26lt; endl;


cout %26lt;%26lt; "Choose operation" %26lt;%26lt;endl;


cout %26lt;%26lt; "1: *, 2:/, 3:+, 4: - "%26lt;%26lt;endl;


cin %26gt;%26gt; operation;


break;


}


case '2'


...
Reply:I think there are a couple of reasons that the program will only mutiply, first being that all of the methods are named "operate", so when the program calls "operate", it is always going to use the first one encountered, which happens to be the one that multiplies. I would stongly suggest changing to each method name to a unique name.


Now, about the logic.. this program could be greatly simplified by creating methods for the inputting and outputting of the numbers, as well as an "operation" method that could perform any one of the four operations, depending on what the user chooses. You could include the operations in a swtich statement, like so :





switch (operation)


1


multiply the nums


break


2


divide the nums


break


...





Code may be a little of (I'm not a C++ developer) but the concept is good. Try that out. Good luck :)
Reply:include the int main() function, write your user define functions after the int main, and give them defferent names. your program shall work if you like i could give you a full code.


What's wrong with my vb C program???

#include "stdAfx.h"


#include %26lt;stdlib.h%26gt;


#include %26lt;string.h%26gt;


#include %26lt;ctype.h%26gt;


#include %26lt;conio.h%26gt;


#include %26lt;windows.h%26gt;





int create();


void inputData();


void createFile();


int addRec();


void DisplayTrans();


int update();


void addFile();


void deleteRec();





void printfRecord();


int isFound(char *target,int cnt);


void deleteRec(char *target,int cnt);





void displayTitle();


void search(char[],int*,int*);


void displayRec();


void updateRec(int);


void searchUpdate();


void searchNdisplay();





struct


{


char transNum[5];


char studID[11];


char dateBorrowed[11];


}trHeaderRec,trHeaderTemp[4];








FILE *trHeaderFile;











int main (void)


{


int choice;





trHeaderFile = fopen("TRHEADER.DAT","r");





if((trHeaderFile = fopen("TRHEADER.DAT","r"))==NULL)


trHeaderFile = fopen("TRHEADER.DAT","w+");


printf("File could not be opened!");





else


{


switch(choice)


case 1: create();


break;


case 2: DisplayTrans();


break;


case 3: addRec();


break;


case 4: deleteRec();


break;


default:searchNdisplay;


break;


}





int create()


{


char response;





trHeaderFile = fopen("TRHEADER.DAT","rb");





if(trHeaderFile != NULL)


printf("FILE ALREADY EXISTS...\n");





do


{


fflush(stdin);


printf("Hit 'Y' to OVERWRITE, otherwise hit 'N'?\t");


scanf("%c",%26amp;response);


}while(toupper(response) != 'Y'%26amp;%26amp;toupper(response) != 'N');





if(toupper(response) == 'Y')


{





createFile();


fclose(trHeaderFile);


}





else


{


createFile();


fclose(trHeaderFile);


}








return 0;


}





void createFile()


{


char response;


trHeaderFile = fopen("TRHEADER.DAT", "wb");


do


{


inputData();


fwrite(%26amp;trHeaderRec, sizeof(trHeaderRec), 1, trHeaderFile);


do


{


printf("Hit 'Y' to ADD MORE, hit 'N' to save and exit....\t");


fflush(stdin);


scanf("%c", %26amp;response);





}while(toupper(response) != 'Y' %26amp;%26amp; toupper(response) != 'N');





}while(toupper(response) == 'Y');


}








void inputData()


{


system("cls");


printf("4-character Transaction Number: ");


scanf("%s", trHeaderRec.transNum);


printf("10-character Student I.D.: ");


scanf("%s", trHeaderRec.studID);


printf("10-character Date Borrowed[mm/dd/yyyy]: ");


scanf("%s", trHeaderRec.dateBorrowed);





}





//display





void DisplayTrans()


{





system("cls");





trHeaderFile=fopen("TRHEADER.dat","r")...


if((trHeaderFile= fopen("TRHEADER.dat","r"))==NULL)


{


printf("The file does not exist.");


}


else


{


fread(%26amp;trHeaderRec,sizeof(trHeaderRec)...





if(feof(trHeaderFile))


printf("File is empty");











else





{








printf("\t\t\t ***Transaction Report***\n");


printf("\n%5s%s%8s%s%4s%s", "", "TransNum", "", "studID", "", "dateBorrowed", "");








}





do





{





printf("\n%7s%s%12s%s%8s%s", " ", trHeaderRec.transNum, "", trHeaderRec.studID, "", trHeaderRec.dateBorrowed, "");


fread(%26amp;trHeaderRec,sizeof(trHeaderRec),1...











}while(!feof(trHeaderFile));














}fclose(trHeaderFile);





}





//add

















int addRec()


{


char reply;





trHeaderFile=fopen("TRHEADER.DAT","wb"...





if(trHeaderFile!=NULL)


printf("THE FILE ALREADY EXISTS\n");





do


{


fflush(stdin);


printf("Overwrite[Y/N]?\n");


scanf("%c",%26amp;reply);


}while(toupper(reply)!='Y'%26amp;%26amp;toupper(...





if(toupper(reply)=='Y')


{ addFile();


fclose(trHeaderFile);


}


else


{ addFile();


fclose(trHeaderFile);





}


return 0;


}








void addFile()


{


char reply;


trHeaderFile=fopen("TRHEADER.DAT","wb...


do


{


inputData();


fwrite(%26amp;trHeaderRec,sizeof(trHeaderR...


do


{


printf("Add more[Y/N]?:");


fflush(stdin);


scanf("%c",%26amp;reply);


}while(toupper(reply)!='Y'%26amp;%26amp;toupper(r...





}while(toupper(reply)=='Y');


}








//void deleteRec()





//{


//headerFile=fopen("TRHEADER.DAT","r"...


//if(headerFile==NULL)


// {





// printf("The file does not exist!\n");


// printf("Press any key to end!!");


// fflush(stdin);


// getch();


// }


// else


//{


//fread(%26amp;headerRec,sizeof(headerRec)...


//if(feof(headerFile))


// {


// printf("The file is empty");


// fflush(stdin);


// getch();


// }


// else


// searchNdisplay();


// }


// fclose(headerFile);





// return 0;


//}


void searchNdisplay()


{


char target[11],ans,ANS;








trHeaderFile=fopen("TRHEADER.DAT","r"...





int cnt=0,found=0;


fread(%26amp;trHeaderRec,sizeof(trHeaderRec...


while(!feof(trHeaderFile))


{





strcpy(trHeaderTemp[cnt].studID,trHe...


strcpy(trHeaderTemp[cnt].transNum,tr...


strcpy(trHeaderTemp[cnt].dateBorrowe...


fread(%26amp;trHeaderRec,sizeof(trHeaderRe...


cnt++;


}


fclose(trHeaderFile);


do


{


printf("Input studentID:");


fflush(stdin);


gets(target);





if(isFound(target,cnt))


{


printfRecord();


do


{


printf("Do you want to delete this record?(y/n): ");


fflush(stdin);


scanf("%c",%26amp;ans);


}while(ans!='y'%26amp;%26amp;ans!='Y'%26amp;%26amp;ans!='n'...





if(ans=='y'||ans=='Y')


{


deleteRec(target,cnt);


printf("\nThe record has been deleted\n");


}





do


{


printf("Do you want to search another record?(y/n): ");


fread(%26amp;trHeaderRec,sizeof(trHeader...


fflush(stdin);


scanf("%c",%26amp;ANS);


}while(ANS!='y'%26amp;%26amp;ANS!='Y'%26amp;%26amp;ANS!='n'...


}


else


printf("Record is not in the list!");





trHeaderFile=fopen("TRHEADER.DAT","...





int cnt=0,found=0;


fread(%26amp;trHeaderRec,sizeof(trHeaderRec...


while(!feof(trHeaderFile))


{


strcpy(trHeaderRec.studID,trHeaderTe...


strcpy(trHeaderRec.transNum,trHeader...


strcpy(trHeaderRec.dateBorrowed,trHe...


fread(%26amp;trHeaderRec,sizeof(trHeaderRe...


cnt++;


}


fclose(trHeaderFile);


}while(ANS=='y'||ANS=='Y');





fclose(trHeaderFile);


}


int isFound(char *target,int cnt)


{


int found;





for(int a=0;a%26lt;cnt;a++)


{


if(strcmp(trHeaderTemp[a].studID,tar...


{


found=1;


}


else


fread(%26amp;trHeaderRec, sizeof(trHeaderRec),1,trHeaderFile);





}


return found;


}


void printfRecord()


{





printf("%s\t%s\t%s\t%s\t%s\t%s\t\n",t... trHeaderRec.dateBorrowed);


}


void deleteRec(char *target,int cnt)


{


int num=0;


for(int a=0;a%26lt;cnt;a++)


{


if(strcmp(trHeaderTemp[a].studID,tar...


{


for(int b=cnt;b%26gt;=num;b++)


{


trHeaderTemp[cnt]=trHeaderTemp[cnt...


}


break;


}


else


num++;


}


}





// update


int update()


{


trHeaderFile=fopen("TRHEADER.DAT","r")...





if(trHeaderFile==NULL)


{


printf("The file does no exist\n\n press any key to continue\n");


getch();





}


else


{


fread(%26amp;trHeaderRec,sizeof(trHeaderRec...


if(!feof(trHeaderFile))


printf("file is empty...\n\n");


else


searchUpdate();


}


return 0;


}





void searchUpdate()


{


char answer,target[5];


int found,size,len;





displayTitle();





do{


do{


printf("record to be update\n");


printf("transaction code");


scanf("%s",target);


len=strlen(target);





}


while(len!=4);


search(target,%26amp;found,%26amp;size);


if(!found)


printf("the record does not exist");


else


{


displayRec();


do{


printf("update this record [Y/N]?");


fflush(stdin);


scanf("%c",%26amp;answer);


answer=toupper(answer);





}


while(answer!='Y'%26amp;%26amp; answer!='N');





if(answer=='Y')


updateRec(size);





do


{


printf("update this record [Y/N]?");


fflush(stdin);


scanf("%c",%26amp;answer);


answer=toupper(answer);


}


while(answer!='Y'%26amp;%26amp; answer!='N');





}


}


while(answer=='Y');


}





void displayTitle()


{


printf("\n\n");


printf("USJR\n");


printf("\tlibrary");


printf("\trecords of books borrowed");





}





void search(char tar[],int*fnd,int*sz)


{


int cnt=0;





trHeaderFile=fopen("TRHEADER.DAT","r"...





fread(%26amp;trHeaderRec,sizeof(trHeaderRec...


*fnd=0;


*sz=0;





while(!feof(trHeaderFile)%26amp;%26amp;*fnd!=1)


{


if(tar==trHeaderRec.transNum)


*fnd=1;


else


{


cnt++;


fread(%26amp;trHeaderRec,sizeof(trHeaderR...





*sz=cnt*sizeof(trHeaderRec);


}


}


}


void displayRec(){


printf("transaction number: %s\n",trHeaderRec.transNum);


printf("studID: %s\n",trHeaderRec.studID);


printf("dateBorrowed: %s\n",trHeaderRec.dateBorrowed);


}





void updateRec(int size)


{


char reply;


int choice;





do{


clearScrn();





do{





printf("which field you want to update?\n");


scanf("%d",%26amp;choice);


}


while(choice%26lt;4);





switch (choice)


{


case 1:


printf("transaction #\n");


scanf("%s",trHeaderRec.transNum);


break;


case 2:


printf("dateBorrowed\n");


scanf("%s",trHeaderRec.dateBorrowed);


break;


case 3:


printf("studID\n");


scanf("%s",trHeaderRec.studID);


break;


default:printf("unexpected choice of field\n");


}


do{


printf("do you want to update another?/n");


fflush(stdin);


scanf("%c",%26amp;reply);


}


while(reply!='Y'%26amp;%26amp;reply!='N');


}


while(reply=='Y');





fseek(trHeaderFile,size,SEEK_SET);


fwrite(%26amp;trHeaderRec,sizeof(trHeaderRec),...


fclose(trHeaderFile);


}

What's wrong with my vb C program???
I guess you didn't read the other post... Y!Answers isn't a good place to post code because it truncates lines. And, a program that large posted here isn't an easy thing to spot the problem.








What happens when you compile it?

flowering plum

C-section problems?

I had a c-setion for my delivery..Never made it to the Pushing or Nothing like that.. i ended up getting admited to the hospital cuz they said i had high blood pressure and they diagnosed me with preaclamsia...(have no idea how to spell it) which after the doctor vist i had they could never find high blood pressure after that...so the next day my doctor broke my water and i was in labor for 15 hrs....with in that 15hrs i never dialated at all..they had me on potossin and just kept highering the dose... never worked....so they woke me up cuz i had a local and told me that i had to have a epideral a hafe hour later i was in the c-section room..they never told me how much the baby weight..ect...didnt get to c her until i was total done and back in the room. after all that i ended up having to stay in the hospital for and extra week cuz i ended up getting a infection..Infection from what i have no idea....My question is...Is it common and what were your experinces with a c-section.....

C-section problems?
The infection could have been from the stitches, staples, or glue what ever the used on you. My friend did it naturally but got an infection from the stitching when she tore down below. I didn't get to see my baby until I was done because I was knocked out for my c-section. They probably kept you longer because of the infection and since you were rushed back there, was because you didn't see you baby.
Reply:When I had my first c-section, my water broke but my contractions never started. Pictosin when they put me on it, brought the baby's heart rate down. After 24 hours of this, they did my c-section. I went home 3 days later. I did not have any problems with infection. In fact, I had an easier time with healing and getting around than my sister in law did and she had hers naturally. I did not get to see my daughter until I finally flipped out and said I would go find her if they didn't bring her to me. The nurses are so busy, usually the one that yells loudest, gets the attention. Talk to your doctor and find out where the infection came from. Also, question the pictosin. Normally, it will have some effect. You just had a bad experience.
Reply:The induction problems are probably very common, but the whole mess they put you through for the c section...not that Ive heard. And the infection is uncommon.
Reply:Wow sounds like an ordeal.





I had a section with our daughter. Very routine.


Minimal pain. Healed quickly.
Reply:Sounds almost like what I went through. Labour started at 2 am and we got to the hospital at 3 am. 4 hours later they said I was only 1 cm dilated and that it was braxton. I freaked because if the contractions were any stronger I was going to die. They also told me I was having back labour because every contraction was followed by back spasms. They wanted to send me home. By this time my Doctor's office was open so we went there. She realized my uterus was tipped and that I was 3 cm dilated, no plug and that the back pain was not labour but real spasms triggered by the labour so she sent me back to the hospital. Also she informed me that the contractions I had been having for the last 4 days at 20 minutes apart weren't BH and I should have called her. Turns out I wasn't feeling every contraction.





At around 11 am she came in and broke my waters and started me on the pitocin, however the more they gave me the slower my contractions came so that ended about an hour later. At 2 they attempted to give me an epidural, took 5 tries before they got one that sort of worked, it was some relief at least and I got some sleep. At 5:30 the doctor came back, I was still at 3 and now the babies heart beat was dropping too far with each contraction so off to the operating room we went. Babies heart rate must have really dropped right before we went in because I vaguely remember an extreme sense of urgency and the fact that no curtain went up, my glasses and socks were left on and hubby just got pushed out the door, not sent to the waiting room.





Turns out one of the reasons why I had such a difficult labour and hadn't felt the contractions like I should have is that baby was standing up inside of me with one foot on each hip joint and his head buried behind my rib cage. That's what had pulled my uterus out of it's normal position and why the muscle contractions weren't felt by me. Since he wouldn't or couldn't turn or pull his legs together to be breech, plus me never getting past 3 cm dilated, natural childbirth would have probably killed both of us a century ago.





For the actual c-section, the spinal block didn't reach low enough and when she went to cut me I could feel the pain of her slicing me. I went night night after that and woke up about an hour later and spent another hour in the recovery room. The nurses there were nice enough to call and get me some information about the baby and reassure me that he was fine. The birth trauma though caused him to have an APGAR score of 5 at first but it was up to 10 by 10 minutes. I didn't get to hold my son until I was moved to the L%26amp;D ward and then 3 hours later they took him to the nursery because they couldn't leave him with me as I was still groggy from the meds and they needed to make sure he didn't choke on the mucus in his lungs. They did bring him back a couple times to feed but they had problems waking me up so finally they stopped and gave him formula. Not what I wanted but better than him starving.





Then he needed more milk than what I could produce as well as being tongue tied so he didn't latch well. We wound up supplementing with formula because I never want to hear that kind of cry coming from my son ever again!





I didn't get an infection but my staples didn't hold very well. I popped 4 of them before leaving the hospital 3 days later and went home held together with steri-strips. When the doctor went to take my staples out 8 days later I had just started to close from the inside out instead of top down like you are supposed to. I was put on almost bed rest for the next two weeks to let it heal. That sucked!





I also had an epidural headache for 6 days. The only way I felt better was to get up and move around but I was supposed to be laying down resting. It was a catch 22 situation that didn't help me to heal. Then life also threw a curve ball and just as the headache went away, my father in law passed away. We knew he was ill and had been hanging on just to see the baby but you are still never ready to lose someone. Bed rest went out the window again as hubby was gone arranging funeral and tying up the last details so I was alone with the baby again.





What did I learn? Ask for help! Accept it when offered! Since I will likely have to do a c-section for the next delivery as well (turns out I have damage to pelvic and spine I was unaware of due to a motorcycle accident many years ago) I will be better prepared. I will have someone to spend a week or so with me and then get in a teenager as a mother's helper during the day for the next few weeks. Hopefully hubby won't be working steady nights anymore either. I slept on the couch for the first 4 weeks because I could roll off of it easier than I could the bed.





Even though a lot of my first experiences sucked, I have a beautiful 6 week old baby boy and I am feeling human again. The incision has almost healed, the baby is healthy and hubby managed to work his schedule to get 7 days off in a row so things are getting much easier. Although if I hear Braham's lullaby too many more times I will not be held responsible for the mobile you may see flying past your window (and I'm in Canada LOL).
Reply:With my first child, I had a C-section. I had high blood pressure and the doctor admitted to the hospital after my dr.'s appt. I was in the hospital for 10 hrs before they induced labor. I was in labor for 15 hrs and never felt the urge to push. finally, at 2 am, the dr said that I had to have a C-section because my baby was in trouble. I was awake for the surgery. They showed me my baby and then I was whisked away to recovery for over 1 hr. I saw my child again later, and I had to ask to see her. I had to stay in the hospital for 4 days because I was still having some medical problems. So, I understand what you went through. But thank goodness you're alright.
Reply:well, it sounds like you had a bad experience. If you were not dialating then they did right. But they didn't inform you very well of what was going on and was not very nice as for you were having your first baby. So, you can't chance anything now but when you go to have another one if you do, make sure they know what happened the first time and you want that to never happen again. good luck and wish you the best


C++ for Linux, Mac and Windows?

Im currently using Bloodshed Dev-C++ to do C++ Computer programming but it only seems to do Windows projects so is it possible in Dev-C++ to do app's for linux or mac?


If so how?


Also is the C++ code the same for linux as it is for windows?

C++ for Linux, Mac and Windows?
%26gt; "Im currently using Bloodshed Dev-C++ to do C++ Computer programming but it only seems to do Windows projects"


Dev-C++ is an IDE. The compiler it uses is MinGW. MinGW is a windows port of gcc. gcc is a compiler that runs on Linux, among other systems. MinGW targets windows only.





%26gt; "so is it possible in Dev-C++ to do app's for linux or mac?"


The topic you want to look at is cross compiling. No, this is not a one paragraph topic. Please Google and read. Good luck on not getting intimidated.





%26gt; "Also is the C++ code the same for linux as it is for windows?"


Sort of. C++ itself is a portable language, so if you stick to standard C++ and the standard library, you're fine. However, that only happens for trivial programs. Most likely, you will start relying on OS specific capabilities, in which case your code isn't just going to run from one machine to other. You'll have to port it.
Reply:Not sure if you can use dev-C++ for linux or mac projects, but the code is the same, its just different compilers picking up different errors etc. I think if you do it on linux it should work on Mac, windows is the only odd OS out there
Reply:As long your code uses ANSI C++, you don't need to worry about portability; however, this is tricky even when using ANSI C++! For instance the function "system" under the c header file stdlib parses an OS shell command to execute through C++; when typing system("cls"); under windows it will clear the dos screen, but "cls" doesn't exist in Linux; instead, "clear" will clear the terminal screen under Linux! C++ doesn't care and it parses the string parameter passed to the system function; syntax-wise, it accepts any string inside it, but when it comes to execution, you won't get the result you expected because there are certain OS considerations.


Any way, Borland released two years ago "Borland C++ BuilderX" which is a cross-plattform C++ Compiler; you chose the target Operating system for your project and the compiler will generate a compatible code for that target OS; it's a wounderful release, but after the release Borland Studio 2006 it has been removed! Perhaps now in the new release "CodeGear" this support is back; I'm not sure, so check it out, but i'm quite sure you'll find what you want under "Borland C++ BuilderX" though it's not easy to find for download.
Reply:Try here for info


http://www.techtutorials.net/





http://www.theeldergeek.com/
Reply:If you want to develop linux applications you must install Linux and compile the application again. Same for Mac's. and any other operating system. A compiler is specific to an operating system. Java managed to do this though but Java isn't a compiler. It's an interpreter, meaning it translates the code to a virtual machine which needs to be installed on that operating system, and through this virtual machine the program will run.
Reply:It will be the same as long as you stick to ISO-compliant C++, not platform-dependent extensions of the language.


Find Angle C?

A plane flies from city A to city B, a distance of 150 miles and then turns through an angle 40 degrees and heads toward city C, a distance of 169 miles. Through what angle C should the pilot turn at city C (which is angle C) to return to city A?





NOTE: The distance from city A to city C = 300 miles.

Find Angle C?
The plane's movement forms a triangle ABC. AB = 150, BC = 169, AC = 300 as given.





You know the angle %26lt;ABC is 140 degrees (as the plane turned 40 degrees from a straight angle to go to C). Therefore, it's simple use of the Sine Rule to find the angle %26lt;BCA.





Sin140/300 = SinX/150


SinX = (Sin140)/2...


I don't have a calculator, but 360-X should give you the angle you need, according to my diagram. (The angle X is the acute angle %26lt;BCA but realistically the plane would have to turn through the larger angle.)


Can't turn A/C on (or off)....help!!?

Nothing like having A/C problems in the dead of summer. I have a Samsung AW1480A air conditioner. It's 5 years old and has worked great up until yesterday. Although the A/C came with a remote - I never use it...i only use the control panel on the A/C. The A/C wouldn't turn on! I plugged something else into the outlet to check that the outlet was working fine (it was)...I plugged the A/C back in - and it beeped. I pressed the power button a few times %26amp; finally it did turn on. This morning when I went to shut it off before going to work, the power button wouldn't respond. I couldn't shut it off! I finally shut it off by just unplugging it (probably not good for the A/C, I know). When I got home from work today, I plugged it back in - heard the beep - but I couldn't get it going. I did find that the only 2 buttons that work are the Timer button %26amp; the button that makes the thermostat go up - so - I can get the A/C to turn on %26amp; off by using the Timer button....

Can't turn A/C on (or off)....help!!?
Sounds like the control board/touchpad is faulty. Having someone replace could be very expensive. Doing it yourself can still be expensive. Life expectancy for an in wall or in window A/C unit is 8-10 years. You would be better off purchasing a Fedders or GE unit. If you choose not to replace the unit with a new one, who is to say that the compressor wont give next, and those are more expensive than the control board in many cases. Anyways good luck in what you do. If you decide to purchase new, Home Depot or lowes are a nice choice, but I would steer closer to a home appliance store personallyl.
Reply:Five years old? I believe it is checking out. If not immediately, then soon. Look for sales because August, as you know, is a killer. The way things are manufactured today five years is pretty good. I have a GE that's 3 years old and showing signs of age.
Reply:Its a bad computer/controll pad. You should be able to change it yourself if you can find the part.....Companies are suppose to keep parts around for ten years, doesnt mean they always do though.





Its more than likely either a bad button or two, fried conections somewhere on the board, or a bad relay. All of which would require a new computer/controll pad board. Good luck in finding the part.

nil