a call for C++ programers

Here you can talk about C++ And C# And Other languages programming.

a call for C++ programers

Postby s-eye » Sun Sep 16, 2007 1:28 pm


hello everyone.. i need help from any C++ coder... i tired but i got a lot of errors in th eprogram .. can someone please help me out with this program

Create an ASCII Art representation of a simple parallel or series circuit using cout and proper formatting statements, similar to the circuit shown below, with the following components:

Image




============================================================
Part II
Write a program that uses Ohms law (V = I * R, where V is the voltage in volts, I is the current in amps, and R is the resistance in Ohms) to solve a basic 3-resistors parallel or series circuit problem with a fixed DC voltage source rated at 12 VDC.

First, your program should display a brief description of its operation and then ask the user to choose either a single source 3-resistors series circuit or a parallel circuit with the same specs.

Next, program prompts the user for the resistance values R1, R2, R3 and then computes and displays the voltage values across these resistors, the currents through each, and the total current supplied by the voltage source. Finally, program will calculate the total power supplied by the voltage source using the P = V * I, and the equivalent resistance as seen by the voltage source. You should use cout and cin for the output and input, respectively. Display the results in floating point format with a field width of 10 characters, three decimal point digits, and right-justified.

Use a while and switch structure to analyze each circuit based on that circuit’s component values. Within the switch, prompt the user to enter the appropriate data your program needs to calculate the voltages, currents, and total power based on that circuit resistor values.

Sample Output:
<Brief program description goes here>

Select from the following circuit types:
1) Three-resistors Parallel Circuit
2) Three-resistors Series Circuit
3) Quit Program

Enter Your Choice: 1
Three-resistors Parallel Circuit Selected

Enter value for R1 in Ohms: 4700
Enter value for R1 in Ohms: 6800
Enter value for R1 in Ohms: 8200
------------------------------------------------
Voltage across R1 = 12 VDC
Voltage across R2 = 12 VDC
Voltage across R3 = 12 VDC

Current through R1 = 2.553 mA
Current through R2 = 1.765 mA
Current through R1 = 1.463 mA

Total power = 69.372 mW
Equivalent Resistance = 2075.765 Ω
------------------------------------------------
Would you like to do another circuit analysis? (Y/N):



thanks so much
s-eye
 
Posts: 3
Joined: Sun Sep 16, 2007 1:12 pm

Re: a call for C++ programers

Postby s-eye » Wed Sep 19, 2007 1:10 am

please please i need someone help..
s-eye
 
Posts: 3
Joined: Sun Sep 16, 2007 1:12 pm

Re: a call for C++ programers

Postby autopilot » Wed Sep 19, 2007 11:35 am

why don't you upload your project source code and then people can look at it to see if they can help you.
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Re: a call for C++ programers

Postby Chike » Wed Sep 19, 2007 5:05 pm

LOL you want us to do your homework dude? That's like cheating.
What format statments? I missed that class LOL.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: a call for C++ programers

Postby s-eye » Thu Sep 20, 2007 1:30 am

hello


i tired to make it but it gives me a lot of errors ....

i want my program to work an infinite number of times, meaning that someone can go through it over and over again. So for that you need a while loop, so this is how the logic of your program should work, while the user wants to run the program, allow them to choose one of three options, if option 1 do series circuit, if option 2 do parallel circuit, if option 3 quit the program. Then switch, case 1 do series circuit, case 2 do parallel circuit, case 3 quit program. and finally if the user chooses three, then you want the while loop to be come false.. this is the idea of the program but still so far i got many errors .... it is a project and i ask someone to hel because i found hard to me .. its a help dude

thanks
s-eye
 
Posts: 3
Joined: Sun Sep 16, 2007 1:12 pm

Re: a call for C++ programers

Postby Chike » Thu Sep 20, 2007 7:47 am

Ok, you just forgot one thing.... the source files LOL.
When you edit the post you click the "Upload attachement" below it, and add your source files, then send the post along with other info ou can give, like what kind off errors you get.
The more information you give, the more likely ppl will be able to assist you.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: a call for C++ programers

Postby Dody » Thu Jan 10, 2008 2:54 pm

I don't know if you solved your problem or not
but if you are using the 8051 siemens, then I can give you my full project
I almost done something similar some time ago (as good as I can remember :) )

though my code is a plain C with some special headers of the uVision platform

best wishes..
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm


Return to C++, C# And Others Programming

Who is online

Users browsing this forum: No registered users and 0 guests