Giter Club home page Giter Club logo

hotel-management-system's Introduction

hotel-management-system

hotel-menu

*This project was developed using java programming lunguage and however most of the code was written using imperative programming.

Imperative programming is a software development paradigm where functions are implicitly coded in every step required to solve a problem. In imperative programming, every operation is coded and the code itself specifies how the problem is to be solved, which means that pre-coded models are not called on www.techtarget.com.

Piece of Code

room.addActionListener(onclick ->{

      if(room_number.getText().equals("")||
              Objects.equals(bed_field.getSelectedItem(), "") ||price_field.getText().equals(""))
      {
          JOptionPane.showMessageDialog(null,
                  "Please Fill All Details",
                  "VALUE ERROR",
                  JOptionPane.ERROR_MESSAGE,panel_exit);
      }else {

          allRoomsDatabase();
          select_all_rows();
      }
  });
    allocate_customer.addActionListener(onclick ->{

            String selected_room = (String) customer_room_number_field.getSelectedItem();
            checkin_database_connection();
            try {
                Class.forName("com.mysql.jdbc.Driver");
                Connection connection = DriverManager.getConnection(databaseUrl,username,password);

                Statement statement  = connection.createStatement();
                statement.executeUpdate("update all_rooms set status = 'booked' where room_number = '"+selected_room+"';");

                connection.close();
                System.out.println(selected_room);

            }catch(ClassNotFoundException | SQLException e){
                JOptionPane.showMessageDialog(null,
                        "Failed to update room status",
                        "Table Error",
                        JOptionPane.ERROR_MESSAGE,panel_exit);

            }

            allocate_customer.setEnabled(false);

}); // actionListener

Database Details

The database used in this project is Maria Db through Xampp

  • String username = "root";
  • String password = "";
  • String databaseUrl = "jdbc:mysql://localhost:3306/signup";

hotel-management-system's People

Contributors

shannonchimutengo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hotel-management-system's Issues

Brief report of possible “bad” or “dangerous” values ​​detected in measurements of the project

Summary of Potential "Bad" or "Dangerous" Metric Values
I have identified several potentially problematic or "dangerous" metric values in the project. Below is a summary of these values along with their analysis:

Composition Metrics

CBO (Coupling Between Objects)
SignUpPage: CBO = 4
Analysis: High coupling (4), approaching the upper limit of the scale. This could lead to difficulties in maintenance and scalability.

RFC (Response For Class)
Main_Display: RFC = 73
Analysis: Very high RFC, nearly at the upper limit. Indicates that the class might be overly complex and difficult to understand and maintain.

WMC (Weighted Method Complexity)
SignUpPage: WMC = 10
Analysis: High WMC, close to the upper limit. Suggests that the class has a significant complexity in methods, increasing the likelihood of errors and making maintenance challenging.

Complexity Metrics

OCmax (Maximum Operation Complexity)
Forgot_Password: OCmax = 3.0
Analysis: High OCmax, nearing the upper limit. This may lead to methods that are difficult to maintain and understand.

WMC (Weighted Method Complexity)
SignUpPage: WMC = 10
Analysis: High WMC for the class, indicating many complex methods.

Dependency Metrics

Dcy (Number of Transitive Dependencies)
Signup: Dcy = 6.0
Analysis: High number of transitive dependencies, approaching the upper limit. This can lead to problems with code reuse and maintenance.

Dpt (Number of Transitive Dependents)
Forgot_Password: Dpt = 4.0
Analysis: High number of transitive dependents, nearly reaching the upper limit. Indicates that the class has many dependencies, which may create maintenance issues.

Lines of Code Metrics

LOC (Lines of Code)
Main_Display: LOC = 462
Analysis: Very high number of lines of code, close to the maximum limit. This suggests that the class may be overly large and difficult to maintain.

MOOD Metrics

Polymorphism Factor (PF)
Project: PF = 300%
Analysis: Extremely high polymorphism factor, far exceeding the maximum limit. This might indicate complex relationships that make the code difficult to understand.

Javadoc Coverage

Javadoc Class Coverage (Jc)
Project: 14.29%
Analysis: Very low class coverage with Javadoc. This indicates limited documentation, which may affect code understanding and maintenance.

Javadoc Method Coverage (Jm)
Project: 13.64%
Analysis: Very low method coverage with Javadoc. Indicates limited documentation for methods, which might affect code understanding and maintenance.

These values highlight areas of the code that may need attention and improvement to avoid future issues with maintenance and understanding.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.