资源简介
C#实现的学分绩点计算器的代码和可运行文件.rar,对大学生们很有用呀呵呵

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
namespace 西南石油大学_学分绩点计算器
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(“西南石油大学--学分绩点计算器“);
Console.WriteLine();
Term thisTerm = new Term();
int NumOfCourses = GetInput.CourseNum();//本学期课程数
for(int i=1;i<=NumOfCourses;i++)
{
Console.WriteLine();
Console.WriteLine(“--------------开始录入第{0}门课程--------------“i);
Console.WriteLine(“第{0}门课程有几个学分?“i);
double credit = GetInput.GetCredit();
Console.WriteLine(“第{0}门课程考了多少分?“ i);
double score = GetInput.GetCredit();
Course OneCourse = new Course(creditscore);
thisTerm.AddOneCourse(OneCourse);
Console.WriteLine(“--------------第{0}门课程录入完毕--------------“ i);
Console.WriteLine();
}
Console.WriteLine(“最后学分绩点是:“+thisTerm.GetFinalJIDIAN());
Console.WriteLine(“欢迎访问我的博客:http://blog.csdn.net/cuipengfei1“);
Console.Read();
System.Diagnostics.Process.Start(“http://blog.csdn.net/cuipengfei1“);
}
}
class GetInput
{
public static int CourseNum()
{
Console.WriteLine(“本学期一共有几门必修课程?(注意,是必修课程哦)“);
string num= Console.ReadLine();
int NUM;
int.TryParse(numout NUM);
return NUM;
}
public static double GetCredit()
{
string credit = Console.ReadLine();
double CREDIT;
double.TryParse(creditout CREDIT);
return CREDIT;
}
}
class Course//一门课程
{
private double credit;//学分
private double score;//分数
public double Credit//学分
{
get { return credit; }
set { credit = value; }
}
public double Score//分数
{
get { return score; }
set { score = value; }
}
public Course(double _creditdouble _score)//构造
{
credit = _credit;
score = _score;
}
public double GetJIDIAN() //本门绩点
{
double jidian;
jidian = ((score - 60) / 10) + 1;
return jidian;
}
}
class Term //本学期
{
List AllCourse = new List();
public void AddOneCourse(Course course)
{
AllCourse.Add(course);
}
public double GetFinalJIDIAN()
{
double totalCredit=0;
double totalJIDIAN=0;
foreach (Course oneCourse in AllCourse)
{
totalCredit += oneCourse.Credit;
totalJIDIAN +=
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6656 2009-01-16 20:38 学分绩点计算器(可运行的程序).exe
文件 3389 2009-01-16 20:38 Program(源代码,可以用任何文本编辑器打开).cs
----------- --------- ---------- ----- ----
10045 2
相关资源
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
- C#左侧导航菜单(动态生成)
评论
共有 条评论