Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlphaClan_SY_49 #29

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Accounts.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import java.util.Scanner;

public class Accounts {
Scanner sc=new Scanner(System.in);
Accounts next=null;
String name,Id;
long PhNo;

Accounts(String name1,String Id1,long ph_no1){
name=name1;
Id=Id1;
PhNo=ph_no1;
}

}
22 changes: 22 additions & 0 deletions Admin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import java.util.*;
public class Admin {
public static void main(String Args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Hello Admin,");
System.out.print("Enter your password :");
String pswd=sc.next();

if(!pswd.equals("admin123"))
{
System.out.println("INCORRECT PASSWORD");
main(null);
}
else {
System.out.println("Admin login successful\n");
}
Campaign Campaign_obj=new Campaign();
Campaign_obj.main(null);

}
}
120 changes: 120 additions & 0 deletions Campaign.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import java.util.*;
public class Campaign {
String name,description;
double max_amount,donated_amount=0;
static int counter=0;
static Campaign campaigns[]=new Campaign[10];
static Main main_obj=new Main();
static Scanner sc = new Scanner(System.in);
static Transaction obj1=new Transaction();
void view()
{
if(counter==0)
{
System.out.println("No Campaigns ");
return;
}
System.out.println("**********CAMPAIGNS********** \n");
for(int i=0;i<counter;i++)
{
System.out.println("Name of Campaign : "+campaigns[i].name);
System.out.println("Details of Campaign : "+campaigns[i].description);
System.out.println("Amount Donated : "+campaigns[i].donated_amount);
System.out.println("Amount Needed : "+campaigns[i].max_amount);
System.out.println("\n");
}
}
void create()
{
campaigns[counter]=new Campaign();
System.out.println("Enter name of campaign");
campaigns[counter].name=sc.next();
System.out.println("Enter description of campaign");
campaigns[counter].description=sc.next();
System.out.println("Enter amount needed for campaign");
campaigns[counter].max_amount=sc.nextInt();
counter++;
System.out.println("Campaign created successfully\n");
}
void edit()
{
System.out.println("Enter name of campaign ");
String camp_name=sc.next();
int i=0;
int flag=0;
for(i=0;i<counter;i++)
{
if(campaigns[i].name.equals(camp_name))
{
flag=1;
break;
}

}
if(flag==0)
{
System.out.println("Campaign not found");
return;
}
System.out.println("What details you want to edit?");
System.out.println("1.Name\n2.Description\n3.Amount Needed");
int choice=sc.nextInt();
if(choice==1)
{
System.out.println("Enter new name");
campaigns[i].name=sc.next();
}
if(choice==2)
{
System.out.println("Enter new description");
campaigns[i].description=sc.next();
}
if(choice==3)
{
System.out.println("Enter new amount needed");
campaigns[i].max_amount=sc.nextInt();
}
System.out.println("Successfully edited the campaign\n");


}
void add_amount(String camp_name,double amt)
{
for(int i=0;i<counter;i++) {
if(campaigns[i].name.equals(camp_name)) {
if(((amt+campaigns[i].donated_amount)>campaigns[i].max_amount)) {
System.out.println("Sorry,maximum limit of fund exceeded!!");
}
else {
campaigns[i].donated_amount+=amt;
System.out.println("Thankyou for donating !!");
}
}
}
obj1.main(null);
}
public static void main(String Args[]) {
// TODO Auto-generated method stub
Campaign obj=new Campaign();
System.out.println("1.View Campaigns");
System.out.println("2.Create Campaigns");
System.out.println("3.Edit Campaigns");
System.out.println("4.Exit");
System.out.println("\n");
int choice=sc.nextInt();
if(choice==1)
obj.view();
if(choice==2)
obj.create();
if(choice==3)
obj.edit();
if(choice!=4)
Campaign.main(null);
if(choice==4) {
main_obj.main(null);
}

}


}
3 changes: 3 additions & 0 deletions Feedback forms
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Links for feedback forms:
1.https://docs.google.com/document/d/1_csU_-GJwnswKzC8Yj-L58lI9TX1gtVdCjZDKQFoSYQ/edit
2.https://docs.google.com/document/d/1HunY1MGvfiCCNO3n5WgKH7qrN8ubxQeOyAewuAze3Pw/edit
22 changes: 22 additions & 0 deletions Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import java.util.*;
public class Main {
public static void main(String Args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("WELCOME");
System.out.println("Enter your choice:");
System.out.println("1.Admin\n2.User\n3.Exit");
int a=sc.nextInt();
if(a==1) {
Admin Admin_obj = new Admin();
Admin_obj.main(Args);
}
if(a==2) {
User user_obj=new User();
user_obj.main(Args);
}
if(a==3) {
System.exit(0);
}
}
}
47 changes: 36 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
# Buffer-4.0
Buffer is a Data Structures and Algorithms Project series, in which students can participate as mentees in teams of 3-4 people.
This year the themes on which students can create a project are-
ALPHA CLANS: MISSION TO SERVE HUMANITY!

1. Healthcare
2. Digital Society
3. Open Innovation
4. Custom data structure to store data
TEAM MEMBERS (SY):
- NIKITA PAWAR
- SAKSHI WAGH
- AARYA AMBEKAR
- PURVA SARDA

This repository is created for all the teams to be able to upload their final project source code for the same.
PROBLEM STATEMENT:
Building a console-based programme to make donations anywhere anytime in a click.

While submitting, note that:
FEATURES:
This is a console-based programme which simulates Disaster Campaign Funding.
It enables the admin to securely login into the admin’s window to add and edit campaign details.
It allows users to create their accounts on the platform to make donations to various campaigns.
Users can choose how much to donate and which campaign to donate to.
Appropriate output is generated according to the user’s and admin's input.

Each folder should have the name of the team and inside a readme file with team member details, (name, year, branch) and their theme. The readme file should also contain the link to their presentation as well as the drive link where both the report documents would be stored.
DATA STRUCTURES USED:
1. SINGLY LINKED LIST:
List of all users
List of donations they make.
List of user's details.
Size of these lists is dynamic, hence singly linked list is used for efficient insertion and deletion.

Happy Coding :)
2. ARRAY OF OBJECTS :
To store the requirements of the each campaign.
Array of object allows us to deal with number of attributes connected with a single entity.

3. ARRAY:
Used to implement array of objects.

LEARNINGS AND OUTCOMES:
Importance and application of Abstract Data Types (ADTs) and Flowcharts
Application and implementation of various linear data structures
Importance of static keyword (used a static variable to keep track object we are refering to)
Learned a powerful tool - GitHub

WHAT'S NEXT:
User interface for better user experience.
Database for storing user history and donation data.
35 changes: 35 additions & 0 deletions Transaction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import java.util.*;
public class Transaction {
String choice,description;
double max_amount,donated_amount=0;
static int counter=0;
static double amount=0;
static Campaign transactions[]=new Campaign[10];
static Scanner sc = new Scanner(System.in);
static String usercampaign=null;
static Main obj=new Main();

public static void main(String[] args) {
System.out.println("Do you want donate to a campaign ?");
System.out.println("1.Yes\n2.No");
int ans=sc.nextInt();
if(ans==1) {
System.out.println("Available Campaigns: ");
Campaign obj=new Campaign();
obj.view();
System.out.println("Enter campaign name you wish to donate to:");
usercampaign=sc.next();
System.out.println("Enter the amount to be donated:");
amount=sc.nextInt();
obj.add_amount(usercampaign,amount);
obj.main(null);
}
if(ans==2) {
obj.main(null);
}
if(ans!=1 && ans!=2) {
System.out.println("Enter the valid input");
Transaction.main(args);
}
}
}
69 changes: 69 additions & 0 deletions User.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import java.util.Scanner;
public class User {
static Accounts head=null,temp=null;
static String name=null;
static long PhNo=0;
static int UID=100;
static String Id=null;
static String testId=null;
static Transaction obj=new Transaction();
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter your choice :");
System.out.println("1.New User\n2.Existing User\n3.Exit");
int choice=sc.nextInt();
if(choice==1) {
System.out.println("Enter your name:");
name=sc.next();
System.out.println("Enter your phone number: ");
PhNo=sc.nextLong();
Id="UID"+String.valueOf(UID);
UID++;
System.out.println("Your Id is:"+Id);
Accounts new_donar=new Accounts(name,Id,PhNo);
if(head==null) {
head=new_donar;
temp=head;
}
else {
temp=head;
while(temp.next!=null) {
temp=temp.next;
}
temp.next=new_donar;
}
obj.main(null);
}
int flag=0;
if(choice==2) {

System.out.println("Enter your ID: ");
testId=sc.next();
temp=head;
while(temp!=null) {
if(testId.equals(temp.Id)) {
System.out.println("Welcome "+temp.name);
obj.main(null);
flag=1;
break;

}
temp=temp.next;
}
if(flag==0)
{
System.out.println("Invalid");
main(null);
}

obj.main(null);

}
if(choice==3) {

}


User.main(null);
}
}
1 change: 1 addition & 0 deletions Video link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://drive.google.com/drive/folders/1_xUU_ByuWprx3L3OTfpFxlDCTrvTmuBj