Click here to Skip to main content
14,635,966 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello I have little to no knowledge in coding, can someone help me write a very quick code in C++ that solves Ohms Law, V=I*R?

I know its super simple probably will take all of 10 minutes but I have no knowledge.

What I have tried:

I have tried to figure it out with google but have had no luck
Posted
Updated 13-Sep-20 10:58am
Rate this:
Please Sign up or sign in to vote.

Solution 1

volts = current * impedance;
There you go.
   
Comments
0x01AA 13-Sep-20 12:05pm
   
And what news you bring with that? OP allready mentioned 'V=I*R'
Rick York 13-Sep-20 12:09pm
   
It does exactly what was asked. What is YOUR problem?
0x01AA 13-Sep-20 12:12pm
   
It does _repeat_ exactly what was asked. What is YOUR problem?
Rick York 13-Sep-20 13:06pm
   
The text of the question is not valid C++ syntax and the solution is not repeating the question. What I posted is valid syntax and answers the question precisely.

MY problem is your clueless posting. Try reading the question again. It does not ask about prompting a user, reading a file, writing a GUI, or anything else.
0x01AA 13-Sep-20 13:23pm
   
"The text of the question is not valid C++ syntax"
So you expect a question needs to be ask in c++ :lol:
EOD
Rate this:
Please Sign up or sign in to vote.

Solution 2

What about Learn C++ and write that code for yourself?

Tip: you may use cin and cout for some easy input/output.
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100