Click here to Skip to main content
15,917,591 members

Comments by Ron Yehuda (Top 7 by date)

Ron Yehuda 1-Feb-21 14:21pm View    
I want to let you know that I figured it out. I set the total_resistance_denominator to be a double rather than an int but it still gave me a 0 for any number of R other than 1. Then, I cast R1 to be a double in the equation for total_resistance_denominator and I finally got it to print the correct number.

So my code now is:
double total_resistance_denominator = 1 / (double)R1
Ron Yehuda 1-Feb-21 14:13pm View    
I appreciate that, thank you.
Ron Yehuda 1-Feb-21 14:13pm View    
Thank you for the advice I didnt even notice the extra % after %d, it's honestly unfortunate that the newer VS points that out. I'm stuck using this version for the computer science class I am taking.
Ron Yehuda 1-Feb-21 2:38am View    
I'm realizing now, R1 (R2 and R3 which aren't in this code quite yet) need to be int but nothing is said about the total_resistance itself. Would it change anything if I set the that to be a double value?
Ron Yehuda 1-Feb-21 2:37am View    
I agree! Using int was a requirement for R1 from my teacher.