0% found this document useful (0 votes)
16 views176 pages

Lecture Slides

The document provides an overview of programming concepts, focusing on the design, coding, and execution of computer programs, particularly in C++. It covers essential topics such as data types, algorithms, flowcharts, pseudocode, programming constructs, and the structure of C++ programs. Additionally, it explains programming languages' generations and includes examples of coding practices and user-defined functions.

Uploaded by

rasmoffin07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views176 pages

Lecture Slides

The document provides an overview of programming concepts, focusing on the design, coding, and execution of computer programs, particularly in C++. It covers essential topics such as data types, algorithms, flowcharts, pseudocode, programming constructs, and the structure of C++ programs. Additionally, it explains programming languages' generations and includes examples of coding practices and user-defined functions.

Uploaded by

rasmoffin07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 176

Programming I / Programming for Engineers - 2025

Electrical Engineering Department

Mechanical Engineering Department

Mining Engineering Department


lecture slides
computer programming

a process of designing and coding a computer program in order to


solve a problem / perform a specific task.
basic building blocks

data - input values to be processed by a program.

- basic data types: integer , float , character , boolean

program - a set of instructions that can be executed / run by a


computer to perform a specific task.
designing
a process of using techniques/tools to draw or write a plan or an
outline of a program to represent the execution flow of an
algorithm.

- algorithm : unambiguous finite set of step by step instructions


used to solve a problem/perform a specific task.

- techniques / tools : flowchart and pseudocode


example

a program that prompts a user to enter two integers, one by one,


in order to compute and display sum of the two numbers.
algorithm

step 1 : get 1st integer

step 2 : get 2nd integer

step 3 : compute sum (1st integer + 2nd integer)

step 4 : display sum


flowchart

a diagram that depicts the visual/graphical representation of the


execution flow of an algorithm.
drawing a flowchart

basic components/symbols basic rules

start/stop
- always have one start and one
stop.
input/output

- flowlines must not intersect.


process

- execution flow is top to bottom /


decision left to right.
example

draw flowchart for a program that prompts a user to enter two


integers, one by one, in order to compute and display the sum of
the two numbers.
start

get 1st integer

get 2nd integer

compute sum

display sum

stop
pseudocode

an outline using short phrases and mathematical notations to show


the execution flow of an algorithm without any programming
language / implementation details.
example

write pseudocode for a program that prompts a user to enter two


integers, one by one, in order to compute and display sum of the
two numbers.
read 1st integer

read 2nd integer

sum = 1st integer + 2nd integer

display sum
class exercises
write pseudocode and draw a flowchart for a program that checks if
the entered number is even or odd.

the program will then display 'number is even' if the entered


number is even or 'number is odd' if the entered number is odd.
pseudocode

read number
If ( number % 2 = 0 )

display "number is even"

else

display "number is odd"


flowchart
write pseudocode and draw a flowchart for a program that prompts
a user to enter a natural number n and then computes and
displays the sum of the first n natural numbers.
pseudocode
sum = 0
counter = 1
read n
repeat if counter <= n
sum = sum + counter
increment counter by 1
end repeat
display sum
flowchart
class task

write pseudocode and draw a flowchart for a program that


checks if the entered natural number, N, is in the range 5 – 10.

if the number is not in the range, the program will stop with an
appropriate message else the program will check if N is even or
odd.

if N is even the program will stop with an appropriate message else


the program will find which of the three odd numbers in the range
is equal to N and will stop with an appropriate message.
coding

a process of writing and testing source code using programming


(language and translator) tools.

programming Language (formal/artificial language) - a structured set


of syntactic rules (syntax/grammar) applied to write semantically
correct (semantics/meaning) program statements.

program statement – a single complete instruction for a specific


action; a program comprises blocks of statements.
example

write a program that prompts a user to enter two integers, one by


one, in order to compute and display the sum of the two numbers.

writing source code in 3GL using C++, which is a compiled


language.

programming tool used – dev c++ ide, an environment for the c++
language editor and compiler.
programming tools

programming languages program translators

5th generation language


(5GL)
compiler

high level 4th generation language


(4GL)

interpreter
3rd generation language
(3GL)

2nd generation language


(2GL)

low level assembler

1st generation language


(1GL)
(GLs)

programming language generations

generations of programming languages


1GL

−machine language.

−binary code - patterns of 0s and 1s e.g. 10011001

−lowest programming level.

−other generations have to be converted to 1GL for the computer to


execute the instructions.

−converted code is called object code.


2GL

−assembly language.

−assembler program is used to convert 2GL to machine language.

−structure is close to that of machine language.

 low level languages are machine dependent ?


3GL

−procedural / imperative language : a programmer has to specify


all the steps on how a program is to perform a specific task

−first level of the high level languages.

−structure is similar/close to that of the human natural languages.

e.g. C and C++


4GL

−non-procedural / declarative language: a programmer has to


specify what actions are to be carried out.

−structure is closer to that of the natural languages than 3GL.

e.g. SQL
5GL

?
program translators

?
writing source code / building a program
building expressions / program statements

operator vs operand ?

expression ?

program statement ?

comments - explanations of the different parts in a program that are


not executed as part of the program statements.
basic programming operators
assignment operator

is used to give/assign to a variable the value of an expression.

example

sum = number_1 + number_2 ;


arithmetic operators

6 primary operators:

• addition +

• subtraction / negation -

• division /

• modulus %

• multiplication *
increment / decrement operators

prefix form:

++i i=i+1

--i i=i-1

postfix form:

i++ i=i+1

i-- i=i-1
relational / comparison operators

a relational operator is used for comparison of two expressions/values.


• equal to ==

• not equal to !=

• less than <

• less than or equal to <=

• greater than >

• greater than or equal to >=


logical operators

a logical operator is used to create a conditional statement.

• logical AND &&

• logical OR ||

• logical NOT !
example

evaluate the following logical expression :

((!(true || !(false)) && true) || false)


programming constructs

a programming construct is used to control the execution flow of


the set of instructions (program statements) for a program in order
to produce the desired/expected/correct result based on the
program specification/design.

three basic/ general constructs:

sequence ; selection ; iteration


sequence

statements are executed in sequential order - one after the other /


one by one.

example

a program that prompts a user to enter two integers, one by one, in


order to compute and display sum of the two numbers.
selection
conditional / decision

statements are executed based on some test condition(s) being true


or false.

boolean conditions / expressions are used.

example

a program that prompts a user to enter an integer and displays


'number is even' if the entered number is even or 'number is odd' if
the entered number is odd.
basic selection categories / types
if statement if-else statement

a block of statements is executed or - if condition is true – execute block


skipped depending on a test of statements inside if.
condition/expression.
- if condition is false – execute block
if (test condition) of statements inside else.
{
block of statements if (test condition)
} {
block of statements
- statements are executed if condition }
is true. else
{
- statements are skipped if condition is block of statements
false. }
iteration

repetition / looping

a block of statements is executed repeatedly while/until a test


condition is true/false.

example

a program that prompts a user to enter a natural number n in order


to compute and display sum of the first n natural numbers.
basic iteration categories/types

unconditional/fixed conditional

looping continues for a set looping continues while a


number of times. test condition is true.

for loop while loop


do ... while loop
for loop

a block of statements is repeated while/until a test


condition/expression is true/false.

for(initialise counter;test condition;++/--counter)


{
block of statements
}
execution flow
initialise/set counter

test condition
if true, execute block
increment/decrement counter loop
test condition

if condition is still if condition is false, exit


true, repeat block loop
while loop

a block of statements is executed and repeated while a test


condition/expression is true.

while ( test condition )


{
block of statements
++ / -- counter
}
execution flow

− evaluate test condition/expression.

− if condition/expression is false - skip the loop.

− if condition/expression is true - execute the block of statements.

− repeat : evaluate test condition/expression.


do ... while loop

a block of statements is executed once and then repeated while the


test condition/expression is true.

do
{
block of statements
++ / -- counter
}
while ( test condition )
execution flow

− execute block of statements.

− then evaluate test condition/expression.

− if condition/expression is true : repeat.

− if condition/expression is false exit the loop.


c++
c++ vs c
- c++ is derived from and a superset of c.

- earlier versions of c++ are known as c with classes.

- c is a procedural programming language and does not support


classes and objects

- c++ is a combination of both procedural and object oriented


programming (OOP) language.

- most c programs can be compiled in c++ compiler.

- c++ expressions are the same as c expressions.

- all c operators are valid in c++.


reserved words

some of the reserved words are :

auto const double float int short

struct unsigned break continue else

for long signed switch void case

default enum goto register sizeof

typedef volatile char do extern if

return static union while


program structure
example
1. // basic program structure in C++
2. #include <iostream>
3. using namespace std;
4. int main ()
5. {
6. cout << "Hello C++!"; Hello C++!
7. return 0;

8. }
program breakdown
1. comment

// basic program structure in C++

// single line comment

&

/* multiple lines
... commenting */
2. preprocessor

#include <iostream>

preprocessor to include the iostream standard file.

<iostream> file is used for basic standard input-output.

header file for standard input and output functions.


input stream & output stream

standard input stream standard output stream

cin >> is used to enter data. cout << is used to access output.

can only process input from the can be used to access more than
keyboard once the enter key has one output values
been pressed.

can be used to request for/enter


more than one input values.
3. namespace std

using namespace std;

namespace std is used to allow access to elements of the standard


C++ library.

most programs use the C++ standard library hence the line is
included in most of the programs.
4. main function

int main ()

- definition of the main function.

- starting point for program execution.


6. program statement

cout << "Hello C++!";

an example of a program statement.

a semicolon (;) is used to terminate/end a statement.

whitespaces are ignored.


7. return statement

return 0;
return statement causes the main function to finish the execution.

return is followed by a return code – 0 in our example.

in general a return code of 0 for the main function is interpreted as


the program worked as expected without any errors during its
execution.

most usual way to end a C++ console program.


block of statements (5 --- 8)

5 8

{… …}
opening curly brace/bracket closing curly brace/bracket for
for a block of statements a block of statements
variable declaration

c++ is a strongly typed & case sensitive language.

all variables must be declared before use.

declaration is done after the opening brace of main() (or before the
main() function).

identifier ? initilisation ?

rules for naming variables/identifiers ?


examples
sequence

write a program that prompts a user to enter two integers, one by


one, in order to compute and display sum of the two numbers.
read 1st integer

read 2nd integer

sum = 1st integer + 2nd integer

display sum
selection

write a program that checks if the entered number is even or odd.

the program will then display 'number is even' or 'number is odd'


based on the input.
read number
If ( number % 2 = 0 )

display "number is even"

else

display "number is odd"


conditional operator

(? :) is a ternary operator  three operands

condition ? expression1 : expression2 ;

if condition is true, expression1 is executed

else expression2 is executed


write a program that checks if the entered number is even or odd
using the conditional operator.

the program will then display 'number is even' or 'number is odd'


based on the input.
int main()
{
int num ;
cout << "enter number: ";
cin >> num;
(num%2==0) ? cout << "number is even" : cout << "number is odd";
return 0;
}
switch
replaces if-else when there are more than two conditions.

switch expression is tested against a list of cases to find a


match.

default case is used when no match is found.

execution is terminated when a break statement is encountered


or when the default is reached.
format / syntax
switch(expression) {
case (test case 1):
block of statements;
break;
case (test case 2):
block of statements;
break;
...
default:
block of statements; }
write a program that checks if the entered number letter is a vowel or
not.
int main() {
char letter;
cout << "enter a letter: "; cin >> letter;
switch(letter) {
case 'a':
cout << " vowel is a ";
break;
case 'e':
cout << " vowel is e ";
break;
case 'i':
cout << " vowel is i ";
break;
case 'o':
cout << " vowel is o ";
break;
case 'u':
cout << " vowel is u ";
break;
default :
cout<<"no vowel was entered"; }
return 0; }
iteration

write a program that prompts a user to enter a natural number n


and then compute and display the sum of first n natural numbers.
sum = 0
counter = 1
read n
repeat if counter <= n
sum = sum + counter
increment counter by 1
end repeat

display sum
user-defined functions
user-defined functions
programmers can define other functions (procedures, subroutines) in
order to perform specific tasks, which are then called in the main.

syntax

function_type function_name( parameter list)


{
local-definitions
function implementation (statements)
}

function definition has two parts : header and function body.


user-defined functions

if a function returns a value then the type of that value must be


specified in function_type (return type) .

if a function does not return a value then the function_type must


be void.

function_name : same rules apply as case of identifiers.

parameter list : list of the formal parameters of the function together


with their types.
user-defined functions

function signature : function name & parameter list.

function declaration : return type, function name & parameter list.

local-definitions : definition of variables that are used in the function-


implementation only (no meaning outside function).

function-implementation:statements that are executed by the function.

function prototype : a function is declared & called in a program before


the function is defined.
example
sum function
#include <iostream>
using namespace std;
int sum (int a, int b) {
int sum;
sum = a+b;
return sum;
}
int main ()
{
int c;
c = sum (10,20);
cout << "sum is " << c;
return 0;
}
recursion

recursive function : a function that calls itself repeatedly until a


terminating point / base case is reached.

" (mathematics, computing) the practice of describing numbers,


expressions, etc. in terms of the numbers, expressions, etc. that
come before them in a series " – Cambridge dictionary

in a recursive process the solution to a problem depends on


solutions to smaller occurrences of the same problem.

examples : n factorial and fibonacci numbers/sequence


n factorial - n!

function factorial is:

input : integer n such that n >= 0

output : [n × (n-1) × (n-2) × … × 1]

1. if n is 0, return 1

2. otherwise, return [ n × factorial(n-1)]

end factorial
https://en.wikipedia.org/wiki/Recursion_(computer_science)
example
4 factorial – 4!

4! = 4 * 3!
= 4 * (3 * 2!)
= 4 * (3 * (2 * 1!))
= 4 * (3 * (2 * (1 * f0)))
= 4 * (3 * (2 * (1 * 1)))
= 4 * (3 * (2 * 1))
= 4 * (3 * 2)
= 4 * 6
= 24
#include <iostream>
using namespace std;
long factorial (long a) {
if (a > 1)
return (a * factorial(a-1));
else
return 1;
}
int main () {
long number = 4;
cout << number << "! = " << factorial(number);
return 0;
}
class exercise
change the program:

- to prompt user for input.

change the factorial function:

- to check base case (n==0) if true, else execute the recursive case.
fibonacci numbers / sequence

a series/sequence of numbers where the first number is 0 and the


second number is 1.

then the subsequent numbers are computed/generated from the sum


of the previous two numbers in the sequence.

the pattern is 0 , 1 , 1 , 2 , 3 , 5 , 8 , 13 , ...


fibonacci recursive function

to generate the fibonacci numbers / sequence


0, 1, 1, 2, 3, 5, 8, 13, ...

the recursive function is defined by the recurrence relation :

for n > 2 :

fibonacci(n) = fibonacci(n-1) + fibonacci(n-2)


for n <= 2 :

fibonacci(0) = 0
fibonacci(1) = 1
class task

(a)

write a program to prompt a user to enter a natural number n.

the program will then display the nth number in the fibonacci sequence
using recursion (a recursive function).

(b)

revise the program to ensure that the program must not allow
negative numbers.
arrays
definitions
" an array is a series of elements of the same type placed in contiguous
memory locations that can be individually referenced by adding an
index to a unique identifier "

" arrays are a data structure which hold multiple values of the same data
type "

" an array is a container object that holds a fixed number of values of a


single type "

" an array is a data structure which allows a collective name to be given


to a group of elements which all have the same type "

" arrays are an example of a structured variable "


definitions
analogous to of a set of contiguous boxes, each containing one data item
where the box number is the index of the data item i.e. each item is
identified by its index.

0 1 2 3

the index is an integer value - indicates position and order of the elements,
starting at 0.

the index is also used to access a specific element in the array.

the length of an array is set when the array is declared and is fixed.
declaration

data_type array_name [ array_size ];

e.g.

int numbers[20];

the array is named numbers and can hold 20 elements of type int.
initialisation
int numbers[5] = {1,3,5,7,9};
number of values btwn braces { } is not greater than the size of the
array.

not required to write the size of an array if all elements are initialised:

int numbers[] = {1, 3, 5, 7, 9};

if initialised with less elements, the remaining elements are set to the
default values of the data type.
int numbers[5]={1,3,5}; {1,3,5,0,0}
examples
int main() {
int i, numbers[5];
cout<<"enter 5 numbers: ";
for (int i = 0; i < 5; ++i)
{
cin>>numbers[i];
cout<<numbers[i]<<endl;
}
return 0; }
int numbers[] = {1, 2, 3, 4, 5};
int n, sum=0;
int main () {
for ( n=0 ; n<5 ; ++n )
{
sum += numbers[n];
}
cout <<"sum is " << sum;
return 0; }
write a program to compute and display the sum of the first 20
natural numbers stored in an array, which is initialised with default
values.

the program has to generate the elements of the array - the first 20
natural numbers.
steps :

- declare array of size = 20 with default values

- generate the elements (1,2,3,...,20)

- compute sum of the stored values

- display sum
revise / edit the
source code for
the range to be
(1,2,3,...,20)
2-D & 3-D (multidimensional) arrays

" array of arrays "


2-D arrays

1st index value specifies a row index and 2nd index value specifies a
column index.

0 1 2 3
0
1
initialising 2-D

int numbers[2][3]={2,4,6,8,10,12};

int numbers[2][3]={{2,4,6},{8,10,12}};
2-D example

write a program to store 6 values in a given 3 X 2 array and display


the indices and the corresponding stored element values.
int main() {

int m[3][2]={{2,-5},{4,0},{9,1}};
for(int i = 0; i < 3; ++i)
{
for(int j = 0; j < 2; ++j)
{
cout << "m[" << i << "][" << j << "]= " << m[i][j]<< endl;
}
}
return 0;
}
3-D arrays

1st index value specifies a row index and 2nd index value specifies a
column index and 3rd index value specifies a depth index.

1
0 0 1 2 3
0
1
initialising 3-D

int n[2][3][4] = { 3,4,2,3,0,-3,9,11,23,12,23,2,


13,4,56,3,5,9,3,5,5,1,4,9 };

int n[2][3][4] = { {{3,4,2,3},{0,-3,9,11},{23,12,23,2}},


{{13,4,56,3},{5,9,3,5},{3,1,4,9}} };
3-D example

write a program to accept 12 values from a user and store the


values in a 2 X 3 X 2 array and display the indices and the
corresponding stored element values.
int main() {
int n[2][3][2];
cout<<"enter 12 values: \n";
for(int i = 0; i < 2; ++i) {
for (int j = 0; j < 3; ++j) {
for(int k = 0; k < 2; ++k ) {
cin>>n[i][j][k];
}
}
}
for(int i = 0; i < 2; ++i) {
for (int j = 0; j < 3; ++j) {
for(int k = 0; k < 2; ++k ) {
cout<<"n["<<i<<"]["<<j<<"]["<<k<<"] = " <<
n[i][j][k] << endl;
}
}
} return 0; }
strings

- C-style character string.

- C++ string class type


c-style character string

- from C and supported in C++.

- 1-D array of characters which is terminated by a null character '\0'.

- a null-terminated string contains the characters that comprise the


string followed by the null.
initialising C-strings

char cpp[4] = {'C','+','+','\0'};

- creates a string comprising the word C++.

- size of the character array containing the string is one more than
the number of characters in the word. ?

- the array can also be initialised as follows:

char cpp[4] = "C++"; or char cpp[] = {'C','+','+','\0'};


examples
int main ()
{
char cpp[5]={'C','+','+','!','\0'};
cout << "my first string is ";
cout << cpp << endl;
return 0;
}

my first string is C++!


using cin.get function to include spaces.

int main()
{
char name[100];
cout<<"what is your full name? ";
cin.get(name,100);
cout << "my full name is " << name << endl;
return 0;
}

my full name is ______ ______


basic string built-in / in-built functions
basic functions that manipulate null-terminated strings :
strcpy(s1,s2) - copies string s2 into string s1.
strcat(s1,s2) - concatenates string s2 onto the end of string s1.
strlen(s1) - returns the length of string s1.
strcmp(s1,s2) - returns 0 if s1 and s2 are the same; less than 0 if
s1<s2; greater than 0 if s1>s2.
strchr(s1,c) - returns a pointer to the first occurrence of character c in
string s1.

strstr(s1,s2) - returns a pointer to the first occurrence of string s2 in


string s1.
#include <iostream>
#include <cstring>
using namespace std;
int main () {
char str1[12]="Hello ",str2[12]="cpp!",str3[12]; int len;
/* copy str1 into str3 */
strcpy(str3,str1);
cout << "strcpy(str3,str1): " << str3 << endl;
// concatenates str2 onto str1
strcat(str1,str2);
cout << "strcat(str1,str2): " << str1 << endl;
// total length of str1 after concatenation
len = strlen(str1);
cout << "strlen(str1): " << len << endl; return 0; }
strings can be passed to a function ...
pointers
" a pointer is a variable whose value is the address of
another variable "

" a pointer is a variable that stores the address of another


variable "

- pointers point to variables using the stored address value.

- a pointer can be used to access a variable pointed to directly.

- a pointer must be declared before being used.


pointer declaration
type *name;

- type is the pointer’s base type.


- name is the name of the pointer variable.
- * is used to declare a variable as pointer.
e.g.
float *pointer1; // pointer to a float variable
data type of all pointers is a hexadecimal number that represents a
memory address.
address of a variable in memory cannot be known before runtime.

only difference between pointers is the data type of the variable or


constant the pointer points to.
& vs *
reference operator - &
address-of-operator

- is used to obtain the address of a variable.

e.g.

pointer1 = &sum ;

- pointer1 gets the address value of the variable sum.

- & precedes the variable name.


dereference operator - *

is used to access the value of a variable a pointer points to.

e.g.

pointer1 = *pointer2 ;

pointer1 gets the value of a variable pointed to by pointer2

reference and dereference operators are complementary i.e. an


address obtained with & can be dereferenced with *
examples
int main()
{
int num1 = 10;
float num2 = 20.45;
double num3 = 1000;
cout << &num1 << endl;
cout << &num2 << endl;
cout << &num3 << endl;
return 0;
}

? ? ?
int main () {
float num1 = 15.1; // variable declaration
float *pointer1; // pointer declaration
pointer1 = &num1; // store address of num1 in pointer1
cout << "value of num1 is " << num1 << endl;
// display the address stored in pointer1
cout << " address stored in pointer1 is " << pointer1 << endl;
// access the value at the address available in pointer1
cout << "value of *pointer1 is " << *pointer1 << endl;
return 0; }
value of num1 is 15.1
address stored in pointer1 is hexadecimal value ?
value of *pointer1 is 15.1
pointer arithmetic and arrays

pointer arithmetic - using basic arithmetic operators

++ , -- , + , –
pointers and arrays
#include <iostream>
using namespace std;
int main ()
{
int a[5];
int *b;
b = a; *b = 10;
b++; *b = 20;
b = &a[2]; *b = 30;
b = a + 3; *b = 40;
10 20 30 40 50
b = a; *(b+4) = 50;

for (int i=0; i<5; i++)


{ cout << a[i] << " "; }
return 0; }
data structures

" a data structure is a group of data elements grouped together


under one name. "
" structure is another user defined data type which allows you to
combine data items of different kinds. "

" collection of variables of different types under a single name "

data structures represent a record where members can have


different data types and different lengths.
syntax
struct type_name {
member_type1 member_name1;
member_type2 member_name2;
...
} object_names;

struct statement - defines a new data type, with more than one member.

type_name - name for the structure type.

object_names - a set of valid identifiers for objects that have the type of
this structure.
-{} hold a list of data members, each one with a type and
a valid identifier (name) .
variable / member definition

declaring a structure variable / member :

type_name var1_name ;

structurevariable var1_name is defined of type structure


type_name.
e.g.

char gender; int age ;


member access

accessing members of a structure :

.
dot operator ( ) is used.

e.g.

to access gender of structure variable stud1 and assign value F .

stud1.gender = F ;
example
#include <iostream>
#include <cstring>
using namespace std;
struct Books {
char title[50];
char author[50];
char subject[100];
int book_id;
};
int main( ) {
Books Book1; // declare Book1 of type Book
// Book1 details
strcpy( Book1.title, "..." ) ;
strcpy( Book1.author, "..." ) ;
strcpy( Book1.subject, "..." ) ;
Book1.book_id = ... ;
// display Book1 details
cout << "Book 1 title : " << Book1.title <<endl;
cout << "Book 1 author : " << Book1.author <<endl;
cout << "Book 1 subject : " << Book1.subject <<endl;
cout << "Book 1 id : " << Book1.book_id <<endl;
return 0; }
'overviews'

You might also like