Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 27th, 2008, 4:39 AM   #1
WalterSlopeboi
Newbie
 
Join Date: Jan 2008
Posts: 9
Rep Power: 0 WalterSlopeboi is on a distinguished road
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?
WalterSlopeboi is offline   Reply With Quote
Old Jan 27th, 2008, 5:53 AM   #2
Grich
Hobbyist Programmer
 
Grich's Avatar
 
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 192
Rep Power: 2 Grich is on a distinguished road
Re: New to c programming...don't know where to start

Do your own homework.
__________________
SYNTAX ERROR ...
Grich is offline   Reply With Quote
Old Jan 27th, 2008, 5:54 AM   #3
Salem
Programmer
 
Join Date: Nov 2007
Posts: 33
Rep Power: 0 Salem is on a distinguished road
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.
Salem is offline   Reply With Quote
Old Jan 27th, 2008, 9:23 AM   #4
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
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!
Jessehk is offline   Reply With Quote
Old Jan 27th, 2008, 10:12 AM   #5
colin mac
Newbie
 
Join Date: Nov 2007
Location: Ireland
Posts: 19
Rep Power: 0 colin mac is on a distinguished road
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.
colin mac is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:42 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC