גשר ויטסטון – הבדלי גרסאות

תוכן שנמחק תוכן שנוסף
אין תקציר עריכה
שורה 16:
 
{{קצרמר|פיזיקה}}
 
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("How many steps did Tali step in a straight direction? "); //מספר הצעדים שטלי צעדה בקו ישר
double straight = in.nextDouble();
System.out.println("How many steps did Tali step after the right turn? "); // מספר הצעדים שטלי צעדה אחרי שפנתה ימינה
double right = in.nextDouble();
right *=0.42;
straight *=0.42;
double ropelength = Math.pow(right,2) + Math.pow(straight,2);
ropelength = Math.sqrt(ropelength)*2;
System.out.println("rope lengh is: " + ropelength +" M");
}
}
[[קטגוריה:מעגלים חשמליים]]
[[קטגוריה:הממלכה המאוחדת: המצאות]]