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

oop lab 1

This document outlines the lab instructions for an Object Oriented Programming course for Spring 2025, taught by Ms. Kashaf Shakoor. It includes tasks for students to complete in C++, focusing on programming fundamentals, conditional statements, and functions, with specific requirements for submission format and content. Students are required to write functions for calculating volume and evaluating financial balances, along with providing outputs and screenshots in a Microsoft Word document.

Uploaded by

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

oop lab 1

This document outlines the lab instructions for an Object Oriented Programming course for Spring 2025, taught by Ms. Kashaf Shakoor. It includes tasks for students to complete in C++, focusing on programming fundamentals, conditional statements, and functions, with specific requirements for submission format and content. Students are required to write functions for calculating volume and evaluating financial balances, along with providing outputs and screenshots in a Microsoft Word document.

Uploaded by

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

Object Oriented Programming-Lab

Spring 2025
Instructor: Ms. Kashaf Shakoor
Email:
[email protected]
Instructions:
Submission Format Rollno._NAME_Section.pdf
• Do not copy code from any source otherwise you will be penalized with negative marks.
• Complete your tasks within the given time.
• Write a code in C++ language and use Visual Studio.
• Make a Microsoft Word file and paste all of your C++ code with screenshot of outputs in MS
word and submit pdf file.

Objectives
• Basic Programming Fundamentals Concepts
• Conditional Statements, Loops
• Functions
Task: 01

What are the outputs of both codes?


Task 02
Write a function named calculateVolume that calculates the volume of a box. It should
take three parameters: length, width, and height. If the height is not provided, it should
default to 1.

Task 03
You are working on developing a simple console application for a financial management
system. The application needs to help users determine whether their current balance is
positive or negative. Write a function named isPositive that will evaluate the user's
balance. The function should take an integer parameter representing the balance and
return an integer value indicating whether the balance is positive or negative.
Specifically, the function should return 1 if the balance is positive (greater than 0) and 0
if the balance is negative or zero (less than or equal to 0).
In the main function of your application, you need to prompt the user to enter their current
balance. After receiving the input, call the isPositive function with the user's balance as the
argument. Based on the return value from isPositive, display a message to the user indicating
whether their balance is positive or negative. This will help users quickly assess the status of their
financial situation.

Example of Expected Output:


• If the user inputs a balance of 150, the application should output: "Your balance is
positive."
• If the user inputs a balance of -75, the application should output: "Your balance is
negative."

You might also like