Computer Programming
Lab Journal- Lab 1
1. Suppose you had an appointment with a doctor at one
week’s time but due to some important task you want to
change an already booked doctor’s appointment on phone,
draw a flow chart.
Start
Can’t go to clinic
because of some task
Try to contact
doctortTSG
If you are able to Ask to change the
make contact visit day for
already booked
appointment
Otherwise book new
appointment for another
day
End
Steps:
Start.
Can’t go to clinic because of some important work.
Call doctor.
If you are able to make contact then request to change visit day for
appointment.
Otherwise book appointment for another day.
End.
2. Write the program using endl or \n manipulator to display
the following text:
C++
programming is not
that though
#include <iostream>
using namespace std;
int main()
{
cout <<" C++\n";
cout <<" programming is not\n";
cout <<" that though";
return 0;
}
3.Write a program yourself using escape sequences to print
the triangle on screen.
#include<iostream>
using namespace std;
int main()
{
cout<<" /\\\n";
cout<<" / \\\n";
cout<<" / \\\n";
cout<<" / \\\n";
cout<<" --------";
return 0;
}
4.Write a program yourself using escape sequences to print
a rectangle on screen.
#include<iostream>
using namespace std;
int main()
{
cout<<"********\n";
cout<<"* *\n";
cout<<"* *\n";
cout<<"* *\n";
cout<<"* *\n";
cout<<"* *\n";
cout<<"* *\n";
cout<<"********";
return 0;
}
5.Write a program yourself using escape sequences to
print the square on screen.
#include <iostream>
using namespace std;
int main()
{
cout <<" ********\n";
cout <<" *\t*\n";
cout <<" *\t*\n";
cout <<" ********\n";
return 0;
}