NewGaoKaoApi/New_College.Common/Helper/MajorPlanScoreTool.cs

47 lines
1.5 KiB
C#

using Org.BouncyCastle.Asn1.Ocsp;
using System;
using System.Collections.Generic;
using System.Text;
namespace New_College.Common
{
public class MajorPlanScoreTool
{
/// <summary>
/// 冲稳保百分比
/// </summary>
/// <param name="LowScore"></param>
/// <param name="requestScore"></param>
/// <returns></returns>
public static int GetPlanPercentage(int LowScore, int requestScore)
{
int minscore = requestScore - 15;//最小
int constscore = requestScore;//中位数
int maxscore = requestScore + 15;//最大
int percentage = LowScore <= minscore ? new Random().Next(90, 99) : minscore < LowScore && LowScore <= constscore ? new Random().Next(65, 89) : LowScore > constscore && LowScore <= maxscore ? new Random().Next(30, 64) : new Random().Next(1, 29);
return percentage;
}
/// <summary>
/// 冲稳保计算
/// </summary>
/// <param name="score"></param>
/// <returns></returns>
public static int GetPlanScore(int LowScore, int requestScore)
{
int minscore = requestScore - 15;//最小
int constscore = requestScore;//中位数
int maxscore = requestScore + 15;//最大
int type = LowScore <= minscore ? 0 : minscore < LowScore && LowScore <= constscore ? 1 : LowScore > constscore && LowScore <= maxscore ? 2 : -1;
return type;
}
}
}