0% found this document useful (0 votes)
8 views33 pages

Labs Solution

The document provides a comprehensive guide for students on installing and using Dev-C++ and online compilers, detailing step-by-step installation processes and usage instructions. It also includes a lab focused on object orientation, where students identify objects, attributes, and behaviors from a real-world scenario, specifically a Virtual University bookshop. Additionally, the document outlines a lab on creating UML class diagrams to represent relationships in an Employee Management System.

Uploaded by

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

Labs Solution

The document provides a comprehensive guide for students on installing and using Dev-C++ and online compilers, detailing step-by-step installation processes and usage instructions. It also includes a lab focused on object orientation, where students identify objects, attributes, and behaviors from a real-world scenario, specifically a Virtual University bookshop. Additionally, the document outlines a lab on creating UML class diagrams to represent relationships in an Employee Management System.

Uploaded by

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

Solutions

Lab 1-1: Installation and usage of Dev-C++ and online


compilers

Objective:

The objective of this lab is to teach students how to install and use the Dev-
C++ and online compilers.

Learning Outcomes:

After this lab, the students will be able to run the C++ code in Dev-C++ and
the online compilers.

Problem Statement

You are required to install any version of Dev-C++ in your system according
to your system and operating system requirements.
Dev C++ 4.9.9.2 Installation Guide

Installation Steps:

Step 1:

Double-click on the file devcpp_setup.exe and Click on the “Run” button.

Step 2:

Click on the “OK” button.

Step 3:

Click on the “OK” button.


Step 4:

Click on the “I Agree ” button.

Step 5:

Click on the “Next” button.


Step 6:

Click on the “Install” button.

Step 7:

Wait until the green bar completed


Step 8:

Click on the “Finish” button.

Your Dev C++ 4.9.9.2 has been installed successfully. Now start writing
compiling and running programs and enjoy programming.
Dev C++ 5.9 Installation Guide

Installation Steps:

Step 1:

Double-click on the file devcpp_setup.exe and Click on the “Run” button.

Step 2:

Click on the “OK” button.

Step 3:
Click on the “OK” button.

Step 4:

Click on the “I Agree ” button.


Step 5:

Click on “Next” button.

Step 6:

Click on “Install” button.


Step 7:

Wait until the green bar completed

Step 8:

Click on “Finish” button.


Your Dev C++ 4.9.9.2 has been installed successfully. Now start writing
compiling and running programs and enjoy programming.

Guidelines on how to use Dev-C++

Following are the steps to write, save, compile, and run a program, using
Dev-C++:

How to open Dev-C++:


Main interface of Dev-C++:
Write a new Program:
Where to write the code:
After writing your code:
Save the Program:

1st Step:
2nd Step:
How to compile the program:

1st Step:
2nd and 3rd step will be performed automatically

2nd Step:
3rd Step:
How to run the program:
Output will be displayed as:
Guidelines on how to use online C++ compiler

Following are the steps to write, compile, and run a program using an online
compiler:

Open a browser and type the following address in the address bar.

https://www.programiz.com/cpp-programming/online-compiler/
Now, write the C++ code in the highlighted area.
Write your C++ code in the highlighted area.

After writing the code, click on the ‘Run’ button.


The output of the code will be shown in the highlighted area.
If the program contains syntax errors, then errors will be shown along with
the line number in the highlighted area.

After removing the syntax errors, click on the ‘Run’ button again to see the
output.
Lab 1-2: Object Orientation

Objective:

The objective of this lab is to teach students how to identify objects, their attributes and
behaviors from the real-world scenario.

Learning Outcomes:

After this lab, the students will be able to identify objects, attributes and behaviors from a given
scenario.

Problem Statement

Consider the following scenario and identify all objects, their attributes, and behaviors.
In the Virtual University bookshop, the handouts of all courses are provided at reasonable
prices. The handouts are made in accordance with the video lectures recorded by famous
professors. It is a step to facilitate students to easily digest the course contents.

You are required to extract the Class Name, attributes and behaviours (operations) from the
above scenario.

Class Name Attributes (characteristics) Behaviors (operations)

Solution:

Class Attributes (characteristics) Behaviors (operations)

Bookshop Name Set Order


Address (location) Get Order
Phone number Confirm Order
list of books Deliver order
Update Inventory (update order)
Payment receive/ collect
Handout Title Upload
No. of topics /chapters Download
Page number Edit
Author Print
Publisher Read
Creation date Write
Modify date Share
Edition View
Course Course code Add information
Course name View Information
Course instructor Edit information
Credit hour Read
Total marks Write
Grading scheme
No. of lectures
Video Video number View / watch
Lectures Name Record
Duration Upload
Video quality Download
Type Stop
Video URL Share
Pause
Forward
Reverse
Increase speed
Decrease speed
Increase volume
Decrease volume
playback
Professor Employee ID Teach
Name Develop assignment
Age Solve student’s problems
Gender Develop Quiz
Qualification Develop GDB
Specialization Prepare Exam
Designation Take Exam
Experience Invigilate
Salary Mark papers
No. of taught subjects Mark activities
Give grades
Prepare result
Student Student ID / Roll number Study
Name Give exam
Age Attempt activities
Gender Taking lectures
Student program Write notes
Semester Making time table
CGPA
No. of courses
Course No. of topics Upload
content Names Edit
Topic number View
Topic Description Share
Composed by Write
Publish by Download
Written by
Lab 2: Class Diagram

Objective:

The objective of this lab is to teach students how to identify classes and relationships between
classes and draw a UML class diagram by applying the concepts of inheritance, aggregation or
composition.

Learning Outcomes:

After this lab, the students will be able to draw a UML class diagram for a given scenario.

Problem Statement

Consider a scenario of an Employee Management System that is used to manage employee


records and departments. The system handles various types of employees and departments.
Employees in the organization can be of different types, such as Full-Time and Part-Time. Full-
time employees get a salary according to their designation whereas part-time employees get a
salary based on working hours. A Department contains multiple employees, but an employee is
associated with only one department at a time.

You are required to apply the concepts of inheritance, aggregation or composition to the given
scenario and draw a UML class diagram.

Solution:

You might also like