15,922,155 members
Home / Discussions / C / C++ / MFC

# C / C++ / MFC

 Re: voltage CPallini22-Mar-09 7:29 CPallini 22-Mar-09 7:29
 Re: voltage Yusuf22-Mar-09 7:59 Yusuf 22-Mar-09 7:59
 Re: voltage brains8922-Mar-09 8:02 brains89 22-Mar-09 8:02
 Re: voltage Yusuf22-Mar-09 13:28 Yusuf 22-Mar-09 13:28
 Re: voltage CPallini22-Mar-09 22:12 CPallini 22-Mar-09 22:12
 Re: voltage Yusuf23-Mar-09 3:11 Yusuf 23-Mar-09 3:11
 Re: voltage CPallini23-Mar-09 3:17 CPallini 23-Mar-09 3:17
 Re: voltage Iain Clarke, Warrior Programmer22-Mar-09 10:07 Iain Clarke, Warrior Programmer 22-Mar-09 10:07
 Having the sample count already specified implies this is a homework question, but I'll try to give as many hints as I can without ruining it for your learning... 1/ To start with, this isn't a C specific question, but there's nothing stopping you doing this in C. You could do it in fortran, c#; heck, I'd probably recommend using excel... 2/ Your initial problem is solving the equation on pen and paper. (Yes, I know you have a thing that varies - remember your algebra) volts = current * resistance power = current * volts current = volts / resistance. I'd suggest excel to start with, or a simple MFC dialog application with a box you type in a user supplied resistance value, and then spit out the results you care about to test your equation. 4/ Now move on to the second part of the question, the varying resistor. 4a/ What is the probability curve? Even if you assume it's flat, you should document that assumption. Why is it varying? If it's a toddler playing with a knob, it may be a guaussing distribution. The point is that it's not specified, so you either have to ask, or at least spell out your assumption. 4b/ Look up Monte Carlo Simulation - I bet it's what you've been taught. Run your function 100000 times with a random number between 200 and 600 and pop the results into a huge table. 4c/ Whether you write them to a text file, and import that into excel, or add a pretty graphic control (we have them here on CP) is up to you. Good luck, Iain. In the process of moving to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
 How to remove a underscore character from my string pandit8422-Mar-09 5:56 pandit84 22-Mar-09 5:56
 Re: How to remove a underscore character from my string Yusuf22-Mar-09 6:07 Yusuf 22-Mar-09 6:07
 Re: How to remove a underscore character from my string Rajesh R Subramanian22-Mar-09 6:08 Rajesh R Subramanian 22-Mar-09 6:08
 Re: How to remove a underscore character from my string CPallini22-Mar-09 7:34 CPallini 22-Mar-09 7:34
 An 'If' statement before my char declaration is not allowing my program to compile......why? Endomlic22-Mar-09 5:06 Endomlic 22-Mar-09 5:06
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Rajesh R Subramanian22-Mar-09 5:18 Rajesh R Subramanian 22-Mar-09 5:18
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Endomlic22-Mar-09 5:23 Endomlic 22-Mar-09 5:23
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Rajesh R Subramanian22-Mar-09 5:32 Rajesh R Subramanian 22-Mar-09 5:32
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Eytukan22-Mar-09 5:21 Eytukan 22-Mar-09 5:21
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Rajesh R Subramanian22-Mar-09 5:28 Rajesh R Subramanian 22-Mar-09 5:28
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Eytukan22-Mar-09 5:34 Eytukan 22-Mar-09 5:34
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Endomlic22-Mar-09 5:36 Endomlic 22-Mar-09 5:36
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Eytukan22-Mar-09 5:38 Eytukan 22-Mar-09 5:38
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Endomlic22-Mar-09 5:41 Endomlic 22-Mar-09 5:41
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Eytukan22-Mar-09 5:59 Eytukan 22-Mar-09 5:59
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Rajesh R Subramanian22-Mar-09 5:40 Rajesh R Subramanian 22-Mar-09 5:40
 Re: An 'If' statement before my char declaration is not allowing my program to compile......why? Eytukan22-Mar-09 5:46 Eytukan 22-Mar-09 5:46
 Last Visit: 31-Dec-99 18:00     Last Update: 24-Jun-24 0:33 Refresh ᐊ Prev1...3324332533263327332833293330333133323333 Next ᐅ