不同角度的循环方程? [英] Looping equations for different angles?

查看:96
本文介绍了不同角度的循环方程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我是这个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 variable a (in outer scope) with the a defined in the for loop. In order to make the compiler happy, you could, for instance, name the outer scope variable input_angle.


Thanks Guys!


这篇关于不同角度的循环方程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆