C使用vi编辑器编程:( [英] C Programming using vi editor :(

查看:60
本文介绍了C使用vi编辑器编程:(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为我的计算机科学课开设实验室,我们将编写程序(使用函数)来计算每月付款。我们还从文件中读取主要贷款,利率和付款次数,然后将此值传递给返回每月付款的函数。然后我们将每月付款写入另一个文件。在此之后我们结束了该计划。


这是我到目前为止所拥有的。我的问题是当我打开文件,看看我的程序是否写了正确的每月付款。当我阅读文件时,我看到每月付款是$ NaN。我知道这告诉我它没有收到正确的号码,而这就是NaN号码。是代表,但我的问题是为什么。有人请看一下这段代码并告诉我可能做错了什么。谢谢!

I am currently working on a lab for my computer science class, and we are to write program (using a function) to calculate the monthly payment. We also are reading the principal loan, interest rate, and number of payments from a file, and then passing this values to the function which returns the "monthly payment". Then we write the monthly payment to another file. After this we end the program.

Here is what I have so far. My problem is when I open the file to see if my program wrote the correct monthly payment. When I read the file I see "The monthly payment is $NaN". I know this is telling me that it is not receiving a correct number and that is what the "NaN" is representing, but my question is why. Someone please look at this code and tell me what I might have done wrong. Thank you!

展开 | 选择 | Wrap | 行号

推荐答案

NaN。我知道这告诉我它没有收到正确的号码,而这就是NaN号码。是代表,但我的问题是为什么。有人请看一下这段代码并告诉我可能做错了什么。谢谢!

NaN". I know this is telling me that it is not receiving a correct number and that is what the "NaN" is representing, but my question is why. Someone please look at this code and tell me what I might have done wrong. Thank you!

展开 | 选择 | Wrap | 行号



我目前正在工作在我的计算机科学课的实验室,我们将编写程序(使用函数)来计算每月付款。我们还从文件中读取主要贷款,利率和付款次数,然后将此值传递给返回每月付款的函数。然后我们将每月付款写入另一个文件。在此之后我们结束了该计划。


这是我到目前为止所拥有的。我的问题是当我打开文件,看看我的程序是否写了正确的每月付款。当我阅读文件时,我看到每月付款是
I am currently working on a lab for my computer science class, and we are to write program (using a function) to calculate the monthly payment. We also are reading the principal loan, interest rate, and number of payments from a file, and then passing this values to the function which returns the "monthly payment". Then we write the monthly payment to another file. After this we end the program.

Here is what I have so far. My problem is when I open the file to see if my program wrote the correct monthly payment. When I read the file I see "The monthly payment is


NaN。我知道这告诉我它没有收到正确的号码,而这就是NaN号码。是代表,但我的问题是为什么。有人请看一下这段代码并告诉我可能做错了什么。谢谢!

NaN". I know this is telling me that it is not receiving a correct number and that is what the "NaN" is representing, but my question is why. Someone please look at this code and tell me what I might have done wrong. Thank you!

展开 | 选择 | Wrap | 行号


这篇关于C使用vi编辑器编程:(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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