All pastes #2101969 Raw Edit

Untitled

public text v1 · immutable
#2101969 ·published 2012-01-10 19:01 UTC
rendered paste body
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kapitel6_3
{
    class Program
    {
        public static double Gesamtwiderstand(int R1, int R2, int R3, int R4, int R5)
        {
            double gesamtwiderstand;
            gesamtwiderstand = ((((R5 + R4) * R3) / (R5 + R4 + R3)) * (R1 + R2)) / ((((R5 + R4) * R3) / (R5 + R4 + R3)) + R1 + R2);
            return gesamtwiderstand;
        }

        public static double Strom1(double gesamtwiderstand, int U)
        {
            double strom1;
            strom1 = U / gesamtwiderstand;
            return strom1;
        }
        public static double Strom2(int U, int R1, int R2, int R3, double strom1)
        {
            double UR3, strom2;
            UR3 = U - R1 * strom1 - R2 * strom1;
            strom2 = R3 / UR3;
            return strom2;        
        }
        public static double Strom3(double strom2, double strom1)
        {
            double strom3;
            strom3 = strom1 - strom2;
            return strom3;            
        }

        static void Main(string[] args)
        {
            int R1 = 30, R2 = 10, R3 = 20, R4 = 20, R5 = 10;
            int U = 20;
            Console.WriteLine("R1 = " + R1 + ", R2 = " + R2 + ", R3 = " + R3 + ", R4 = " + R4 + ", R5 = " + R5 + "");
            Console.WriteLine("U = " + U + "");
            Console.WriteLine("Strom1 = " + Strom1(gesamtwiderstand, U) + "");
            //Console.WriteLine("Strom2 = " + Strom2(U, R1, R2, R3, Strom1(gesamtwiderstand, U)) + "");
            //Console.WriteLine(" Strom3 = " + Strom3(Strom1(gesamtwiderstand, U), Strom2(U, R1, R2, R3, Strom1(gesamtwiderstand, U)) ) + " ");
            Console.Read();

        }
    }
}