Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Object Oriented Paradigm: Faculty of Information Technology UCP Lahore, Pakistan

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Object Oriented Paradigm

Session: Fall 2014

Faculty of Information Technology


UCP Lahore, Pakistan

Lab 1: Revision Lab


Lab Objectives:
The basic purpose of this laboratory is revision of some preliminary concepts of c++ that has been
covered in the course of Introduction to Computing and Programming Fundamentals. Its objective is to:

Recall students previously learned basic concepts.


Revision of arrays , functions, File Handling, and Struct.
Understanding problem statements and designing an appropriate solution.

Instructions:

Indent your code


Comment your code
Use meaningful variable names
Plan your code carefully on a piece of paper before you implement it.
Name of the program should be same as the task name. i.e. the first program should be
Task_1_01.cpp

Lab Tasks:
Lab Task 1:
Write a function Largest which takes 2 integers as parameters and returns the largest
number among them.

Lab Task 2:
Write a function Convert_To_Uppercase that takes a valid English sentence and converts
all of its letters to uppercase (Hint: Use a character array to store the sentence. You can also
add checks for invalid characters).
Sample Input
Object oriented programming is so cool!
Expected Output
OBJECT ORIENTED PROGRAMMING IS SO COOL!

Lab Task 3:
Write a program that read a list of students containing their name and test scores and output
the following:

a. Class average
b. Names of all students with score less that the class average
c. Highest test score and the name of student having the highest test score.
The program should take input of at least 5 students (could be more) from user in console.

Lab Task 4:

Create a struct called Student which has registration no, name, admission date and cgpa as member
variables. Create a dynamic array of type Student.
1. Write a function Input_Records for getting record of a student. Also write a function Display
to print contents of the struct student on screen.
2. Write a function that stores the list of students information in a text file.
3. Write a function to read the list of students from the file
4. Search and display the students information by registration number and by name from the file.
5. Display all the students information that are admitted 2 years before the current date.
Hint: Write a menu driven program. Each menu should call a separate function to perform an
operation. To store date use structure date that contains three members namely date, month and
year.

You might also like