The Muggy Weather Robotics Duo

Image
 The Muggy Weather Robotics Duo A C++ System That Thinks, Feels (Sensors!), and Acts Humidity is like the quiet character in the weather story that actually runs the show. On muggy days, everything feels heavier—breathing, drying laundry, running machines, even keeping a data center cool. For people, it’s about comfort and health; for machines, it’s about performance and reliability; for plants and buildings, it’s about moisture balance and mold risk. In robotics and automation, muggy weather isn’t just a nuisance—it’s a signal . It tells your systems when to ventilate, when to dehumidify, when to throttle physically demanding tasks, and when to take preventative maintenance actions. Today, we’ll build a two-program C++ system that “understands” muggy weather: Program A — sensor_hub.cpp A sensor-side program that generates (or ingests) a live stream of environmental data (temperature, relative humidity, pressure, CO₂, VOCs). Think of it as your robotic nose and skin , con...

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

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