+ 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

8th Mar 2021, 11:48 AM
Oroob Mustafa
Oroob Mustafa - avatar
13 Antworten
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; }
8th Mar 2021, 1:59 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
+ 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.
8th Mar 2021, 4:03 PM
Lothar
Lothar - avatar
+ 3
Maybe you should use Ohm's law? R=U/I
8th Mar 2021, 12:44 PM
Michal Doruch
+ 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
8th Mar 2021, 1:48 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
+ 1
I’ll try ☺️
8th Mar 2021, 10:01 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
8th Mar 2021, 1:11 PM
Oroob Mustafa
Oroob Mustafa - avatar
0
؟؟؟
8th Mar 2021, 1:52 PM
Oroob Mustafa
Oroob Mustafa - avatar
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 🙄
8th Mar 2021, 5:34 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
0
Wedad Saleh How can I contact you, if necessary? Do you have Messenger Please 🙏🙏🙏
8th Mar 2021, 7:27 PM
Oroob Mustafa
Oroob Mustafa - avatar
0
Oroob Mustafa try to reach level 3 then you can send DM , Sorry I can’t post my contact details here.
8th Mar 2021, 9:55 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
0
Wedad Saleh ok thanks, can you help me in C++ code problem at any time 😭
8th Mar 2021, 9:58 PM
Oroob Mustafa
Oroob Mustafa - avatar
0
Thank you 🙏🙏🙏🙏😍😍😍😍😍
8th Mar 2021, 10:02 PM
Oroob Mustafa
Oroob Mustafa - avatar
0
you are welcome☺️
8th Mar 2021, 10:04 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar