Click here to Skip to main content
15,908,264 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help with personal project.... Pin
Christian Graus14-Mar-04 9:02
protectorChristian Graus14-Mar-04 9:02 
GeneralRe: Need help with personal project.... Pin
Jodieluv15-Mar-04 5:06
Jodieluv15-Mar-04 5:06 
GeneralRe: Need help with personal project.... Pin
l a u r e n9-Mar-04 20:15
l a u r e n9-Mar-04 20:15 
GeneralRe: Need help with personal project.... Pin
MeterMan12-Mar-04 20:44
MeterMan12-Mar-04 20:44 
GeneralNeed help with personal project.... Pin
Jodieluv9-Mar-04 15:55
Jodieluv9-Mar-04 15:55 
GeneralInteract with Windows Mediaplayer Pin
Chen Pang9-Mar-04 15:47
Chen Pang9-Mar-04 15:47 
GeneralStatic example compilation problem Pin
rmnowick9-Mar-04 15:47
rmnowick9-Mar-04 15:47 
Generalhelp with a simple program that use structure Pin
bishead9-Mar-04 15:44
bishead9-Mar-04 15:44 
I am new to program (c++)and I am having a hard time writing the code for this example. I am useing microsoft visual c++. This is a example of my problem and how do I start this project.

Write a program that calculates and displays the electrical current flowing through the circuit, the voltage across each resistor, and power dissipated by each of two resistors in a simple series circuit. The series circuit consists of a single voltage source with two resistors in series across the voltage source outputs.

The program should execute in a loop. Inside the loop ask the user to enter the source voltage. Read the value entered and assign it to an appropriately named member of a structure. Next prompt the user to enter a value for the first resistor. Assign this value to an appropriately named member of a structure. Next prompt the user to enter a value for the second resistor and assign this value to an appropriately named member of a structure. After the values are entered, display the current flowing through the series circuit (voltage/(resistorA+resistorB)), the voltage drop across each resistor, and the power dissipated by each resistor. The voltage drop across resistorA is (resistorA * voltage)/(resistorA + resistorB). The voltage drop across resistorB is (resistorB * voltage)/(resistorA + resistorB). Power can be calculated by multiplying the voltage drop across a resistor value times the current through it.

After the above information is displayed prompt the program user to enter either a Y or N. If the user enters a Y, the program should continue to loop and go through the entire cycle asking for voltage source and resistor values, performing the calculations and outputting the current, voltage drops, and power dissipated by the resistors.

Put the definition for the structure in a header file (File-New File-Header File(.h). Be sure to save the file in the project folder and add the header file to project. Use the #include “filename.h” at the top of you C++ program to attach the header file to project.


GeneralRe: help with a simple program that use structure Pin
Christian Graus9-Mar-04 17:17
protectorChristian Graus9-Mar-04 17:17 
GeneralRe: help with a simple program that use structure Pin
Prakash Nadar9-Mar-04 17:28
Prakash Nadar9-Mar-04 17:28 
GeneralRe: help with a simple program that use structure Pin
Roger Wright9-Mar-04 19:03
professionalRoger Wright9-Mar-04 19:03 
GeneralRe: help with a simple program that use structure Pin
Prakash Nadar9-Mar-04 19:07
Prakash Nadar9-Mar-04 19:07 
GeneralRe: help with a simple program that use structure Pin
Roger Wright9-Mar-04 19:26
professionalRoger Wright9-Mar-04 19:26 
GeneralRe: help with a simple program that use structure Pin
Prakash Nadar10-Mar-04 5:25
Prakash Nadar10-Mar-04 5:25 
QuestionHow to get system time to micro second? Pin
freehawk9-Mar-04 15:15
freehawk9-Mar-04 15:15 
AnswerRe: How to get system time to micro second? Pin
Anonymous9-Mar-04 15:18
Anonymous9-Mar-04 15:18 
GeneralRe: How to get system time to micro second? Pin
freehawk9-Mar-04 16:40
freehawk9-Mar-04 16:40 
GeneralCString Question. Pin
modeonetwo9-Mar-04 15:05
modeonetwo9-Mar-04 15:05 
GeneralRe: CString Question. Pin
Christian Graus9-Mar-04 15:15
protectorChristian Graus9-Mar-04 15:15 
GeneralRe: CString Question. Pin
modeonetwo9-Mar-04 15:20
modeonetwo9-Mar-04 15:20 
GeneralRe: CString Question. Pin
Christian Graus9-Mar-04 15:24
protectorChristian Graus9-Mar-04 15:24 
GeneralRe: CString Question. Pin
modeonetwo9-Mar-04 15:30
modeonetwo9-Mar-04 15:30 
GeneralRe: CString Question. Pin
Robert A. T. Káldy9-Mar-04 23:19
Robert A. T. Káldy9-Mar-04 23:19 
GeneralNoob wants organization Pin
Slaru9-Mar-04 14:39
Slaru9-Mar-04 14:39 
GeneralRe: Noob wants organization Pin
Prakash Nadar9-Mar-04 16:39
Prakash Nadar9-Mar-04 16:39 

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.