Click here to Skip to main content
15,922,155 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: voltage Pin
CPallini22-Mar-09 7:29
mveCPallini22-Mar-09 7:29 
AnswerRe: voltage Pin
Yusuf22-Mar-09 7:59
Yusuf22-Mar-09 7:59 
GeneralRe: voltage Pin
brains8922-Mar-09 8:02
brains8922-Mar-09 8:02 
GeneralRe: voltage Pin
Yusuf22-Mar-09 13:28
Yusuf22-Mar-09 13:28 
JokeRe: voltage Pin
CPallini22-Mar-09 22:12
mveCPallini22-Mar-09 22:12 
GeneralRe: voltage Pin
Yusuf23-Mar-09 3:11
Yusuf23-Mar-09 3:11 
GeneralRe: voltage Pin
CPallini23-Mar-09 3:17
mveCPallini23-Mar-09 3:17 
AnswerRe: voltage Pin
Iain Clarke, Warrior Programmer22-Mar-09 10:07
Iain Clarke, Warrior Programmer22-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!

QuestionHow to remove a underscore character from my string Pin
pandit8422-Mar-09 5:56
pandit8422-Mar-09 5:56 
AnswerRe: How to remove a underscore character from my string Pin
Yusuf22-Mar-09 6:07
Yusuf22-Mar-09 6:07 
AnswerRe: How to remove a underscore character from my string Pin
Rajesh R Subramanian22-Mar-09 6:08
professionalRajesh R Subramanian22-Mar-09 6:08 
AnswerRe: How to remove a underscore character from my string Pin
CPallini22-Mar-09 7:34
mveCPallini22-Mar-09 7:34 
QuestionAn 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Endomlic22-Mar-09 5:06
Endomlic22-Mar-09 5:06 
AnswerRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Rajesh R Subramanian22-Mar-09 5:18
professionalRajesh R Subramanian22-Mar-09 5:18 
GeneralRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Endomlic22-Mar-09 5:23
Endomlic22-Mar-09 5:23 
AnswerRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Rajesh R Subramanian22-Mar-09 5:32
professionalRajesh R Subramanian22-Mar-09 5:32 
AnswerRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Eytukan22-Mar-09 5:21
Eytukan22-Mar-09 5:21 
GeneralRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Rajesh R Subramanian22-Mar-09 5:28
professionalRajesh R Subramanian22-Mar-09 5:28 
GeneralRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Eytukan22-Mar-09 5:34
Eytukan22-Mar-09 5:34 
GeneralRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Endomlic22-Mar-09 5:36
Endomlic22-Mar-09 5:36 
GeneralRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Eytukan22-Mar-09 5:38
Eytukan22-Mar-09 5:38 
GeneralRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Endomlic22-Mar-09 5:41
Endomlic22-Mar-09 5:41 
GeneralRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Eytukan22-Mar-09 5:59
Eytukan22-Mar-09 5:59 
JokeRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Rajesh R Subramanian22-Mar-09 5:40
professionalRajesh R Subramanian22-Mar-09 5:40 
GeneralRe: An 'If' statement before my char declaration is not allowing my program to compile......why? Pin
Eytukan22-Mar-09 5:46
Eytukan22-Mar-09 5:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.