Thread: C++ programming HELP!

  1. #1
    Registered User
    Join Date
    Mar 2015
    Posts
    3

    C++ programming HELP!

    Hi guys im a new to computer programming. I am trying to do a question. Resistance is 10k ohms, Voltage is 10V and capacitance is 270nF a. Determine the charging voltage of the capacitor from the time the switch is moved to position 2 (t=0) to the time (t=15T), where T is the time constant of the circuit (T=RC).
    b. Select at a time step for your calculations, so that at least 25 iterations are used for the looping statement implemented in your computer program.
    c. Use looping such as for and while statement.
    d. Use conditions (if statement) wherever is required
    e. Using simple input and output statements, program’s input data may be entered from the screen and print out the output data into the screen.
    f. Use formatted output data.
    Any help would be appreciated! thanks.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,665
    You can help us, by reading this first.
    Announcements - C++ Programming

    Then make an actual effort to solve the problem, rather than just copy/pasting your assignment.

    You should be able (at least) to manage a bunch of cout and cin statements to get all the data into the program.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    141
    But this problem can be solved in closed form on a piece of paper and the result can be calculated in seconds using an engineering calculator. I suspect the teacher wants you to essentially mimic the incremental process of integration that the capacitor forms, when making a nice low pass filter. Start with the diff. EQ. that solves for the voltage across the capacitor. The input voltage is a step function. It's super easy to solve using Laplace transforms. Check to see if your simulation matches theoretical. You can do it!

  4. #4
    Registered User
    Join Date
    Mar 2015
    Posts
    3
    No need to patronise Salem I did the question ages ago. I never posted anything to forums so thought if anyone would reply. Thanks for nothing anyway Salem

  5. #5
    Registered User
    Join Date
    Mar 2015
    Posts
    3
    Thanks for your response seventhunders I figured it out last week. I did calculations and put the voltage on capacitor equation in Xcode and it worked

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by ajit90 View Post
    No need to patronise Salem I did the question ages ago. I never posted anything to forums so thought if anyone would reply. Thanks for nothing anyway Salem
    It is assumed that you read the forum rules before posting. Salem wasn't patronizing. Salem is a forum moderator, and is therefore responsible for keeping the forum's standards up. It's literally Salem's job to respond to you the way he did. You really need to learn how to Ask Questions the Smart Way, if you expect to get help from people on this forum.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 09-11-2012, 01:03 AM
  2. Replies: 4
    Last Post: 12-11-2011, 04:25 PM
  3. small programming job VCPP / Object Oriented Programming
    By calgonite in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 01-04-2006, 11:48 PM
  4. Total newb to programming here... Question about the many programming languages. Ty!
    By tsubotakid1 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 10-05-2003, 10:32 AM

Tags for this Thread