August 1, 2002
CS 201 (Introduction to Computing)
Summer 2012
Sabancı University - Sample Questions and Solutions for Midterm
• Those questions do not imply any favorite subject or question type for the questions in the actual exam
• Please also review recitation questions, samples covered in the class, homeworks and the questions in the book as well
• The amount of questions here is of course much more than the actual exam.
QUESTIONS
1) Write a function that takes an integer type of parameter and returns its reciprocal. If the parameter is zero, then the function should return 0.
In the main program, first input two integer values. Then find the sum of the reciprocals of all of the numbers between these two inputs. In the main program, you have to use the reciprocal function.
#include
using namespace std;
double reciprocal(int number)
{
if(number == 0)
return 0;
else
return (1.0/number);
}
int main()
{
int start,end;
cout > start >> end;
double sum = 0;
if (start > end)
cout ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- 2002 ford 5.4 engine diagram
- 2002 ford 5 4 engine diagram
- 2002 ford f150 engine diagram
- 2002 ford 5 4 engine specs
- 2002 5 4 ford engine problems
- 2002 f150 5 4 engine
- 2002 f150 4 2 engine diagram
- historical events 2002 to 2015
- 2002 ford f150 5 4 engine
- 2002 events in america
- auto loan for 2002 vehicle
- 2002 ford ranger 5 0 swap