# Project export: UC Pathway

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 11.0
- Tagline: Streamlining Your Admissions Journey.
- Devpost: https://devpost.com/software/uc-data-project
- GitHub: https://github.com/BLum01/Cal-Hacks-11.0
- Team: 1 GitHub contributor(s) — Brandon Lum (1 commits)

## Devpost submission (written by the team)

No Devpost description available.

## README (from the GitHub repository)

No README available.

## Detected evidence (automated analysis)

Indexed codebase: 2 recognized source files, 15 KB.
- Java (language) — detected in the code

## Codebase structure (from repository index)

### Files (11 of 11)

```
CollegeDataProject/src/CollegeClientGUI.java
CollegeDataProject/src/School.java
CollegeDataProject/UCBData.txt
CollegeDataProject/UCDData.txt
CollegeDataProject/UCIData.txt
CollegeDataProject/UCLAData.txt
CollegeDataProject/UCMData.txt
CollegeDataProject/UCRData.txt
CollegeDataProject/UCSBData.txt
CollegeDataProject/UCSCData.txt
CollegeDataProject/UCSDData.txt
```

### Dependencies

No dependency index available.

### Recent commits (newest first)

- Add files via upload

## Key source files (fetched from GitHub, selected and truncated for size)

### CollegeDataProject/src/School.java

```java
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class School {
    private File inputFile;
    private String schoolName;
    private double admitRate;
    private String admitGpaRange;
    private String intendedMajor;

    public School(String schoolName, String intendedMajor) throws FileNotFoundException {
        //accessTxt returns corresponding txt file with school information
        this.schoolName = schoolName.trim();
        this.inputFile = accessTxt(this.schoolName);
        this.intendedMajor = intendedMajor.trim();
        getInfo();

    }

    public File getFile() {
        return inputFile;
    }

    public String getSchoolName() {
        return schoolName;
    } 

    public String getAdmitRate() {
        double rate = admitRate * 10000.0;
        rate = Math.round(rate);
        rate /= 100.0;
        return rate + "%";
    }

    public String getAdmitGPaRange() {
        return admitGpaRange;
    }
 
    public void printInfo() {
        System.out.println("School Name: " + getSchoolName());
        System.out.println("Acceptance Rate: " + getAdmitRate());
        System.out.println("GPA Range: " + getAdmitGPaRange());
    }
   
    public void getInfo() throws FileNotFoundException {

	    Scanner scnr = new Scanner(this.inputFile);    
	    //goes through first two lines that show categories
        scnr.nextLine();
        scnr.hasNextLine();

        boolean isMajor = false;

        while (scnr.hasNextLine()) {
           String[] arr = scnr.nextLine().split("\t");
        
           for (String s: arr) {
               if (s.equalsIgnoreCase(intendedMajor)) {
                isMajor = true;
                break;
                }
            }   
        
            if (isMajor == true) {
                this.admitGpaRange= arr[3];
                this.admitRate = Double.parseDouble(arr[4]);
                break;
            }
        }
        
        if (!isMajor) {
            throw new IllegalArgumentException("Major \"" + this.intendedMajor + "\" does \nnot exist at " + this.schoolName);
        }

        scnr.close();
    }

   //method to return the corresponding file to the college name
    public static File accessTxt(String schoolName) throws FileNotFoundException {
       File inputFile = new File("UCBData.txt");
       schoolName = schoolName.toUpperCase();
       switch (schoolName) {
             case "UCD":
                inputFile = new File("UCDData.txt");
                break;

            case "UCI":
                inputFile = new File("UCIData.txt");
                 break;

            case "UCLA":
                inputFile = new File("UCLAData.txt");
                break;
          
            case "UCM":
                inputFile = new File("UCMData.txt");
                break;
      
            case "UCR":
                inputFile = new File("UCRData.txt");
                break;
          
            case "UCSB": 
                inputFile = new File("UCSBData.txt");
                break;
          
            case "UCSC":
               inputFile = new File("UCSCData.txt");
                break;
          
            case "UCSD":
                inputFile = new File("UCSD.txt");
                break;

       }

       if (!inputFile.exists()) {
          throw new FileNotFoundException("File not found: " + inputFile.getPath());
       }
      
      return inputFile;
  }
}

```

### CollegeDataProject/src/CollegeClientGUI.java

```java
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileNotFoundException;

public class CollegeClientGUI {

    public static void main(String[] args) {

        // color pallete
        Color lightYellowColor = new Color(214, 174, 81);
        Color lightGray = new Color(200, 204, 208);
        Color lightWhite = new Color (252, 253, 255);
        Color lightBlue = new Color(0, 110, 244);    
        Color darkGray = new Color(51, 51, 51);
        // Set up the JFrame (window)
        JFrame frame = new JFrame("UC Admissions Information");
        
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().setBackground(lightYellowColor);
        frame.setSize(870, 600);
        frame.setLocationRelativeTo(null);
        frame.setLayout(null); 

        // Create the top panel with an image and title
        JPanel topPanel = new JPanel();
        ImageIcon imageIcon = new ImageIcon("/Users/brandonlum/Downloads/UCLogo.png");
        JLabel image = new JLabel(imageIcon);
        topPanel.setLayout(null);  
        topPanel.setBackground(lightBlue);
        topPanel.setBounds(0, 0, 870, 82);
        image.setBounds(0, 3, 100, 75);  
        JLabel titleLabel = new JLabel("UC Transfer Admissions Information");
        titleLabel.setHorizontalAlignment(0);
        titleLabel.setFont(new Font("Kievit", Font.BOLD, 30));
        titleLabel.setBounds(0, 0, 850, 100);
        topPanel.add(image);
        topPanel.add(titleLabel);


        // User enters school name
        JLabel labelSchoolName = new JLabel("Enter School Name (e.g., UCD, UCLA):");
        labelSchoolName.setFont(new Font("Kievit", Font.BOLD, 20));
        labelSchoolName.setForeground(darkGray);
        labelSchoolName.setBounds(30, 20, 400, 30); 
        JTextField fieldSchoolName = new JTextField();
        fieldSchoolName.setBounds(450, 20, 300, 30); 
        fieldSchoolName.setBackground(lightGray);
       
        // User enters intended major
        JLabel labelMajor = new JLabel("Enter Intended Major:");
        labelMajor.setFont(new Font("Kievit", Font.BOLD, 20));
        labelMajor.setForeground(darkGray);
        labelMajor.setBounds(30, 75, 300, 30);
        JTextField fieldMajor = new JTextField();
        fieldMajor.setBounds(450, 75, 300, 30); 
        fieldMajor.setBackground(lightGray);

         // Add first-year or transfer applicant option with radio buttons
         JLabel whatAdmission = new JLabel("Select application type:");
         whatAdmission.setFont(new Font("Kievit", Font.BOLD, 20));
         whatAdmission.setBounds(30, 130, 300, 30); 
         JRadioButton rb1 = new JRadioButton("First-year");
         rb1.setBounds(450,130,100,30); 
         JRadioButton rb2 = new JRadioButton("Transfer");
         rb2.setBounds(600,130,300,30);
         ButtonGroup bg = new ButtonGroup();
         bg.add(rb1);
         bg.add(rb2);

        // Submit button
        JButton buttonSubmit = new JButton("Get Info");
        buttonSubmit.setBounds(315, 180, 150, 30);
        buttonSubmit.setForeground(new Color(255, 255, 255));
        buttonSubmit.setOpaque(true);
        buttonSubmit.setBackground(new Color(0, 123, 255));
        buttonSubmit.setBorderPainted(false);

         // Title for first area box
         JLabel generalInfo = new JLabel("General Information");
         generalInfo.setBounds(30,215,750,30);

        // Output area for displaying results
        JPanel outPutAreaPanel = new JPanel();
        outPutAreaPanel.setBounds(30, 245, 725, 180);
        outPutAreaPanel.setBackground(lightGray);
        JTextArea outputArea = new JTextArea();
        outputArea.setEditable(false);
        outputArea.setBackground(lightGray);
        outputArea.setFont(new Font("Kievit", Font.BOLD, 9));
        outPutAreaPanel.add(outputArea);

        //Title for second area box
        JLabel majorInfo = new JLabel("Major Information (Note: trasfer admissions data," + 
            " use as reference if applying as first year)");
        majorInfo.setBounds(30,435,750,30);
  
        // Output area for major results
        JPanel majorArea = new JPanel();
        JTextArea outputArea2 = new JTextArea();
        outputArea2.setEditable(false);
        outputArea2.setBackground(lightGray);
        majorArea.setBounds(30,465,725, 100  );
        majorArea.setBackground(lightGray);
        majorArea.add(outputArea2);
        outputArea2.setFont(new Font("Kievit", Font.BOLD, 15));

        // Create the middle panel for school name and major input
        JPanel middlePanel = new JPanel();
        middlePanel.setLayout(null);  
        middlePanel.setBackground(lightWhite);
        middlePanel.setBounds(30, 30, 790, 600);

        // Add everything to middle panel
        middlePanel.add(labelSchoolName);
        middlePanel.add(fieldSchoolName);
        middlePanel.add(labelMajor);
        middlePanel.add(fieldMajor);
        middlePanel.add(whatAdmission);
        middlePanel.add(rb1);
        middlePanel.add(rb2);
        middlePanel.add(buttonSubmit);
        middlePanel.add(generalInfo);
        middlePanel.add(outPutAreaPanel);
        middlePanel.add(majorInfo);
        middlePanel.add(majorArea);

        // Add scroll wheel ability
        JPanel outerPanel = new JPanel();
        outerPanel.setBounds(0, 83, 880, 1000);
        outerPanel.add(middlePanel);
        outerPanel.setLayout(null);
        outerPanel.setBackground(lightYellowColor);
        outerPanel.setPreferredSize(new Dimension(870, 1000));

        JScrollPane scrollPane = new JScrollPane(outerPanel);
        scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollPane.setBound
[truncated — 5708 more characters]
```