Yurttas/PL/OOL/Cplusplus/F/07/06/02/01/00/integrate 00.cpp

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 2003
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9
10   date   : September 1, 2003.
11   author : Salih Yurttas.
12
13   purpose : integration of f(x) = x*x*x-(2.0*x*x)+1.0;
14
15   integrate_00.cpp
16
17*/
18
19#include <iostream>
20
21using namespace std;
22
23#include "f.h"
24#include "integrate.cpp"
25
26int main(int argc, char* argv[]) {
27
28  double a,
29         b;
30
31  cout << "Please enter double values: " << endl;
32
33  cout << "-> a : ";
34  cin >> a;
35
36  cout << "-> b : ";
37  cin >> b;
38
39  cout << endl;
40
41  double integral = integrate(a,
42                              b,
43                              f());
44
45  cout << "integral of f(x) = x*x*x-(2.0*x*x)+1.0 ";
46  cout << "in between a = ";
47  cout << a;
48  cout << " and b = ";
49  cout << b;
50  cout << " is = ";
51  cout << integral;
52  cout << endl;
53
54  cout << endl;
55
56}