![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2008
Posts: 9
Rep Power: 0
![]() |
New to c programming...don't know where to start
I am new to c programming and I cannot understand the teacher for the life of me. It becomes very difficult to learn this stuff even just by reading. I have this assignment that is due on Tuesday and I was wondering if anybody could help me out. I'd greatly appreciate it...
1. The program asks for the user to input the magnitudes and angles for two vectors, A and B. It then calculates the resultant vector (R) by summing the X- and Y-components of the two vectors, and prints the magnitudes, and angles (with respect to X-axis) of the vectors A, B, and R. 2. The program asks for the user to input the source voltage, E, and resistance of three resistors, R1, R2, R3. If then calculates the equivalent resistance R_equiv, the current, 1, and the power consumed by the circuit, P. Where do I even begin? |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 197
Rep Power: 2
![]() |
Re: New to c programming...don't know where to start
Do your own homework.
__________________
SYNTAX ERROR ... |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Nov 2007
Posts: 33
Rep Power: 0
![]() |
Re: New to c programming...don't know where to start
- print the prompts for the questions you want to ask
- read the responses from the user - print the responses back to the user. Ensuring that you can perform the initial "Q&A" session with the user, and can read their inputs correctly is a useful first step. As for the calculations, you need a math reference which explains vector addition and an electronics reference which explains how resistance works. Immediately, a further question then becomes as to how the 3 resistors are wired (in series or in parallel).
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. |
|
|
|
|
|
#4 |
|
The Oblivious One
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4
![]() |
Re: New to c programming...don't know where to start
My first question would be what the specific problem is.
Do you understand the math required for each assignment (in which case only the programming is the problem)? If so, write out some pseudo-code for each assignment. At that point, we'll help you convert it to code. Here's an example of "pseudo-code", it describes what's to be done: for x : 1 to 10
read an integer
print the integer
end
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS! |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Nov 2007
Location: Ireland
Posts: 19
Rep Power: 0
![]() |
Re: New to c programming...don't know where to start
1. See converting from polar to cartesian and from cartesian to polar.
2. See resistors in series or parallel formula, Ohm's law and P = VI. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| i want to start programming in c++ | pif13 | C++ | 24 | Dec 27th, 2005 10:28 PM |
| Does Programming Make You Smarter? | Sane | Coder's Corner Lounge | 43 | Oct 2nd, 2005 6:12 AM |
| new to the world of programming. where do i start? | puglover | Coder's Corner Lounge | 20 | Jul 8th, 2005 3:48 AM |
| im looking to start a programming team | Brent | Coder's Corner Lounge | 13 | Jun 7th, 2005 2:33 AM |