// Path: src/database/DatabaseConnection.java
// public class DatabaseConnection {
// 	Connection dbConnection;
// 	
// 	public DatabaseConnection() {
// 		dbConnection = DatabaseConnection.connector();
// 	}
// 	
// 	public static Connection connector() {
// 		// SQLite connection string
//         Connection conn = null;
//         try {
//         	Class.forName("org.sqlite.JDBC");
//         	//for Linux distribution
//             String url = "jdbc:sqlite:/home/"+System.getProperty("user.name")+"/Money-ManagerDB/Money_Manager.db";
//             
//         	//for Mac distribution
// //        	String url = "jdbc:sqlite:/Users/"+System.getProperty("user.name")+"/Money-ManagerDB/Money_Manager.db";
//         	
//           //for Windows distribution
// //            String url = "jdbc:sqlite:Money_Manager.db";
//             
//             conn = DriverManager.getConnection(url);
// //            System.out.println("Connection to SQLite has been established.");
//         } catch (SQLException | ClassNotFoundException e) {
//             System.out.println(e.getMessage());
//         }
//         return conn;
// 	}
// 	
// 	
// 	public boolean isDBConnected() {
// 		try {
// 			return !dbConnection.isClosed();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 			return false;
// 		}
// 	}
// 	
// //	public static void main(String[] args) {
// //		DatabaseConnection access = new DatabaseConnection();
// //		System.out.println(access.isDBConnected());
// //	}
// }


import java.text.DecimalFormat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import database.DatabaseConnection;
	}
		
	public static int countWords(String s){
	    int wordCount = 0;

	    boolean word = false;
	    int endOfLine = s.length() - 1;

	    for (int i = 0; i < s.length(); i++) {
	        // if the char is a letter, word = true.
	        if (Character.isLetterOrDigit(s.charAt(i)) && i != endOfLine) {
	            word = true;
	            // if char isn't a letter and there have been letters before,
	            // counter goes up.
	        } else if (!Character.isLetter(s.charAt(i)) && word) {
	            wordCount++;
	            word = false;
	            // last word of String; if it doesn't end with a non letter, it
	            // wouldn't count without this.
	        } else if (Character.isLetter(s.charAt(i)) && i == endOfLine) {
	            wordCount++;
	        }
	    }
	    return wordCount;
	}
	
	
	public static boolean containswhitespace(String s) {
		Pattern pattern = Pattern.compile("\\s");
		Matcher matcher = pattern.matcher(s);
// Path: src/database/DatabaseConnection.java
// public class DatabaseConnection {
// 	Connection dbConnection;
// 	
// 	public DatabaseConnection() {
// 		dbConnection = DatabaseConnection.connector();
// 	}
// 	
// 	public static Connection connector() {
// 		// SQLite connection string
//         Connection conn = null;
//         try {
//         	Class.forName("org.sqlite.JDBC");
//         	//for Linux distribution
//             String url = "jdbc:sqlite:/home/"+System.getProperty("user.name")+"/Money-ManagerDB/Money_Manager.db";
//             
//         	//for Mac distribution
// //        	String url = "jdbc:sqlite:/Users/"+System.getProperty("user.name")+"/Money-ManagerDB/Money_Manager.db";
//         	
//           //for Windows distribution
// //            String url = "jdbc:sqlite:Money_Manager.db";
//             
//             conn = DriverManager.getConnection(url);
// //            System.out.println("Connection to SQLite has been established.");
//         } catch (SQLException | ClassNotFoundException e) {
//             System.out.println(e.getMessage());
//         }
//         return conn;
// 	}
// 	
// 	
// 	public boolean isDBConnected() {
// 		try {
// 			return !dbConnection.isClosed();
// 		} catch (Exception e) {
// 			e.printStackTrace();
// 			return false;
// 		}
// 	}
// 	
// //	public static void main(String[] args) {
// //		DatabaseConnection access = new DatabaseConnection();
// //		System.out.println(access.isDBConnected());
// //	}
// }


// Path: src/system/UnitConverter.java
import java.text.DecimalFormat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import database.DatabaseConnection;

	}
		
	public static int countWords(String s){
	    int wordCount = 0;

	    boolean word = false;
	    int endOfLine = s.length() - 1;

	    for (int i = 0; i < s.length(); i++) {
	        // if the char is a letter, word = true.
	        if (Character.isLetterOrDigit(s.charAt(i)) && i != endOfLine) {
	            word = true;
	            // if char isn't a letter and there have been letters before,
	            // counter goes up.
	        } else if (!Character.isLetter(s.charAt(i)) && word) {
	            wordCount++;
	            word = false;
	            // last word of String; if it doesn't end with a non letter, it
	            // wouldn't count without this.
	        } else if (Character.isLetter(s.charAt(i)) && i == endOfLine) {
	            wordCount++;
	        }
	    }
	    return wordCount;
	}
	
	
	public static boolean containswhitespace(String s) {
		Pattern pattern = Pattern.compile("\\s");
		Matcher matcher = pattern.matcher(s);
		boolean found = matcher.find();