Computer Science: A Structured Programming Approach Using C++This book, in the words of the authors, "teaches students first how to write good functions, and then how to implement them in classes." Designed for students with no prior programming experience, the book explains each basic principle of programming first in general, language-independent terms, and then discusses how the programming construct in question is implemented in C++. Given this approach, classes are presented in the second half of the text. The book incorporates coverage of software engineering principles and procedures throughout (starting with flowcharts), with each chapter concluding with a discussion of underlying software engineering concepts. Unlike competing books that are too difficult for first-year students, Forouzan and Gilberg take special pains to make their programming examples consistent and easy to read. This careful writing makes this book a solid choice for professors looking for a book that is easy to read and follow, without compromising the material's rigor. |
From inside the book
Results 1-3 of 22
Page 193
... grade for a score . the parameter score 28 29 Pre 30 Post Returns the grade 31 * / 32 char scoreToGrade ( int score ) 33 { 34 // Local Declarations 35 char grade ; 36 37 int temp ; 38 40 41 42 { 43 44 39 // Statements temp = score / 10 ...
... grade for a score . the parameter score 28 29 Pre 30 Post Returns the grade 31 * / 32 char scoreToGrade ( int score ) 33 { 34 // Local Declarations 35 char grade ; 36 37 int temp ; 38 40 41 42 { 43 44 39 // Statements temp = score / 10 ...
Page 195
... grade ; 17 18 // Statements 19 20 21 22 23 24 25 cout << " \ nEnter the test score ( 0-100 ) : " ; cin >> score ; grade = scoreToGrade ( score ) ; " cout << " The grade is : << grade << endl ; return 0 ; 26 } // main scoreToGrade This ...
... grade ; 17 18 // Statements 19 20 21 22 23 24 25 cout << " \ nEnter the test score ( 0-100 ) : " ; cin >> score ; grade = scoreToGrade ( score ) ; " cout << " The grade is : << grade << endl ; return 0 ; 26 } // main scoreToGrade This ...
Page 214
... grade . It reads three test scores ( between 0 and 100 ) and calls a function that calculates and returns a student's grade based on the following rules : a . If the average score is 90 % or more , the grade is A. b . If the average ...
... grade . It reads three test scores ( between 0 and 100 ) and calls a function that calculates and returns a student's grade based on the following rules : a . If the average score is 90 % or more , the grade is A. b . If the average ...
Other editions - View all
Common terms and phrases
algorithm assignment average binary search bubble sort calculate calling function char character column compile error concept constructor contains cout create decimal Declarations int default defined Demonstrate digits Dynamic arrays endl Enter evaluated example expression false fill character flag float floating-point flowchart fraction function call function definition getData grade header header file hexadecimal include iomanip.h include iostream.h initialize input insertion sort int main void int& integer iteration keyboard language logic Module multiply num1 num2 number of elements operand operator output pass by reference postfix problem Prototype Declarations pseudocode rand random number recursive result return statement return type score selection sort shown in Figure side effect sort algorithm Statements cout stream structure chart structured programming switch statement true two-dimensional array unsorted Write a function Write a program zero