A student wants to measure resistance in C++ code | Sololearn: Learn to code for FREE!

+2

A student wants to measure resistance in C++ code

Voltage (V): 100, 90, 80, 70, 60, 50, 40, 30, 20,7. Current (A): 11, 8, 7, 6, 5.7,5, 3.9, 2.3, 2.1, 1.1 Find resistance

c++

3/8/2021 11:48:59 AM

Oroob Mustafa

13 Answers

New Answer

0

#include <iostream> using namespace std; int main() { float V[10]={100, 90, 80, 70, 60, 50, 40, 30, 20,7}; float A[10]={11, 8, 7, 6, 5.7,5, 3.9, 2.3, 2.1, 1.1}; for (int i=0; i<10; i ) { float R= V[i]/A[i]; cout << R << endl; } return 0; }

+13

i don't think that giving an op a ready to use code does really help him in developing his coding knowledge and problem solving ability. better try to give hints or a description that guides the op in the right direction. thanks! the op has not started the c++ tutorial, so i assume he will hardly understand what the code is doing.

+3

Maybe you should use Ohm's law? R=U/I

+1

Oroob Mustafa first declare an array for V and an array for A then use for loop and get r by dividing each element from V and A like V[1]/A[1] I sent DM check it

+1

I’ll try ☺️

0

Wedad Saleh

0

؟؟؟

0

Lothar I know she started cpp tutorial but this is her new account which you saw , and I know that giving a ready code does not really help but she remembered me do want me to let her down πŸ™„

0

Wedad Saleh How can I contact you, if necessary? Do you have Messenger Please πŸ™πŸ™πŸ™

0

Oroob Mustafa try to reach level 3 then you can send DM , Sorry I can’t post my contact details here.

0

Wedad Saleh ok thanks, can you help me in C++ code problem at any time 😭

0

Thank you πŸ™πŸ™πŸ™πŸ™πŸ˜πŸ˜πŸ˜πŸ˜πŸ˜

0

you are welcome☺️