Beispiel #1
0
 public void PassByname()
 {
     GradeBook book = new GradeBook();
     book.Name = "Not 1";
     SetName(book);
     Assert.AreEqual("Not 1", book.Name);
 }
        static void Main(string[] args)
        {
            GradeBook g1 = new GradeBook();
            GradeBook g2 = g1;

            g1.Name = "Scott's book";
            g1 = new GradeBook();

            Console.WriteLine(g2.Name);

            int x1 = 4;
            int x2 = x1;

            x1 = 100;
            Console.WriteLine(x2);



            //GradeBook book = new GradeBook();
            //book.AddGrade(91f);
            //book.AddGrade(89.5f);
            //book.AddGrade(75f);

            //GradeStatistics stats= book.ComputeStatistics();
            //Console.WriteLine(stats.AverageGrade);
            //Console.WriteLine(stats.LowestGrade);
            //Console.WriteLine(stats.HighestGrade);

          // GradeBook book2 = new GradeBook();
          //  book2.AddGrade(76);
        }
Beispiel #3
0
        public void CalculateHighestGradeCorrectly()
        {
            GradeBook book = new GradeBook();

            book.AddGrade(90f);
            book.AddGrade(50f);

            GradeStatistics stats = book.ComputeStatistics();

            Assert.AreEqual(90f, stats.HighestGrade);
        }
Beispiel #4
0
 private void SetName(GradeBook book)
 {
     book.Name = "Not 1";
 }
 private static void AddingGrades(GradeBook book)
 {
     book.AddGrade(91);
     book.AddGrade(89.5f);
     book.AddGrade(75);
 }