Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 编写信用评分程序。Can';我不知道如何使我的int值起作用_C# - Fatal编程技术网

C# 编写信用评分程序。Can';我不知道如何使我的int值起作用

C# 编写信用评分程序。Can';我不知道如何使我的int值起作用,c#,C#,我正试图写一个程序,输入信用卡分数,并最终将其平均。值必须在300-800之间,我使用int作为我的CreditScore。我知道问题是,每次尝试输入值时,当值超出范围时,就会收到我创建的错误消息。然而,我不知道如何解决这个问题,因为我显然不能将int设置为300和800,因为在这两者之间仍然有大量的数字。我是C#的新手,希望能得到任何帮助 using System; using System.Collections.Generic; using System.Linq; using Syste

我正试图写一个程序,输入信用卡分数,并最终将其平均。值必须在300-800之间,我使用int作为我的CreditScore。我知道问题是,每次尝试输入值时,当值超出范围时,就会收到我创建的错误消息。然而,我不知道如何解决这个问题,因为我显然不能将int设置为300和800,因为在这两者之间仍然有大量的数字。我是C#的新手,希望能得到任何帮助

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CreditScores
{
    class Program
    {//Joshua Belcher
        static void Main(string[] args)
        {
            int CreditScore = 0;
            Console.WriteLine("Please enter a Credit Score");
            CreditScore = Convert.ToInt32(Console.ReadLine());

            if ((CreditScore <= 300) && (CreditScore >= 800))
            {
                Console.WriteLine("Continue");
            }
            else
            {
                Console.WriteLine("Error, value not accepted");
            }

            Console.ReadLine();
        }
    }
}
使用系统;
使用System.Collections.Generic;
使用System.Linq;
使用系统文本;
使用System.Threading.Tasks;
命名空间信用分数
{
班级计划
{//Joshua Belcher
静态void Main(字符串[]参数)
{
积分积分=0;
Console.WriteLine(“请输入信用分数”);
CreditScore=Convert.ToInt32(Console.ReadLine());
如果((信用评分=800))
{
控制台。写入线(“继续”);
}
其他的
{
Console.WriteLine(“错误,不接受值”);
}
Console.ReadLine();
}
}
}
如果((信用评分=800))
任何数字怎么可能小于或等于300,同时又大于或等于800

你把你的标志弄混了

if ((CreditScore >= 300) && (CreditScore <= 800))
if((CreditScore>=300)和&(CreditScore
if((CreditScore=800))
任何数字怎么可能小于或等于300,同时又大于或等于800

你把你的标志弄混了

if ((CreditScore >= 300) && (CreditScore <= 800))

如果((CreditScore>=300)和((CreditScore信用修复)本质上暗示了质疑信用报告中可能出现的错误和失误的方法。如果您认为报告中出现的内容不正确,您可以请求[信用机构确认].

信用修复本质上是指质疑信用报告中可能出现的错误和失误的方法。如果您认为报告中出现的内容不正确,您可以请求[信用机构确认].

你已经颠倒了你的条件…如果条件永远不可能是真的。大声读给自己听。你已经颠倒了你的条件…如果条件永远不可能是真的。大声读给自己听。@laxplayerj93这就是为什么我喜欢把这种比较写成
300@laxplayerj93这就是为什么我喜欢把这种比较写成
300