不同角度的循环方程? [英] Looping equations for different angles?
问题描述
大家好,
我是这个c#business的新手刚开始上大学的模块。
试图弄清楚如何在循环中运行方程式,改变一个值(在这种情况下为角度)并在Colum中打印不同的值。
它需要以(7.5度<= 90,增量为7.5)的增量来增加;
其他每个值都是常数。
任何帮助非常感谢!
目标:
http://img703.imageshack.us/img703/2954/ge3s.jpg [ ^ ]
我的尝试:
http://img12.imageshack。 us / img12 / 5664 / jz4c.jpg [ ^ ]
for (< span class =code-keyword> double increment = 7 。 5 ; increment < = 90 。 0 ;增量+ = 7 。 5 )
{
// 您的代码在这里
}
编译器消息很明确:您将使用 a $'遮蔽'(隐藏)已定义的变量 a
(在外部范围内) c $ c>在中为
循环定义。为了使编译器满意,例如,您可以将外部范围变量命名为 input_angle
。
谢谢大家!
Hi all,
I'm a newb to this c# business just started a module in college.
Trying to figure out how to run equations in a loop changing one value (Angle in this case) and printing the different values in a Colum.
It needs to ride in increments from( 7.5 degrees <=90 in increment's of 7.5 );
Every other value is constant.
Any help much appreciated!
Objective:
http://img703.imageshack.us/img703/2954/ge3s.jpg[^]
My attempt:
http://img12.imageshack.us/img12/5664/jz4c.jpg[^]
for (double increment = 7.5; increment <= 90.0; increment += 7.5) { // your code goes here }
The compiler message is clear: you would 'shadowing' (hiding) the already defined variablea
(in outer scope) with thea
defined in thefor
loop. In order to make the compiler happy, you could, for instance, name the outer scope variableinput_angle
.
Thanks Guys!
这篇关于不同角度的循环方程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!