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

ASSIGNMENT 03 – Total Marks: 20

Course ID: CS4001 Course Title: Object-Oriented


Programming

Teacher: Mohid Nadeem Deadline: 14th May, 2024

Instructions:
1. Submission is accepted through Google Classroom.
2. Solve the questions on IDE.
3. Submit all the code files named as “yourName_questionNumber” like “Mohid_Q01”.

Q.NO.01: Write a C++ code for implementing following two scenarios:


[Marks: 2*10 = 20]
A Make a Bank Management System.

The user opens the program. The program asks for the following details.
Name
Age
Passcode
Initial Deposit Amount

The user enters them, the program then saves the information and prints the following
Menu,

1 – View your Details


2 – Withdraw Money
3 – Deposit Money
4 - Exit

Explanation:
1 – The program prints the name, age, total amount in the bank account. Program
prints “Do you want to go back, Press any key: “,after printing the details. The user
will press any key and the program should take the user back to the menu.

2 – The program asks for the passcode, if the user enters the correct passcode,
the program asks for the withdraw amount. If the amount is available in the
account, Display the message “Withdraw Successful”. Also, Update the total
amount in account and print “Remaining Amount in your Account: Rs. XX“. If the
passcode entered is wrong, Send the user back to the Menu,

3 – The program asks for the passcode, if the user enters the correct passcode, the
program asks for the deposit amount. Display the message “Deposit Successful”.
Also, Update the total amount in account and print “Updated Amount in your
Account: Rs. XX“. If the passcode entered is wrong, Send the user back to the
Menu,

4 – The program says “Good Bye!”and exits.


B Initialize two arrays with the names:
numbers (int) containing values 2, 4, 6, 4, 7, 8, 10, 20, 2, 4, 5, 3, 4, 9
fruits (string) containing values “Apple”, “Mango”, “Watermelon”, “Peach”, “Orange”,
“Banana”, “Strawberry”

a) Write a function named "findMin" that takes the numbers array and prints
the minimum value. b) Write a function named "findMax" that takes the
numbers array and prints the maximum value. c) Write a function named
"findSum" that takes the numbers array and prints the sum of all values. d)
Write a function named "findEvenSum" that takes the numbers array and
prints the sum of all even values. e) Write a function named "sortFruits" that
takes the fruits array and sorts the values.
f) Write a function named "findFruit" that takes the fruits array and a search
term from the user as “key”and prints whether the search term is present in
the fruits array or not.
g) Write a function named "fruitsWithM" that takes the fruitsarray and prints
the fruits in the result that have “m” in them.

You might also like