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

SY-59-PublicWelfare #21

Open
wants to merge 4 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
41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
# Buffer-5.0
Buffer is a Data Structures and Algorithms Project Series, in which students can participate as mentees in teams of 2-4. Under Buffer 5.0, the themes on which students can create a project are:
# Team Wellness Wizards
# Mental Health Assessment Tool

1. Public Welfare
2. Tourism
3. College level applications
4. Custom Data structure
## Overview
This project is a simple mental health assessment tool designed to provide users with guidance on potential mental health conditions based on their responses to a series of questions. The tool prompts users with questions related to their mental well-being and uses their responses to categorize their potential conditions. It provides suggestions and resources based on the identified condition.

This repository is created for all the teams to be able to upload their final project source code. While submitting, note that all the submission guidelines given are followed, and all the files are named appropiately. Also ensure that your README file contains the links of the progress reports and the drive link containing the video of the project.
## Features
- Clinic Finder:
- Users input their location of residence.
- The program calculates the nearest mental health clinic based on the provided location.
- Information about the nearest clinic, including name, distance, contact details, and website, is displayed to the user.

- Mental Health Assessment:
- Users undergo a series of questions related to their mental health symptoms and experiences.
- Each question presents multiple options for the user to choose from.
- Based on the user's responses, the program evaluates potential mental health conditions.
- The assessment provides feedback on potential mental health conditions identified from the user's responses.

## Implementation
- The program is implemented in Java.
- Array of Objects is used to store the user information.Each element of the array represents a single user, and the object's fields store specific details about that user.
- A series of interconnected nodes represent the questions and options for the mental health assessment.Each node contains a question and a list of options that lead to the next node based on the user's selection.This is implemented with Graph using linkedlist.
- The clinic finder functionality calculates distances between locations and clinics to determine the nearest one using Graph implemented by arrays.
- The mental health assessment functionality employs a decision tree approach to evaluate user responses.

## Team Members
- Shweta Bagade
- Pradnya Bapat
- Aarya Patil

## Links:
- video : https://drive.google.com/file/d/1S4ZZ4EY1yuJFEfi8tbj5gMSLDeDpoCAf/view?usp=sharing

- Report 1 : https://docs.google.com/document/d/1zyozyGBz4Ju9nyZnXSbaxoKkr-Bh3R1O/edit?usp=sharing&ouid=101707835012972035195&rtpof=true&sd=true

- Report 2 : https://docs.google.com/document/d/1vLmd9FRKg114FZ_8GFwp1NHvShTycNay/edit?usp=sharing&ouid=101707835012972035195&rtpof=true&sd=true
279 changes: 279 additions & 0 deletions bufferproject/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
package buffer;
import java.util.*;

class info{
String name;
int age;
String gender;
String mail;
}

class Buffer{
Scanner sc=new Scanner(System.in);
info Buffer[]=new info[10];
void accept() {
Buffer[0]=new info();
System.out.println("Enter name of customer");
Buffer[0].name=sc.next();
System.out.println("Enter age of customer");
Buffer[0].age=sc.nextInt();
System.out.println("Enter the gender of customer");
Buffer[0].gender=sc.next();
System.out.println("Enter the mail of customer");
Buffer[0].mail=sc.next();
}
}

class Option {
char text;
Node nextNode;

public Option(char text, Node nextNode) {
this.text = text;
this.nextNode = nextNode;
}
}

class Node {
String question;
List<Option> options;

public Node(String question) {
this.question = question;
this.options = new ArrayList<>();
}

public void addOption(char text, Node nextNode) {
options.add(new Option(text, nextNode));
}

public List<Option> getOptions() {
return options;
}
}

class Prompt{
void create(){
Node q1 = new Node("a. Are you constantly Worried?\n"+
"b. Do you always get negative thoughts?\n"+
"c. Do you experience hallucinations or dellusions?\n"+
"d. Do you have trouble focusing on work?");
Node q2 = new Node("a. Do you constantly feel restless?\n"+
"b. Are you frequently feeling tired?");
Node q3 = new Node("a. Are you frequently feeling sad\n"+
"b. Are you percieved as a person with bad temper?");
Node q4 = new Node("a. Are you extremely paranoid about your surroundings?\n"+
"b. Do you smoke/drink a lot?\n"+
"c. Do you often see/hear/experience non existent things?");
Node q5 = new Node("a. Is it been for long time?\n"+
"b. Is it a recent experience");
Node q6 = new Node("a. do you get this feeling when certain things misplaced or cluttered?\n"+
"b. Is it induced due to daytoday events?");
Node q7 = new Node("a. Do you experience muscle tension?\n"+
"b. Have you experienced any change in body weight?");
Node q8 = new Node("a. Is it been for long time?\n"+
"b. Is it a recent experience");
Node q9 = new Node("a. Are you exercising more than required?\n"+
"b. Are you overworking yourself?");
Node q10=new Node("a. Have you lost significant bodyweight?\n"+
"b. Have you suddenly gained bodyweight?");

Node root1=new Node("OCD");
Node root2=new Node("Anxiety");
Node root3=new Node("Depression");
Node root4=new Node("Situational depression");
Node root5=new Node("Dellusional disorder");
Node root6=new Node("Alcoholism");
Node root7=new Node("Shizophrenia");
Node root8=new Node("Stress");
Node root9=new Node("Fatigue");
Node root10=new Node("Eating disorder");
Node root11=new Node("ADHD");

q1.addOption('a', q2);
q1.addOption('b', q3);
q1.addOption('c', q4);
q1.addOption('d', q5);

q2.addOption('a', q6);
q2.addOption('b', q7);

q3.addOption('a', q8);
q3.addOption('b', root8);

q4.addOption('a',root5);
q4.addOption('b',root6);
q4.addOption('c',root7);

q5.addOption('a', root11);
q5.addOption('b', q2);

q6.addOption('a', root1);
q6.addOption('b', root2);

q7.addOption('a', q9);
q7.addOption('b', q10);

q8.addOption('a', root3);
q8.addOption('b', root4);

q9.addOption('a', root9);
q9.addOption('b', root8);

q10.addOption('a', q9);
q10.addOption('b', root10);

Scanner scanner = new Scanner(System.in);
Node currentNode = q1;
while (currentNode != null) {
if (currentNode.getOptions().isEmpty()) {
System.out.println("Result: " + currentNode.question);
break;
}
System.out.println(currentNode.question);
System.out.print("Choose an option: ");
char option = scanner.next().charAt(0);
currentNode = getNextNode(currentNode, option);
}
}

Node getNextNode(Node currentNode, char option) {
for (Option opt : currentNode.options) {
if (opt.text==option) {
return opt.nextNode;
}
}
System.out.println("Invalid option. Please choose again.");
return currentNode;
}
}

class Graphs{
void mtd(int location){
int distances[][]=new int[6][4];
// 6 locations, 4 clinics
//location-location, clinic-location and clinic-clinic distances not required only location-clinic distance is required hence the the dimension is not 10*10

distances[0][0]=5;//distance from Aundh to clinic 1 is 5km
distances[0][1]=8;
distances[0][2]=9;
distances[0][3]=12;
distances[1][0]=2;//distance from Baner to clinic 1 is 2km
distances[1][1]=10;
distances[1][2]=12;
distances[1][3]=14;
distances[2][0]=4;//distance from Hadapsar to clinic 1 is 2km
distances[2][1]=1;
distances[2][2]=2;
distances[2][3]=5;
distances[3][0]=4;//distance from Hinjewadi to clinic 1 is 4km
distances[3][1]=1;
distances[3][2]=8;
distances[3][3]=15;
distances[4][0]=2;//distance from Deccan to clinic 1 is 2km
distances[4][1]=1;
distances[4][2]=4;
distances[4][3]=5;
distances[5][0]=2;//distance from Prabhat road to clinic 1 is 4km
distances[5][1]=10;
distances[5][2]=4;
distances[5][3]=15;
int minimum=distances[location][0];
int index=0;
for(int j=0;j<4;j++)
{
if(distances[location][j]<=minimum)
{
minimum=distances[location][j];
index=j;
}
}

switch(index)
{
case 0:
{
System.out.println("The nearest clinic from your location is MindfulHealing Hub which is"+" "+distances[location][index]+"km away\ncontact us on 020-24456782 to book your appointment or book on www.minfulhealing.com ");
break;
}
case 1:
{
System.out.println("The nearest clinic from your location is ZenLife, which is"+" "+distances[location][index]+" km away\ncontact us on 020-24466782 to book your appointment or book on www.zenlife.com");
break;
}
case 2:
{
System.out.println("The nearest clinic from your location is LifeLine Clinic, which is"+" "+distances[location][index]+" km away \ncontact us on 020-21166782 to book your appointment or book on www.lifeline.com");
break;
}
case 3:
{
System.out.println("The nearest clinic from your location is EmpowerMinds Clinic, which is"+" "+distances[location][index]+" km away \ncontact us on 020-21166744 to book your appointment or book on www.empowerminds.com");
break;
}
}
}
}
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);

Buffer b=new Buffer();
b.accept();

Prompt obj=new Prompt();
obj.create();

Graphs obj2=new Graphs();
int location=0;
System.out.println("Enter your location of residence\n0.Aundh\n1.Baner\n2.Hadapasar\n3.Hinjewadi\n4.Deccan\n5.Prabhat road");
try {
location=sc.nextInt();
} catch (NoSuchElementException e) {
System.out.println("Invalid input. Please enter a valid integer.");
sc.nextInt();
}
obj2.mtd(location);
}
}

/*
OUTPUT:
Enter name of customer
shweta
Enter age of customer
19
Enter the gender of customer
female
Enter the mail of customer
[email protected]
a. Are you constantly Worried?
b. Do you always get negative thoughts?
c. Do you experience hallucinations or dellusions?
d. Do you have trouble focusing on work?
Choose an option: d
a. Is it been for long time?
b. Is it a recent experience
Choose an option: b
a. Do you constantly feel restless?
b. Are you frequently feeling tired?
Choose an option: b
a. Do you experience muscle tension?
b. Have you experienced any change in body weight?
Choose an option: b
a. Have you lost significant bodyweight?
b. Have you suddenly gained bodyweight?
Choose an option: b
Result: Eating disorder
Enter your location of residence
0.Aundh
1.Baner
2.Hadapasar
3.Hinjewadi
4.Deccan
5.Prabhat road
1
The nearest clinic from your location is MindfulHealing Hub which is 2km away
contact us on 020-24456782 to book your appointment or book on www.minfulhealing.com

*/