You are required to develop a GPA Calculator software application to keep track of the grades obtained by a student for the modules he is taking. The application will allow the student to key in the module name, module code, module credit and his grade for that module. This app will store all these information into a text file. The student may also use the application to retrieve all his modules' information and display them out. Lastly, the app must be able to calculate and display the student's GPA.
a. Design the software by using pseudo code.b. Implement the software by using C#.c. Document test cases for your program.
 
我们刚开学俩月, 几乎没学什么。我想问大侠们, 怎么生成那个text文件啊,还有我都要看什么资料才能把这个程序做出来啊?小弟感激不尽!!!
谢谢!

解决方案 »

  1.   

    定一个个类,实例化,然后把相关属性,写到流,用FileStream,或者用序列化也可以
      

  2.   

    很简单题目/// <summary>
            /// 记录日志
            /// </summary>
            /// <param name="GetLogPath">保存路径</param>
            /// <param name="GetWritedetails">日记内容</param>
            public static void WriteLog(string GetLogPath,string GetWritedetails,bool Keytime)
            {
                try
                {
                    if (Keytime)
                    {
                        GetWritedetails = String.Format("[{0:yyyy-MM-dd HH:mm:ss}] {1}", DateTime.Now, GetWritedetails);
                    }
                    GetLogPath += String.Format("_{0:yyyyMMddHHmmss}.txt", DateTime.Now);
                    FileStream fs = new FileStream(GetLogPath, FileMode.Append);
                    StreamWriter streamWriter = new StreamWriter(fs);
                    streamWriter.BaseStream.Seek(0, SeekOrigin.End);
                    streamWriter.WriteLine(GetWritedetails);
                    streamWriter.Flush();
                    streamWriter.Close();
                }
                catch
                {
                }        }
      

  3.   

    System.IO.StreamWriter sw=File.CreateText(@"D:\123\a.txt");
      

  4.   

    GPA计算的程序?
    貌似我以前在哪里看到过……