oop lab 1
oop lab 1
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
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.