亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gradebook.cpp

?? Cpp how to program source code
?? CPP
字號:
// Fig. 7.24: GradeBook.cpp
// Member-function definitions for class GradeBook that
// uses a two-dimensional array to store grades.
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
using std::fixed;        

#include <iomanip> // parameterized stream manipulators
using std::setprecision; // sets numeric output precision
using std::setw; // sets field width

// include definition of class GradeBook from GradeBook.h
#include "GradeBook.h"

// two-argument constructor initializes courseName and grades array
GradeBook::GradeBook( string name, const int gradesArray[][ tests ] )
{
   setCourseName( name ); // initialize courseName

   // copy grades from gradeArray to grades
   for ( int student = 0; student < students; student++ )

      for ( int test = 0; test < tests; test++ )
         grades[ student ][ test ] = gradesArray[ student ][ test ];
} // end two-argument GradeBook constructor

// function to set the course name
void GradeBook::setCourseName( string name )
{
   courseName = name; // store the course name
} // end function setCourseName

// function to retrieve the course name
string GradeBook::getCourseName()
{
   return courseName;
} // end function getCourseName

// display a welcome message to the GradeBook user
void GradeBook::displayMessage()
{
   // this statement calls getCourseName to get the 
   // name of the course this GradeBook represents
   cout << "Welcome to the grade book for\n" << getCourseName() << "!" 
      << endl;
} // end function displayMessage

// perform various operations on the data
void GradeBook::processGrades()
{
   // output grades array
   outputGrades();

   // call functions getMinimum and getMaximum
   cout << "\nLowest grade in the grade book is " << getMinimum() 
      << "\nHighest grade in the grade book is " << getMaximum() << endl;

   // output grade distribution chart of all grades on all tests
   outputBarChart();
} // end function processGrades

// find minimum grade
int GradeBook::getMinimum()
{
   int lowGrade = 100; // assume lowest grade is 100

   // loop through rows of grades array
   for ( int student = 0; student < students; student++ )
   {
      // loop through columns of current row
      for ( int test = 0; test < tests; test++ )
      {
         // if current grade less than lowGrade, assign it to lowGrade
         if ( grades[ student ][ test ] < lowGrade )
            lowGrade = grades[ student ][ test ]; // new lowest grade
      } // end inner for
   } // end outer for

   return lowGrade; // return lowest grade
} // end function getMinimum

// find maximum grade
int GradeBook::getMaximum()
{
   int highGrade = 0; // assume highest grade is 0

   // loop through rows of grades array
   for ( int student = 0; student < students; student++ )
   {
      // loop through columns of current row
      for ( int test = 0; test < tests; test++ )
      {
         // if current grade greater than lowGrade, assign it to highGrade
         if ( grades[ student ][ test ] > highGrade )
            highGrade = grades[ student ][ test ]; // new highest grade
      } // end inner for
   } // end outer for

   return highGrade; // return highest grade
} // end function getMaximum     

// determine average grade for particular set of grades
double GradeBook::getAverage( const int setOfGrades[], const int grades )
{
   int total = 0; // initialize total

   // sum grades in array
   for ( int grade = 0; grade < grades; grade++ )
      total += setOfGrades[ grade ];

   // return average of grades
   return static_cast< double >( total ) / grades;
} // end function getAverage

// output bar chart displaying grade distribution
void GradeBook::outputBarChart()
{
   cout << "\nOverall grade distribution:" << endl;

   // stores frequency of grades in each range of 10 grades
   const int frequencySize = 11;
   int frequency[ frequencySize ] = { 0 };

   // for each grade, increment the appropriate frequency
   for ( int student = 0; student < students; student++ )

      for ( int test = 0; test < tests; test++ )
         ++frequency[ grades[ student ][ test ] / 10 ];

   // for each grade frequency, print bar in chart
   for ( int count = 0; count < frequencySize; count++ ) 
   {
      // output bar label ("0-9:", ..., "90-99:", "100:" )
      if ( count == 0 )
         cout << "  0-9: ";
      else if ( count == 10 )
         cout << "  100: ";
      else
         cout << count * 10 << "-" << ( count * 10 ) + 9 << ": ";
      
      // print bar of asterisks
      for ( int stars = 0; stars < frequency[ count ]; stars++ ) 
         cout << '*';

      cout << endl; // start a new line of output
   } // end outer for
} // end function outputBarChart

// output the contents of the grades array
void GradeBook::outputGrades()
{
   cout << "\nThe grades are:\n\n";
   cout << "            "; // align column heads

   // create a column heading for each of the tests
   for ( int test = 0; test < tests; test++ )
      cout << "Test " << test + 1 << "  ";

   cout << "Average" << endl; // student average column heading

   // create rows/columns of text representing array grades
   for ( int student = 0; student < students; student++ )
   {
      cout << "Student " << setw( 2 ) << student + 1;

      // output student's grades
      for ( int test = 0; test < tests; test++ )
         cout << setw( 8 ) << grades[ student ][ test ];

      // call member function getAverage to calculate student's average;
      // pass row of grades and the value of tests as the arguments
      double average = getAverage( grades[ student ], tests );
      cout << setw( 9 ) << setprecision( 2 ) << fixed << average << endl;
   } // end outer for
} // end function outputGrades


/**************************************************************************
 * (C) Copyright 1992-2005 by Deitel & Associates, Inc. and               *
 * Pearson Education, Inc. All Rights Reserved.                           *
 *                                                                        *
 * DISCLAIMER: The authors and publisher of this book have used their     *
 * best efforts in preparing the book. These efforts include the          *
 * development, research, and testing of the theories and programs        *
 * to determine their effectiveness. The authors and publisher make       *
 * no warranty of any kind, expressed or implied, with regard to these    *
 * programs or to the documentation contained in these books. The authors *
 * and publisher shall not be liable in any event for incidental or       *
 * consequential damages in connection with, or arising out of, the       *
 * furnishing, performance, or use of these programs.                     *
 **************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人bangbros| 男人的天堂亚洲一区| 美洲天堂一区二卡三卡四卡视频| 国产成人精品一区二区三区网站观看| 91传媒视频在线播放| 精品福利视频一区二区三区| 亚洲综合久久久| 不卡av在线网| 久久精品免费在线观看| 日韩电影在线观看网站| 91国偷自产一区二区三区观看| 国产视频一区不卡| 懂色中文一区二区在线播放| 在线不卡免费av| 亚洲欧美偷拍三级| 成人激情视频网站| 久久久久国产精品厨房| 激情五月婷婷综合网| 日韩丝袜情趣美女图片| 亚洲成a天堂v人片| 欧美伊人久久久久久久久影院| 国产精品久久久久久久久久久免费看 | 久久久国产精华| 久久99最新地址| 欧美成人激情免费网| 奇米影视在线99精品| 欧美高清性hdvideosex| 午夜视频在线观看一区| 欧美午夜一区二区三区 | 中文字幕免费一区| 日本成人在线一区| 欧美一区二区在线免费播放| 亚洲国产成人高清精品| 欧美嫩在线观看| 日本中文在线一区| 日韩欧美一二区| 国模大尺度一区二区三区| 2欧美一区二区三区在线观看视频| 久久精品99国产精品| 精品久久国产字幕高潮| 国产精品白丝jk白祙喷水网站| 欧美成人欧美edvon| 国模套图日韩精品一区二区| 国产欧美日韩综合| 99re这里都是精品| 亚洲电影在线免费观看| 日韩欧美国产wwwww| 国产精品99久久久久久久女警| 日本一区二区三区视频视频| 成人v精品蜜桃久久一区| 日韩一区有码在线| 欧美二区在线观看| 国产一区二区在线观看视频| 国产精品国产成人国产三级| 色综合久久中文综合久久牛| 日韩经典一区二区| 日本一区二区三区视频视频| 色悠悠久久综合| 欧美aaaaaa午夜精品| 国产欧美综合在线| 在线精品观看国产| 精品亚洲国内自在自线福利| 国产精品久久久一本精品| 在线观看日韩高清av| 久久精品国产网站| 综合久久一区二区三区| 欧美日本在线一区| 成人性生交大片| 秋霞午夜av一区二区三区| 国产精品久久午夜夜伦鲁鲁| 欧美日韩国产综合草草| 国产永久精品大片wwwapp| 亚洲一二三区不卡| 久久精品一区八戒影视| 欧美日韩在线亚洲一区蜜芽| 国内成人精品2018免费看| 亚洲成a人片在线不卡一二三区| 国产午夜亚洲精品午夜鲁丝片| 欧美自拍丝袜亚洲| 国产一区999| 免费人成在线不卡| 亚洲精品视频免费观看| 国产亚洲欧美在线| 欧美精品三级日韩久久| 色婷婷精品大视频在线蜜桃视频 | 欧美videossexotv100| 91免费看片在线观看| 精油按摩中文字幕久久| 午夜国产精品一区| 亚洲精品一二三区| 国产精品国产三级国产三级人妇| 精品久久国产老人久久综合| 69堂国产成人免费视频| 色综合天天综合| 成人短视频下载| 国产制服丝袜一区| 麻豆高清免费国产一区| 婷婷六月综合亚洲| 亚洲一区二区三区精品在线| 综合av第一页| 亚洲丝袜精品丝袜在线| 国产精品久久久一本精品| 国产婷婷色一区二区三区| 久久影音资源网| 久久日韩精品一区二区五区| 日韩欧美一级二级| 日韩亚洲电影在线| 欧美一级xxx| 日韩欧美资源站| 欧美成人一级视频| 欧美大片一区二区三区| 日韩一区二区在线播放| 日韩一区二区三区免费看| 91精品麻豆日日躁夜夜躁| 欧美一区二区三区小说| 欧美一级xxx| 久久精品亚洲乱码伦伦中文 | 国产成人一级电影| 国产一区 二区| 国产99精品国产| 99麻豆久久久国产精品免费 | 一区二区国产盗摄色噜噜| 亚洲精品大片www| 亚洲一区二区高清| 日韩中文字幕91| 美女视频黄免费的久久| 国产曰批免费观看久久久| 国产麻豆视频精品| a在线播放不卡| 欧美午夜片在线观看| 欧美一区二区福利视频| 久久综合精品国产一区二区三区 | 91精品国产一区二区| 日韩免费观看2025年上映的电影| 精品国产第一区二区三区观看体验| 久久久久久麻豆| 日韩理论电影院| 午夜影视日本亚洲欧洲精品| 麻豆国产91在线播放| 成人18视频在线播放| 欧美专区日韩专区| 精品福利一区二区三区免费视频| 国产精品国产精品国产专区不蜜| 午夜日韩在线观看| 国产精品亚洲一区二区三区妖精| 99re热视频精品| 欧美一区二区视频在线观看2020| 久久精品人人做人人综合| 一区二区三区丝袜| 极品美女销魂一区二区三区 | 亚洲国产日韩精品| 久草热8精品视频在线观看| www.一区二区| 精品免费视频.| 亚洲综合久久久久| 粉嫩av一区二区三区在线播放| 欧美日韩第一区日日骚| 欧美激情在线看| 日韩精品亚洲一区二区三区免费| 丁香网亚洲国际| 欧美一级二级在线观看| 亚洲美女视频一区| 国产xxx精品视频大全| 欧美日韩国产高清一区二区| 日本一区二区免费在线观看视频| 亚洲成人精品一区| 成人激情午夜影院| 久久久综合九色合综国产精品| 亚洲已满18点击进入久久| 国产91丝袜在线18| 欧美大肚乱孕交hd孕妇| 一区二区三区91| av电影一区二区| 久久综合久久99| 日本中文字幕不卡| 欧美日韩免费一区二区三区视频 | 色综合久久中文综合久久97| 久久婷婷国产综合精品青草 | 午夜精品久久久久久久久久| av高清久久久| 国产欧美日韩视频在线观看| 美女网站视频久久| 欧美日韩高清在线播放| 亚洲午夜羞羞片| 在线观看免费成人| 1区2区3区国产精品| 成人午夜大片免费观看| 久久女同精品一区二区| 国内成人精品2018免费看| 日韩欧美一区二区视频| 奇米一区二区三区av| 欧美精品久久久久久久多人混战 | 亚洲天堂2016| 99re亚洲国产精品| 中文字幕在线不卡国产视频| 国产91精品精华液一区二区三区 | 久久久影视传媒| 国产精一品亚洲二区在线视频| 久久综合丝袜日本网| 国产美女在线精品|