<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: May cccc</title>
    <description>The latest articles on DEV Community by May cccc (@maya__354c16ced7bfb8).</description>
    <link>https://dev.to/maya__354c16ced7bfb8</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4108444%2Fd8023a5e-8b13-4366-ad6e-77b9c4451343.png</url>
      <title>DEV Community: May cccc</title>
      <link>https://dev.to/maya__354c16ced7bfb8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maya__354c16ced7bfb8"/>
    <language>en</language>
    <item>
      <title>My C++ training project</title>
      <dc:creator>May cccc</dc:creator>
      <pubDate>Fri, 04 Sep 2026 13:44:02 +0000</pubDate>
      <link>https://dev.to/maya__354c16ced7bfb8/my-c-training-project-2g5n</link>
      <guid>https://dev.to/maya__354c16ced7bfb8/my-c-training-project-2g5n</guid>
      <description>&lt;p&gt;As part of my journey to practice and master core programming concepts in C++, I built a simple yet functional Console Ticket Reservation System.&lt;br&gt;
Building small projects like this has been one of the best ways to solidify my understanding of data structures, conditional logic, and control loops. In this article, I’ll walk you through how the code works and what I learned while building it.&lt;br&gt;
🎯 What Does the Application Do?&lt;br&gt;
The application simulates a theater seat reservation system using a 4x4 grid (16 total seats):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;represents an available seat.
X represents a reserved seat.
Users can repeatedly choose seat coordinates (row and column), see live updates of the theater map, get notified if a seat is already taken, and receive a final price calculation upon checkout.
💡 Key Features &amp;amp; Concepts Used&lt;/li&gt;
&lt;li&gt;2D Arrays for Grid Layouts
The seating layout is managed using a 2D array: char seats[4][4]. This allowed me to map human-readable row and column inputs (1 to 4) directly to array indices [row - 1][col - 1].&lt;/li&gt;
&lt;li&gt;Custom Visualization Function
To present the map clearly after each reservation, I created a dedicated helper function the_map() that wraps the output with visual border styling:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;void the_map(char seat[4][4]) {&lt;br&gt;&lt;br&gt;
    cout &amp;lt;&amp;lt; "～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～" &amp;lt;&amp;lt; endl;&lt;br&gt;
    for (int i = 0; i &amp;lt; 4; i++) {&lt;br&gt;
        cout &amp;lt;&amp;lt; endl;&lt;br&gt;
        for (int j = 0; j &amp;lt; 4; j++) {&lt;br&gt;
            cout &amp;lt;&amp;lt; seat[i][j] &amp;lt;&amp;lt; " ";&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
    cout &amp;lt;&amp;lt; "\n～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～" &amp;lt;&amp;lt; endl;&lt;br&gt;
}&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conflict Prevention &amp;amp; Checkout Logic
Before marking a seat as taken, the system checks if seats[e][r] == 'X'. If occupied, it displays an error message preventing double-booking; otherwise, it reserves the seat and updates the ticket counter.
🛠️ Complete Source Code
Here is the complete implementation from my training exercise:&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;p&gt;using namespace std;&lt;/p&gt;

&lt;p&gt;void the_map(char seat[4][4]) {&lt;br&gt;&lt;br&gt;
    cout &amp;lt;&amp;lt; "～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～" &amp;lt;&amp;lt; endl;&lt;br&gt;
    for (int i = 0; i &amp;lt; 4; i++) {&lt;br&gt;
        cout &amp;lt;&amp;lt; endl;&lt;br&gt;
        for (int j = 0; j &amp;lt; 4; j++) {&lt;br&gt;
            cout &amp;lt;&amp;lt; seat[i][j] &amp;lt;&amp;lt; " ";&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
    cout &amp;lt;&amp;lt; "\n～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～～⁠～⁠～" &amp;lt;&amp;lt; endl;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;int main() {&lt;br&gt;&lt;br&gt;
    bool next_ = 1;&lt;br&gt;
    int totalTickets = 0;&lt;br&gt;
    double TICKET_PRICE = 12.5;&lt;br&gt;
    double totalPrice = 0;&lt;br&gt;
    int off;&lt;br&gt;
    char seats[4][4];&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cout &amp;lt;&amp;lt; "Do you want to reserve a seat?" &amp;lt;&amp;lt; endl;
cout &amp;lt;&amp;lt; "Enter 4 to exit, or any other number to proceed: ";

do {
    cin &amp;gt;&amp;gt; off;
} while (off == 4);

// Initialize map with available seats '*'
for (int e = 0; e &amp;lt; 4; e++) {
    for (int r = 0; r &amp;lt; 4; r++) {
        seats[e][r] = '*';
    }
}

// Main booking loop
do {
    for (int e = 0; e &amp;lt; 4; e++) {
        cout &amp;lt;&amp;lt; endl;
        for (int r = 0; r &amp;lt; 4; r++) {
            cout &amp;lt;&amp;lt; seats[e][r] &amp;lt;&amp;lt; " ";
        }
    }

    int g, h;
    cout &amp;lt;&amp;lt; "\n\nChoose row (1-4): ";
    cin &amp;gt;&amp;gt; g;
    cout &amp;lt;&amp;lt; "Choose column (1-4): ";
    cin &amp;gt;&amp;gt; h;

    int e = g - 1;
    int r = h - 1;

    if (seats[e][r] == 'X') {
        cout &amp;lt;&amp;lt; "Conflict: Seat already taken!" &amp;lt;&amp;lt; endl;
    } else {
        seats[e][r] = 'X';
        totalTickets++;
    }

    the_map(seats);

    cout &amp;lt;&amp;lt; "Enter 1 to continue booking, or 0 to exit: ";
    cin &amp;gt;&amp;gt; next_;

} while (next_);

// Summary calculation
totalPrice = TICKET_PRICE * totalTickets;
cout &amp;lt;&amp;lt; "\n----------------------------------------" &amp;lt;&amp;lt; endl;
cout &amp;lt;&amp;lt; "Total tickets booked: " &amp;lt;&amp;lt; totalTickets &amp;lt;&amp;lt; endl;
cout &amp;lt;&amp;lt; "Total price: $" &amp;lt;&amp;lt; totalPrice &amp;lt;&amp;lt; endl;
cout &amp;lt;&amp;lt; "----------------------------------------" &amp;lt;&amp;lt; endl;

return 0;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
      <category>coding</category>
      <category>cpp</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>My training</title>
      <dc:creator>May cccc</dc:creator>
      <pubDate>Thu, 03 Sep 2026 18:07:52 +0000</pubDate>
      <link>https://dev.to/maya__354c16ced7bfb8/my-training-23bj</link>
      <guid>https://dev.to/maya__354c16ced7bfb8/my-training-23bj</guid>
      <description></description>
    </item>
  </channel>
</rss>
