0% found this document useful (0 votes)
6 views13 pages

Data Structure Internship Project C++

The document outlines a summer internship training project on the fundamentals of data structures using C++, focusing on the development of a banking system. It includes details about account management, transaction handling, and user interaction through a menu-driven interface. The project is submitted by three students under the guidance of an associate professor at Lovely Professional University.

Uploaded by

malfkhani
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)
6 views13 pages

Data Structure Internship Project C++

The document outlines a summer internship training project on the fundamentals of data structures using C++, focusing on the development of a banking system. It includes details about account management, transaction handling, and user interaction through a menu-driven interface. The project is submitted by three students under the guidance of an associate professor at Lovely Professional University.

Uploaded by

malfkhani
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

Summer Internship Training

(June 2025 - July 2025)

on

Fundamental of Data Structure using C++

Submitted by

(Puneet Rao ) Registration Number: 12309991


(Ashwani Kumar) Registration Number: 12315577
(Abhishek Kumar) Registration Number: 12304701

Under the Guidance of

Dr. Om Prakash Yadav


Associate Professor

School of Computer Science and Engineering


Lovely Professional University
Jalandhar - Delhi G.T. Road, Phagwara, Punjab (India) - 144411

1|P age
Project Code: (with white back ground only )

#include <iostream>
#include <string>
#include <ctime>
using namespace std;

// here we create structure for transaction (Linked List Node)


struct Transaction {
string type;

double amount;

string date;
Transaction* next;
};

// Account Structure
struct Account {
string accountNumber;
string holderName;

double balance;
Transaction* transactions;
bool isActive;
};

// Class for Banking System


class BankingSystem {
private:
Account accounts[100]; // Fixed array to store accounts
int totalAcc;

2|P age
// Generate AC no.
string generateAccountNumber() {
static int count = 1000;
return "ACC" + to_string(count++);
}

// current date
string getCurrentDate() {
time_t now = time(0);
string date = ctime(&now);
return [Link](0, [Link]()-1);
}

// Find acc index by acc no


int findAccount(string accNum) {
for(int i = 0; i < totalAcc; i++) {
if(accounts[i].accountNumber == accNum && accounts[i].isActive) {
return i;
}
}
return -1;
}

public:
BankingSystem() {
totalAcc = 0;
for(int i = 0; i < 100; i++) {
accounts[i].isActive = false;
accounts[i].transactions = nullptr;
}
}

// Create new acc


void createAccount(string name) {

3|P age
if(totalAcc >= 100) {
cout << (" ुिट: अिधकतम खाता सीमा तक प ं च गया! / Error: Maximum
account limit reached!") << endl;
return;
}

accounts[totalAcc].accountNumber = generateAccountNumber();
accounts[totalAcc].holderName = name;

accounts[totalAcc].balance = 0.0;
accounts[totalAcc].isActive = true;

cout << ("खाता सफलतापूवक बनाया गया! / Account created successfully!")


<< endl;
cout << ("खाता सं ा: / Account Number: ") <<
accounts[totalAcc].accountNumber << endl;

cout << ("खाताधारक का नाम: / Holder Name: ") <<


accounts[totalAcc].holderName << endl;
totalAcc++;
}

// Deposit money
void deposit(string accNum, double amount) {
int index = findAccount(accNum);
if(index == -1) {
cout << ("खाता नहीं िमला! / Account not found!") << endl;
return;
}

if(amount <= 0) {
cout << ("अमा रािश! / Invalid amount!") << endl;
return;
}

4|P age
accounts[index].balance += amount;

// Add to transaction history


Transaction* newTrans = new Transaction;
newTrans->type = "जमा / Deposit";

newTrans->amount = amount;
newTrans->date = getCurrentDate();

newTrans->next = accounts[index].transactions;
accounts[index].transactions = newTrans;

cout << ("जमा सफल! / Deposit successful!") << endl;


cout << ("नया शेष: / New Balance: ") << accounts[index].balance << endl;
}

// Withdraw money
void withdraw(string accNum, double amount) {
int index = findAccount(accNum);
if(index == -1) {
cout << ("खाता नहीं िमला! / Account not found!") << endl;
return;
}

if(amount <= 0) {
cout << ("अमा रािश! / Invalid amount!") << endl;
return;
}

if(amount > accounts[index].balance) {


cout << ("अपया शेष! / Insufficient balance!") << endl;
return;
}

5|P age
accounts[index].balance -= amount;

// Add to transaction history


Transaction* newTrans = new Transaction;
newTrans->type = "िनकासी / Withdrawal";
newTrans->amount = amount;
newTrans->date = getCurrentDate();

newTrans->next = accounts[index].transactions;
accounts[index].transactions = newTrans;

cout << ("िनकासी सफल! / Withdrawal successful!") << endl;


cout << ("नया शेष: / New Balance: ") << accounts[index].balance << endl;
}

// Check balance
void checkBalance(string accNum) {
int index = findAccount(accNum);
if(index == -1) {
cout << ("खाता नहीं िमला! / Account not found!") << endl;
return;
}

cout << ("खाता िववरण: / Account Details:") << endl;


cout << ("खाता सं ा: / Account Number: ") <<
accounts[index].accountNumber << endl;
cout << ("खाताधारक का नाम: / Holder Name: ") <<
accounts[index].holderName << endl;
cout << ("वतमान शेष: / Current Balance: ") << accounts[index].balance
<< endl;
}

// Show transaction history


void transactionHistory(string accNum) {

6|P age
int index = findAccount(accNum);
if(index == -1) {
cout << ("खाता नहीं िमला! / Account not found!") << endl;
return;
}

cout << ("खाता के िलए लेनदे न इितहास / Transaction History for ") <<
accounts[index].accountNumber << endl;
cout << "----------------------------------------" << endl;

Transaction* current = accounts[index].transactions;


if(current == nullptr) {
cout << ("कोई ले नदे न नहीं िमला! / No transactions found!") << endl;
return;
}

while(current != nullptr) {
cout << (" कार: / Type: ") << current->type << endl;
cout << ("रािश: / Amount: ") << current->amount << endl;
cout << ("तारीख: / Date: ") << current->date << endl;
cout << "----------------------------------------" << endl;
current = current->next;

}
}
void displayMenu(int cc){
// int cc;

// cin>>cc;

if(cc==1){
cout << "\nBanking System Menu:" << endl;
cout << "1. Create Account" << endl;
cout << "2. Deposit" << endl;

7|P age
cout << "3. Withdraw" << endl;
cout << "4. Check Balance" << endl;
cout << "5. Transaction History" << endl;
cout << "6. Exit" << endl;
cout << "Enter choice: ";
// cin >> choice;
}
else{

cout << "\nबिकंग िस म मेनू:" << endl;


cout << "1. खाता बनाएँ " << endl;
cout << "2. जमा कर" << endl;
cout << "3. िनकासी कर" << endl;
cout << "4. शेष रािश जां च" << endl;
cout << "5. लेनदे न इितहास" << endl;
cout << "6. बाहर िनकल" << endl;
cout << "िवक दज कर: ";
// cin >> choice;

}
}

// Destructor to free transaction memory


~BankingSystem() {
for(int i = 0; i < totalAcc; i++) {
Transaction* current = accounts[i].transactions;
while(current != nullptr) {
Transaction* temp = current;
current = current->next;
delete temp;
}
}
}
8|P age
};

// Main function with menu


int main() {
BankingSystem bank;
int choice;
string accNum, name;
double amount;
int bb;
cout<<"select language: / भाषा चुने: "<<endl;
cout<<"for English Press 1 or िहं दी के िलए 2 दबाएँ : ";
cin>>bb;
do {
[Link](bb);
cin >> choice;
switch(choice) {
case 1:
cout << ("खाताधारक का नाम दज कर: / Enter account holder name:
");
[Link]();
getline(cin, name);
[Link](name);
break;

case 2:
cout << ("खाता सं ा दज कर: / Enter account number: ");
cin >> accNum;
cout << ( "जमा करने की रािश दज कर: / Enter amount to deposit: ");
cin >> amount;
[Link](accNum, amount);
break;

case 3:
cout << ( "खाता सं ा दज कर: / Enter account number: ");

9|P age
cin >> accNum;
cout << ("िनकासी की रािश दज कर: / Enter amount to withdraw: ");
cin >> amount;
[Link](accNum, amount);
break;

case 4:
cout << ("खाता सं ा दज कर: / Enter account number: ");
cin >> accNum;
[Link](accNum);
break;

case 5:
cout << ( "खाता सं ा दज कर: / Enter account number: ");
cin >> accNum;
[Link](accNum);
break;

case 6:
cout << ("हमारे बिकंग िस म का उपयोग करने के िलए ध वाद! /
Thank you for using our banking system!") << endl;
break;

default:
cout << ("अमा िवक ! / Invalid choice!") << endl;
}
} while(choice != 6);

return 0;
}

10 | P a g e
Screen shot: 3 to 5 screenshots during execution of code

11 | P a g e
12 | P a g e
Link of the Video:
[Link]
projects-activity-7349109120861425664-
ZN94?utm_source=share&utm_medium=member_android&rcm=ACoAAEUFL
0kB6kQ578i4ZMe4nZSGQzkJs9TEH-U

13 | P a g e

You might also like