Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
28 views

Computer Programming

1. The document describes a flow chart for changing a booked doctor's appointment due to an important task. The flow chart starts with being unable to go to the clinic, then trying to contact the doctor. If contact is made, the visit day is changed, otherwise a new appointment is booked for another day. 2. A C++ program is written using endl manipulator to print "C++", "programming is not", and "that though" each on a new line. 3. Programs are written using escape sequences to print a triangle, rectangle, and square on the screen.

Uploaded by

Saad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Computer Programming

1. The document describes a flow chart for changing a booked doctor's appointment due to an important task. The flow chart starts with being unable to go to the clinic, then trying to contact the doctor. If contact is made, the visit day is changed, otherwise a new appointment is booked for another day. 2. A C++ program is written using endl manipulator to print "C++", "programming is not", and "that though" each on a new line. 3. Programs are written using escape sequences to print a triangle, rectangle, and square on the screen.

Uploaded by

Saad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

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;
}

You might also like