🌿 Smart Garden Manager in C++ with Robotics, UI, Drones, and Sound "A Rainwater Conservation System for Tomorrow’s Farms"

Image
  🌿  Smart Garden Manager in C++ with Robotics, UI, Drones, and Sound "A Rainwater Conservation System for Tomorrow’s Farms" 🧭  1. Introduction: Farming in the Age of Climate Change In a world where clean water is more precious than gold, efficient  rainwater harvesting and plant care systems  are no longer optional — they’re essential. Smart farming doesn’t mean just automating irrigation. It means combining  robotic drones, environmental sensors, and intelligent scheduling  to build a garden that practically takes care of itself. In this guide, we build a  fully functional Garden Manager System  using  C++  that: Captures and conserves rainwater Uses  robotic drones and sensors  to monitor crop health Integrates a  real-time UI  with progress bars and alerts Includes  timers  for scheduling plant growth and drone tasks Plays  interactive sounds  based on crop state and events Whether you'r...

House Rental Listing System in C++

House Rental Listing System in C++

Introduction

This project simulates a rental listing system where users can list houses or portions for rent. It allows users to add new properties, display available listings, and search for rentals based on location and rent criteria.

Main Features

1. Adding a Property

  • Users can list houses or portions available for rent.
  • Each listing includes details like owner name, type, location, rent amount, and availability.

2. Viewing All Listings

  • Displays all currently available rental properties.

3. Searching for Rentals

  • Users can filter listings based on:
    • Location
    • Maximum Rent

C++ Implementation

Code: Rental Listing System

#include <iostream>
#include <vector>
#include <string>

using namespace std;

// Structure to store details of a property
struct Property {
    string type;   // "House" or "Portion"
    string owner;
    string location;
    int rent;
    bool isAvailable;

    // Display function
    void display() const {
        cout << "--------------------\n";
        cout << "Owner: " << owner << "\n";
        cout << "Type: " << type << "\n";
        cout << "Location: " << location << "\n";
        cout << "Rent: $" << rent << "\n";
        cout << "Availability: " << (isAvailable ? "Available" : "Rented") << "\n";
    }
};

// Function to add a property
void addProperty(vector<Property>& listings) {
    Property newProperty;

    cout << "Enter owner name: ";
    cin.ignore();
    getline(cin, newProperty.owner);

    cout << "Enter type (House/Portion): ";
    getline(cin, newProperty.type);

    cout << "Enter location: ";
    getline(cin, newProperty.location);

    cout << "Enter rent amount: ";
    cin >> newProperty.rent;

    newProperty.isAvailable = true;

    listings.push_back(newProperty);
    cout << "Property added successfully!\n";
}

// Function to display all available properties
void displayProperties(const vector<Property>& listings) {
    if (listings.empty()) {
        cout << "No properties available.\n";
        return;
    }

    cout << "\nAvailable Properties:\n";
    for (const auto& property : listings) {
        if (property.isAvailable) {
            property.display();
        }
    }
}

// Function to search for properties based on criteria
void searchProperties(const vector<Property>& listings) {
    string location;
    int maxRent;

    cout << "Enter location to search: ";
    cin.ignore();
    getline(cin, location);

    cout << "Enter maximum rent: ";
    cin >> maxRent;

    cout << "\nSearch Results:\n";
    bool found = false;

    for (const auto& property : listings) {
        if (property.isAvailable && property.location == location && property.rent <= maxRent) {
            property.display();
            found = true;
        }
    }

    if (!found) {
        cout << "No matching properties found.\n";
    }
}

// Main function: House Rental Management System
int main() {
    vector<Property> listings;
    int choice;

    do {
        cout << "\nHouse Rental Management System\n";
        cout << "1. Add Property\n";
        cout << "2. View Available Properties\n";
        cout << "3. Search Property\n";
        cout << "4. Exit\n";
        cout << "Enter choice: ";
        cin >> choice;

        switch (choice) {
            case 1:
                addProperty(listings);
                break;
            case 2:
                displayProperties(listings);
                break;
            case 3:
                searchProperties(listings);
                break;
            case 4:
                cout << "Exiting...\n";
                break;
            default:
                cout << "Invalid choice! Try again.\n";
        }
    } while (choice != 4);

    return 0;
}

Explanation of Code

  1. Property Structure:

    • Defines attributes like type, owner, location, rent, and isAvailable.
    • Includes a display() function to show property details.
  2. addProperty() Function:

    • Takes input from the user and stores it in a vector<Property>.
  3. displayProperties() Function:

    • Displays all available properties in the system.
  4. searchProperties() Function:

    • Allows users to filter rentals by location and maximum rent.
  5. Main Menu Loop:

    • Provides an interactive menu for the user to manage the rental system.

Future Enhancements

  • Implement a feature for owners to mark a property as rented.
  • Add a login system to differentiate owners and renters.
  • Introduce a graphical interface (GUI) using Qt for better user experience.
  • Integrate a database (MySQL) for storing rental listings permanently.

This C++ rental listing system provides a basic yet functional model for property rentals. It can be further expanded to create a full-fledged property management system.

Comments

Popular posts from this blog

C++ Projects: Basic Traffic Management System

C++ Projects: Book Shop Management System

C++ Projects: Password Manager