National University: CL-1002 Programming Fundamentals Lab # 13
National University: CL-1002 Programming Fundamentals Lab # 13
National University: CL-1002 Programming Fundamentals Lab # 13
OfComputer&EmergingSciencesFaisalabad-ChiniotCampus
CL-1002
Programming
Fundamentals Lab # 13
Objectives:
• Practice and understanding on basic c++ programs
• One-dimensional Array
• Multi-dimensional Array
Note: Carefully read the following instructions (Each instruction contains a weightage)
1. Use proper font family (Calibri or Times New Roman) and font size of the title (16
points), heading (14 points), subheading (12 points), and normal text (10 points).
2. First think about the problem statement and then write/draw your logic on paper.
3. Microsoft Visual Studio should be used to make c++ programs. Programs
made with any other software would not be accepted.
4. For each task in the manual create a new C++ program with the naming convention as
follows:
TASK-NO
5. Mention what is happening in each line of code using comments.
6. Write all codes one by one with proper numbering and also paste screen shot of
each problem using the snipping tool (default screen capture software in windows)
on Microsoft word file.
7. Please submit your file with this naming convention
ROLLNO_SECTION_GROUPNO_LABNO.
8. Do not copy from any source otherwise, you will be penalized with zero marks.
9. Submit your lab on Google Classroom.
Page 1
National University
OfComputer&EmergingSciencesFaisalabad-ChiniotCampus
Problem: 1 | string
Write a program to input a sentence in string and then indicates the starting point (startIndex
and stopIndex). Now your program holds the section between the two indexes.
Example:
Entered string is “My name is Ali”
Start index: 4
Stop index: 7
Section between starting and Ending Index: name
Problem: 2 | String
Write a program in C++ that takes 5 to 10 lines as input text from the user and save it into a file
“myfile.txt”. Now write a code to count and display the number of lines not starting with
alphabet 'A'.
Example: Sample input: If the string contains the following lines,
The rose is red.
A girl is playing there.
There is a playground.
An airplane is in the sky.
Numbers are not allowed in the password.
Sample Output:
The rose is red.
There is a playground.
Numbers are not allowed in the password.
Count Value is: 3
Problem: 3 | C string
Page 2
National University
OfComputer&EmergingSciencesFaisalabad-ChiniotCampus
Problem: 4 | C string
Problem: 6 | C string
Write a program that prompts the user to input a string and outputs the string in uppercase
letters. (Use a character array to store the string.)
Problem: 7 | C string
Page 3
National University
OfComputer&EmergingSciencesFaisalabad-ChiniotCampus
Problem: 8 | C string
Write a C++ Program to input a string and then find the number of vowels in that string .
Best of luck
You are done with your exercise, submit on classroom at given time.
Page 4