<?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: Mark Mahoney</title>
    <description>The latest articles on DEV Community by Mark Mahoney (@markm208).</description>
    <link>https://dev.to/markm208</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F553730%2F45334a02-eedc-4949-b410-0ad019030a23.jpeg</url>
      <title>DEV Community: Mark Mahoney</title>
      <link>https://dev.to/markm208</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/markm208"/>
    <language>en</language>
    <item>
      <title>An Animated Introduction to Programming in C++ [Full Course]</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Sun, 23 Mar 2025 01:33:31 +0000</pubDate>
      <link>https://dev.to/markm208/an-animated-introduction-to-programming-in-c-full-course-3612</link>
      <guid>https://dev.to/markm208/an-animated-introduction-to-programming-in-c-full-course-3612</guid>
      <description>&lt;p&gt;This post is a comprehensive introduction to programming in C++. You don't need to have any previous programming experience in order to begin. Along the way, you will learn about the flow of control, variables, conditional statements, loops, arrays, functions, structured data, pointers and dynamic memory, classes, common data structures, and working with databases.&lt;/p&gt;

&lt;p&gt;There are practice problems in each section so that you can practice while learning from the content. These are in the '&lt;strong&gt;Hands-On Practice&lt;/strong&gt;' section in each section. Integrated Development Environments (IDEs) are tools that allow you to write your own programs. There are some great, free C++ IDEs out there like &lt;a href="https://visualstudio.microsoft.com/vs/community/" rel="noopener noreferrer"&gt;Visual Studio&lt;/a&gt;, &lt;a href="https://developer.apple.com/xcode/" rel="noopener noreferrer"&gt;Xcode&lt;/a&gt;, and &lt;a href="https://www.jetbrains.com/clion/download" rel="noopener noreferrer"&gt;CLion&lt;/a&gt;. The simplest way to get started is to use a web-based IDE. &lt;a href="https://replit.com/" rel="noopener noreferrer"&gt;replit&lt;/a&gt; works great, use it if you are unable to install one of the other IDEs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Playbacks
&lt;/h2&gt;

&lt;p&gt;This material will not be delivered like traditional online tutorials or video series. Each section will have links to interactive &lt;strong&gt;code playbacks&lt;/strong&gt; that visually animate changes made to a program in a step-by-step manner, helping you understand how it was written. &lt;/p&gt;

&lt;p&gt;A code playback shows how a program evolves by replaying all the steps in its development. It has an author-supplied narrative, screenshots, whiteboard-style drawings, and self-grading multiple choice questions to make the learning process more dynamic and interactive.&lt;/p&gt;

&lt;p&gt;Here's a short YouTube video explaining how to view a code playback:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/uYbHqCNjVDM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Playback Press
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://playbackpress.com/books" rel="noopener noreferrer"&gt;Playback Press&lt;/a&gt; is a platform for sharing interactive code walkthroughs created by Mark Mahoney, a professor of computer science. These books provide interactive programming lessons through step-by-step animations, AI tutoring, and quizzes.&lt;/p&gt;

&lt;p&gt;If you want to see the full C++ 'book', you can go here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://playbackpress.com/books/cppbook" rel="noopener noreferrer"&gt;An Animated Introduction to Programming in C++&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;by Mark Mahoney&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Mark also built &lt;a href="https://markm208.github.io/" rel="noopener noreferrer"&gt;Storyteller&lt;/a&gt;, the free and open-source tool that powers code playbacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Tutor
&lt;/h2&gt;

&lt;p&gt;When viewing a code playback, you can ask an AI tutor about the code. It answers questions clearly and patiently, making it a helpful resource for learners. You can also ask the AI tutor to generate new self-grading multiple-choice questions to test your knowledge of what you are learning.&lt;/p&gt;

&lt;p&gt;To access the AI tutor and self-grading quizzes, simply create a free account on Playback Press and add the &lt;a href="https://playbackpress.com/books/cppbook" rel="noopener noreferrer"&gt;book&lt;/a&gt; to your bookshelf. It is still free but you do need a free account in order to access the AI features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Part 1: Variables&lt;/li&gt;
&lt;li&gt;Part 2: Selection&lt;/li&gt;
&lt;li&gt;Part 3: Looping&lt;/li&gt;
&lt;li&gt;Part 4: Arrays&lt;/li&gt;
&lt;li&gt;Part 5: Functions&lt;/li&gt;
&lt;li&gt;Part 6: Vectors&lt;/li&gt;
&lt;li&gt;Part 7: Structured Data&lt;/li&gt;
&lt;li&gt;Part 8: Pointers&lt;/li&gt;
&lt;li&gt;Part 9: Object-Oriented Programming&lt;/li&gt;
&lt;li&gt;Part 10: Data Structures&lt;/li&gt;
&lt;li&gt;Part 11: SQLite Databases&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Part 1: Variables
&lt;/h1&gt;

&lt;p&gt;Simply watching an experienced artist paint is not enough to say that you have learned how to become a painter. Watching an experienced artist is an important &lt;em&gt;part&lt;/em&gt; of the learning process but you can only call yourself a painter after struggling to make your own paintings first. There are a lot of similarities between learning to paint and learning to program. The only way to truly learn programming is through practice!&lt;/p&gt;

&lt;p&gt;So, let's get started. Follow along with the code playbacks below. Click the links below to load each code playback (it may help to open them in a new tab). Click on the playback comments on the left-hand side of the playback screen to step through the code's development. &lt;/p&gt;

&lt;h2&gt;
  
  
  Flow of Control
&lt;/h2&gt;

&lt;p&gt;The following playback explains the &lt;strong&gt;flow of control&lt;/strong&gt; in a program by describing how to print to the screen from it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/1" rel="noopener noreferrer"&gt;1.1 Name printer program&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Variables and Types
&lt;/h2&gt;

&lt;p&gt;This next group of programs describes declaring variables to hold data in a program. All variables have a &lt;strong&gt;type&lt;/strong&gt; which specifies what can be stored in them and what operations can be performed on them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/2" rel="noopener noreferrer"&gt;1.2 Distance formula&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/3" rel="noopener noreferrer"&gt;1.3 Basic types in C++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/4" rel="noopener noreferrer"&gt;1.4 Number types&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/5" rel="noopener noreferrer"&gt;1.5 Characters and strings&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reading from the Keyboard
&lt;/h2&gt;

&lt;p&gt;This final group of programs builds on previous concepts and shows how to prompt the user for input.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/6" rel="noopener noreferrer"&gt;1.6 Weekly pay calculator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/7" rel="noopener noreferrer"&gt;1.7 Distance formula revisited&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/8" rel="noopener noreferrer"&gt;1.8 Gas Mileage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program that prompts the user for three integers- one representing an hour, one representing a minute, and one representing a second. Next, calculate the number of seconds until midnight based on the time that was input. Print the number of seconds until midnight on the screen.&lt;/p&gt;

&lt;p&gt;Then, prompt the user for a single integer representing the number of seconds until midnight. From that value, do the reverse calculation to find the hour, minute, and second of that time. Print it to the screen in a time format HH:MM:SS.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 2: Selection
&lt;/h1&gt;

&lt;p&gt;This section discusses altering the flow of control with &lt;code&gt;if/else&lt;/code&gt; statements. These statements ask the computer to evaluate whether a condition is &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt; and changes the flow of control based on the answer. It also explains the data type, &lt;code&gt;bool&lt;/code&gt;, which can hold either true or false and it shows a few examples of how to use selection with &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;if/else&lt;/code&gt;, &lt;code&gt;if/else if/else&lt;/code&gt;, and &lt;code&gt;switch&lt;/code&gt; statements. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/1" rel="noopener noreferrer"&gt;2.1 Booleans&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/2" rel="noopener noreferrer"&gt;2.2 Even/odd calculator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/3" rel="noopener noreferrer"&gt;2.3 Overtime pay with an if/else&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/4" rel="noopener noreferrer"&gt;2.4 Water temperature&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/5" rel="noopener noreferrer"&gt;2.5 Switch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, try to write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to write a program to determine if one date comes after another. The program will ask for two sets of dates. Next, the program will determine if the first date comes before, is equal to, or comes after.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in the first month: 2
Enter in the first day: 21
Enter in the first year: 2012

Enter in the second month: 2
Enter in the second day: 22
Enter in the second year: 2011

The first date comes after the second.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to write a programs that prompts the user for a date and determines if that date is valid. For example, 9/19/2017 is a valid date but these are not valid dates:&lt;/p&gt;

&lt;p&gt;4/31/2006 (only 30 days in April)&lt;br&gt;
2/29/2005 (not a leap year)&lt;br&gt;
16/1/2010 (invalid month)&lt;br&gt;
4/59/2013 (invalid day)&lt;/p&gt;

&lt;p&gt;If the date is correct print it out. If it is incorrect display an error message explaining why the date is not correct. &lt;/p&gt;
&lt;h3&gt;
  
  
  Problem 3
&lt;/h3&gt;

&lt;p&gt;Problem 3 asks you to write a program that will calculate change for a sales purchase. Your program should prompt for a sales price. Validate that the data entered is a number greater than 0. If the data entered is incorrect, display an error message and end the program. Next, prompt the user for the amount that the customer will pay to the cashier. Validate that this value is greater than or equal to the sales price. If it is not, display an error message and end the program.&lt;/p&gt;

&lt;p&gt;If the entry is correct, your program must calculate the amount of change to return to the user.  Next, calculate what bills and coins that the the cashier needs to return to the customer. The fewest number of paper bills and coins should be returned. You can make change in many different combinations, however, the only correct implementation is the one that returns the fewest paper bills and coins.&lt;/p&gt;

&lt;p&gt;Display the number of each of the bills and coins. Here is a sample run of the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in a sales amount: $20.38
Enter in the amount the customer pays: $30.00

The change due back is $9.62

You should give the customer this change:
0 $100 bills
0 $50 bills
0 $20 bills
0 $10 bills
1 $5 bills
4 $1 bills
1 Half Dollars
0 Quarters
1 Dimes
0 Nickels
2 Pennies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because of the way arithmetic works with float variables, storing the monetary values as floats may cause some problems. For example, if you had a float variable that held 1.29 to represent $1.29 and you subtracted the .05 from it (to represent giving back a nickel) you would think that you would be left with exactly 1.24. Unfortunately, the computer might store that value or it might store 1.2399999 or 1.2400001 instead of exactly 1.24. These very small inconsistencies can cause a problem calculating the number of pennies to return. Consider converting the amounts into ints to solve this problem.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 3: Looping
&lt;/h1&gt;

&lt;p&gt;This group of playbacks discusses repeatedly executing the same code over and over again in a loop. They show how to create count controlled and event controlled loops with the &lt;code&gt;while&lt;/code&gt; keyword, nested loops, a &lt;code&gt;for&lt;/code&gt; loop, and how to exit a loop with &lt;code&gt;break&lt;/code&gt; and &lt;code&gt;continue&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/1" rel="noopener noreferrer"&gt;3.1 A simple loop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/2" rel="noopener noreferrer"&gt;3.2 More loops&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/3" rel="noopener noreferrer"&gt;3.3 Summation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/4" rel="noopener noreferrer"&gt;3.4 Nested loop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/5" rel="noopener noreferrer"&gt;3.5 &lt;code&gt;for&lt;/code&gt; loop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/6" rel="noopener noreferrer"&gt;3.6 Capitalization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/7" rel="noopener noreferrer"&gt;3.7 &lt;code&gt;break&lt;/code&gt; and &lt;code&gt;continue&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to write a program that will calculate the sum of the squares from 1 up to and including that number. For example if the user entered in the value 5 then the sum of the squares for the numbers one through five would be (1 + 4 + 9 + 16 + 25) = 55.&lt;/p&gt;

&lt;p&gt;Your program should repeatedly calculate this value until the user enters in a value of -99. This is the sentinel value that the program uses to determine when to quit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in an integer number(ex. 10), -99 to quit: 5
The sum of the squares up to 5 is 55

Enter in an integer number(ex. 10), -99 to quit: 4
The sum of the squares up to 4 is 30

Enter in an integer number(ex. 10), -99 to quit: -99
Have a nice day!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to write a program that will determine whether a number is prime or not. A prime number is any number that is evenly divisible only by the number one and itself.&lt;/p&gt;

&lt;p&gt;7 is prime because the only numbers that divide into it without a remainder are 1 and 7.&lt;/p&gt;

&lt;p&gt;12 is not prime because the numbers that divide into it evenly are 1, 2, 3, 4, 6, and 12.&lt;/p&gt;

&lt;p&gt;Your program will prompt for a number and then display whether the number is prime or not. The number entered must be a positive number. Repeatedly prompt for a number until a positive number is entered.&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 3
&lt;/h3&gt;

&lt;p&gt;Problem 3 asks you to calculate a mortgage schedule for someone thinking of buying a new house. The inputs to determine a monthly schedule are the principal loan amount and the annual interest rate. Assume this will be a conventional 30 year loan.&lt;/p&gt;

&lt;p&gt;Your program should prompt for these inputs and find a monthly payment using this calculation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                                   monthly interest rate                                              
monthly payment =  ------------------------------------------------- * principal
                   1 - (1 + monthly interest rate)^-number of months
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that you will have to calculate the monthly interest rate (the annual interest rate divided by 12.0) and number of months (360 for a 30 year loan). The ^ in this formula means raise one number to a power. There is a function called &lt;code&gt;pow()&lt;/code&gt; which raises one number to another and returns the result. For example, if one wanted to raise 2 to the -3rd power they would do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;float result = pow(2.0, -3.0);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you have calculated the monthly payment create a summary of the loan characteristics. Display the loan amount, the interest rate, the monthly payment, the total amount paid for the loan, the total amount of interest paid, and the ratio of amount paid over the principal.&lt;/p&gt;

&lt;p&gt;After you have printed the summary you can begin to make the schedule. Prompt the user for the ending month to display in the schedule. The schedule should display the month number, the monthly payment, the amount paid in principal in that month, the amount paid in interest in that month, and the amount remaining in the principal (the amount paid in principle each month is deducted from the remaining principle). A month's interest amount is equal to monthly interest rate times the remaining principal. The monthly principal is the difference between the monthly payment and the monthly interest paid. Remember to update the remaining principal after every month.&lt;/p&gt;

&lt;p&gt;After each year of the schedule has been printed display a message with the year number.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 4: Arrays
&lt;/h1&gt;

&lt;p&gt;This batch of programs shows how to use arrays in C/C++. An array is a collection of variables (all of the same type) that have a single name and sit next to each other in memory. Loops are almost always used to go through the elements of an array. They show how to create two and three dimensional arrays and use the random number generator in C/C++.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/1" rel="noopener noreferrer"&gt;4.1 Arrays&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/2" rel="noopener noreferrer"&gt;4.2 Average and standard deviation of an array of values&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/3" rel="noopener noreferrer"&gt;4.3 Problems with arrays&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/4" rel="noopener noreferrer"&gt;4.4 Flipping coins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/5" rel="noopener noreferrer"&gt;4.5 Multi-dimensional arrays&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to write a program that displays a menu with three options. &lt;/p&gt;

&lt;p&gt;The first option allows the user to enter in a month number (between 1-12) and a day number within that month (1-31) and calculates the day number in the year. January 1 is day 1. January 31 is day 31. February 1 is day 32. February 28 is day 59. December 31 is day 365 (don’t worry about leap year). If the user enters an invalid combination (like February 31) the program should continuously prompt the user to enter in a new value until they enter a valid date.&lt;/p&gt;

&lt;p&gt;The second menu option allows the user to enter in a day number (1-365) and prints out the month name and day number of that month. If the user enters in 59 the program should print out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Day 59 is February 28
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the user enters an invalid day number the program should continuously prompt the user to enter in a new value until it is in the correct range.&lt;/p&gt;

&lt;p&gt;The last menu option allows the user to quit the program. The menu should repeatedly be displayed until the user chooses to quit the program.&lt;/p&gt;

&lt;p&gt;Use an array of integers to hold the number of days in each of the months. Use the array to keep a running sum to help with your day calculations. You may also want to create an array of strings with the month names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int numDaysInMonths[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a sample run of the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Enter in a month and day
2. Enter in a day number
3. Quit
Enter in a menu option: 1

Enter in a month number: 2
Enter in a day number: 1

February 1 is day 32

1. Enter in a month and day
2. Enter in a day number
3. Quit
Enter in a menu option: 2

Enter in a day number: 59
Day 59 is February 28

1. Enter in a month and day
2. Enter in a day number
3. Quit
Enter in a menu option: 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to create a program that will find the number of days in between two dates.&lt;/p&gt;

&lt;p&gt;For example, if one would like to know how many days are in between two dates (1/1/2000) and (3/19/2030). The program must find out how many whole days are in between these two dates (include the starting and ending date).&lt;/p&gt;

&lt;p&gt;If the two dates are in the same year then the algorithm to find the number of days may be different than if the dates are in different years. Your program must handle each case.&lt;/p&gt;

&lt;p&gt;Here is a sample run of the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in a start month: 1
Enter in a start day: 1
Enter in a start year: 2000

Enter in an end month: 3
Enter in an end day: 19
Enter in an end year: 2030

There are 11035 days in between 1/1/2000 and 3/19/2030
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Part 5: Functions
&lt;/h1&gt;

&lt;p&gt;This group of playbacks describes another flow of control altering mechanism called functions. A function is a named block of code that can be &lt;em&gt;called&lt;/em&gt; and the flow of control will jump to it. &lt;/p&gt;

&lt;p&gt;When calling a function some data can be passed into it (called parameters) and the function can return a piece of data when it is complete (called a return value). These playbacks discuss passing in data 'by value' versus 'by reference'. They show that every variable has a limited lifetime that it sits in memory, or scope.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/1" rel="noopener noreferrer"&gt;5.1 Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/2" rel="noopener noreferrer"&gt;5.2 Value returning functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/3" rel="noopener noreferrer"&gt;5.3 Functions with parameters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/4" rel="noopener noreferrer"&gt;5.4 Passing parameters by reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/5" rel="noopener noreferrer"&gt;5.5 The scope of variables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/6" rel="noopener noreferrer"&gt;5.6 Prime number function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/7" rel="noopener noreferrer"&gt;5.7 Passing arrays to functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to extend the prime number problem from a previous section. Write a program that includes a function that will print all the prime numbers in a range. The program will ask for a lower bound and an upper bound and print all the primes in that range.&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to write a function that takes an integer year number and returns a &lt;code&gt;bool&lt;/code&gt; whether that year is a leap year or not. The calculation for leap year is as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;most years evenly divisible by four are leap years&lt;/li&gt;
&lt;li&gt;if a year is divisible by four and is a century year, like 1800 or 1900, then it is NOT a leap year&lt;/li&gt;
&lt;li&gt;if a century year also happens to be divisible by 400, like 2000 or 2400, then it is a leap year&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The function should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bool isLeapYear(int year)
{
    //calculate if it is leap year or not and return true or false
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 3
&lt;/h3&gt;

&lt;p&gt;Problem 3 asks you to write a program that will print a calendar for a whole year given the day that January 1st falls on. Your program will prompt for the day that January 1st falls on and the year. You must print the calendar for all 12 months of that year. The options for the first day of the year will be entered with the first three letters of each of the seven days of the week from Sunday ('sun') to Saturday ('sat').&lt;/p&gt;

&lt;p&gt;The year does not need to be validated, but the day of the week does. You should not allow the user to enter in a value other than 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', or 'sat'.&lt;/p&gt;

&lt;p&gt;The format of your calendar should be very similar to the example below. You must use at least one function in addition to the main function. Pass data between functions, do not use global variables.&lt;/p&gt;

&lt;p&gt;The final requirement is that your program should only display one month at a time and then wait for some user input before continuing.&lt;/p&gt;

&lt;p&gt;It is very important that you come up with a plan to solve this program before you begin coding (as it is with every program). Think about how you would print a single month's calendar given the day of the month that it begins on.&lt;/p&gt;

&lt;p&gt;Sample Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What year do you want the calendar for?
2003

What day of the week does January 1st fall on (sun for Sunday, mon for Monday, etc..)?
s
Invalid Entry- please enter the first three letters of the day

What day of the week does January 1st fall on (sun for Sunday, mon for Monday, etc..)?
wed

    January 2003
 S  M  T  W  T  F  S
---------------------
          1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Do you want to continue? y

   February 2003
 S  M  T  W  T  F  S
---------------------
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

Do you want to continue? y
...
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Part 6: Vectors
&lt;/h1&gt;

&lt;p&gt;C++ comes with the Standard Template Library (STL) which is a collection of different containers. This section will cover vectors. A &lt;code&gt;vector&lt;/code&gt; is an array-based container that holds data very much like an array does but it is &lt;em&gt;smarter&lt;/em&gt;. It knows how many elements are in it and it can grow as the program is running. It also shows how to read and write data from a file, efficiently search through an array-based container, sort values, and more.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/1" rel="noopener noreferrer"&gt;6.1 &lt;code&gt;vector&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/2" rel="noopener noreferrer"&gt;6.2 Passing a &lt;code&gt;vector&lt;/code&gt; to a function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/3" rel="noopener noreferrer"&gt;6.3 Advanced features of &lt;code&gt;vector&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/4" rel="noopener noreferrer"&gt;6.4 Reading from a file and storing in a &lt;code&gt;vector&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/5" rel="noopener noreferrer"&gt;6.5 Linear search and binary search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/6" rel="noopener noreferrer"&gt;6.6 Bubble sort&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/7" rel="noopener noreferrer"&gt;6.7 Writing to a file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/8" rel="noopener noreferrer"&gt;6.8 Two dimensional &lt;code&gt;vector&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program to read in whole words from a file and store them in a vector of strings. Create a simple text file (.txt) using your coding editor. Then, add a few sentences of text to it. Strip any punctuation marks from the words and make them all lowercase letters. Only store a word in the vector if it is not already present. &lt;/p&gt;




&lt;h1&gt;
  
  
  Part 7: Structured Data
&lt;/h1&gt;

&lt;p&gt;This section describes how to use structured data types. Structured data types allow you to group related data together so that it can be passed around easily.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/1" rel="noopener noreferrer"&gt;7.1 Simple &lt;code&gt;struct&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/2" rel="noopener noreferrer"&gt;7.2 Hierarchical &lt;code&gt;struct&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/3" rel="noopener noreferrer"&gt;7.3 &lt;code&gt;vector&lt;/code&gt;s as members of &lt;code&gt;struct&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/4" rel="noopener noreferrer"&gt;7.4 &lt;code&gt;struct&lt;/code&gt;s with a &lt;code&gt;vector&lt;/code&gt; of objects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/5" rel="noopener noreferrer"&gt;7.5 Calculus with &lt;code&gt;struct&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program that has a struct to represent a cell phone. Every cell phone has a model name and manufacturer along with a camera with a mega-pixel resolution. For example, one may want to store information about an Apple IPhone X with a 12 MP camera or a Google Pixel 4 with a 16 MP camera.&lt;/p&gt;

&lt;p&gt;Your program will create three cell phone objects, fill them, and then add them to a vector. Lastly, print out the information about each cell phone on the screen.&lt;/p&gt;

&lt;p&gt;Write a function that takes a cell phone object by reference and prompts the user to enter in the model, manufacturer, and camera resolution. Write another function that prints information about a cell phone. Write a function that takes a vector of cell phones and prints each one.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 8: Pointers
&lt;/h1&gt;

&lt;p&gt;This section describes pointers in C/C++. A pointer is a variable that holds the address of another variable. Pointers are important because they allow us to use a special section of memory called the 'heap'. It discusses the different types of memory that can be used in a program (global, local, and dynamic).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/1" rel="noopener noreferrer"&gt;8.1 Simple pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/2" rel="noopener noreferrer"&gt;8.2 Pointer to an object&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/3" rel="noopener noreferrer"&gt;8.3 Vectors of pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/4" rel="noopener noreferrer"&gt;8.4 Arrays are pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/5" rel="noopener noreferrer"&gt;8.5 Passing data to functions with pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/6" rel="noopener noreferrer"&gt;8.6 Comparing pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/7" rel="noopener noreferrer"&gt;8.7 Three types of variables- global, local, and dynamic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/8" rel="noopener noreferrer"&gt;8.8 Dynamic variables example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/9" rel="noopener noreferrer"&gt;8.9 Dangling pointers and null pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/10" rel="noopener noreferrer"&gt;8.10 Dynamic array of students&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program that will read a sequence of words from the keyboard and store them in a dynamic array of strings. Use the word 'quit' as the word that terminates the input. Print the words back to the screen in the order in which they were entered each on its own line. Do not store the same word twice.&lt;/p&gt;

&lt;p&gt;Up until now the size of an array has been determined at compile time, now that you know about pointers and about the keyword &lt;code&gt;new&lt;/code&gt;, write a program which is not restricted to selecting an upper bound at compile time for the number of words which can be read in.&lt;/p&gt;

&lt;p&gt;One way to do this is to use &lt;code&gt;new&lt;/code&gt; to create arrays of strings on the fly. Each time an array fills up, dynamically create an array which is twice as large, copy over the contents of the existing array to the new array, and continue (remember to &lt;code&gt;delete&lt;/code&gt; the original array). Start with an array of 5 elements.&lt;/p&gt;

&lt;p&gt;Here is an example of the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in some text and end with the word quit:
This lab asks you to write a program that will read a sequence of words from the keyboard and store them in a dynamic array of strings. Use the word 'quit' as the word that terminates the input. Print the words back to the screen in the order in which they were entered each on its own line. Do not store the same word twice. quit

Doubling Array from 5 to 10
Doubling Array from 10 to 20
Doubling Array from 20 to 40
Doubling Array from 40 to 80
1. This
2. lab
3. asks
4. you
5. to
6. write
7. a
8. program
9. that
10. will
11. read
12. sequence
13. of
14. words
15. from
16. the
17. keyboard
18. and
19. store
20. them
21. in
22. dynamic
23. array
24. strings.
25. Use
26. word
27. 'quit'
28. as
29. terminates
30. input.
31. Print
32. back
33. screen
34. order
35. which
36. they
37. were
38. entered
39. each
40. on
41. its
42. own
43. line.
44. Do
45. not
46. same
47. twice.
Press any key to continue . . .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Part 9: Object-Oriented Programming
&lt;/h1&gt;

&lt;p&gt;This section discusses object-oriented programming using classes in C++. A class is like a &lt;code&gt;struct&lt;/code&gt; except that in addition to collecting data it also collects methods that work on that data. This is called encapsulation. It also discusses inheritance and polymorphism that make it easier to reuse code. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/1" rel="noopener noreferrer"&gt;9.1 Simple class&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/2" rel="noopener noreferrer"&gt;9.2 A class with data members&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/3" rel="noopener noreferrer"&gt;9.3 A class with objects for data members&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/4" rel="noopener noreferrer"&gt;9.4 Common word analysis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/5" rel="noopener noreferrer"&gt;9.5 Student and course registration system&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/6" rel="noopener noreferrer"&gt;9.6 Inheritance and polymorphism&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/7" rel="noopener noreferrer"&gt;9.7 Shape inheritance hierarchy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/8" rel="noopener noreferrer"&gt;9.8 Inheritance and polymorphism in C++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/9" rel="noopener noreferrer"&gt;9.9 Copy Constructor Example&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to create a Date class to represent a date.&lt;/p&gt;

&lt;p&gt;There should be an int for the day number, month number, and year number declared in the private section. Instead of having a setter for each of those have one method called setDate(int m, int d, int y) that sets the date. You can have a getter method for each piece of data.&lt;/p&gt;

&lt;p&gt;Add two constructors- one that takes no data and sets the date to 1/1/2000 and another that takes three ints to set the date.&lt;/p&gt;

&lt;p&gt;Include a print() method that will print the date in this format: MM/DD/YYYY and a method called printLong() that prints in this format: MonthName Day, Year. For example today's date would print &lt;code&gt;November 16, 2021&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Include a method to add some number of days, months, and years to a Date:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void addDays(int d)
void addMonths(int m)
void addYears(int y)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to create some related classes for playing card games. The data needed to be stored for a card is a numeric value and a suit. A card is responsible for being able to display itself. For example, when we want to display a two of hearts, ten of diamonds, jack of clubs, or ace of spades the output would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 of Hearts
10 of Diamonds
J of Clubs
A of Spades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, create a deck class. A deck is a collection of fifty-two cards. Each card is unique. There should be a card with a numeric value from two to the ace in each of the four suits. The responsibilities of the deck class are that it must be able to shuffle itself and deal out some number of cards from the deck. To shuffle the deck you will need to randomly move cards around in the deck. One can generate a random number in C++ using the rand() function.&lt;/p&gt;

&lt;p&gt;When dealing out cards the user will ask the deck for some number of cards. If there are enough cards in the deck it should deal those cards out. Once a card is dealt from the deck it cannot be dealt again from the same deck. The user will pass in a vector of cards and the deck will fill it with the number of cards requested. If there aren't enough cards in the deck print an error message and then kill the program with an exit(0).&lt;/p&gt;

&lt;p&gt;When creating a class one always has to think about the data needed for the class and the responsibilities of the class. The data for the class should be private and an interface to the class should be provided. Think about how each card and deck should be constructed. Write at least one constructor for each class. Write the card class first and test it in a driver program. Then work on the deck class. To test the deck, create a deck object, ask for 52 cards, and print each of those cards to the screen.&lt;/p&gt;

&lt;p&gt;Next, alter the program so that it will allow a person to evaluate the probabilities of getting certain poker hands. Poker is a card game played with a deck of 52 cards. In this program you only need to handle the five card variety of poker. The program will repeatedly get groups of five cards from the deck and count how many times each hand occurs.&lt;/p&gt;

&lt;p&gt;In most variations of poker the precedence of hands goes like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Royal Flush- 5 cards that are a straight (5 cards in numeric order) and a flush (5 cards that are the same suit) from the 10 to the Ace.
Straight Flush- 5 cards that are a straight (5 cards in numeric order) and a flush (5 cards that are the same suit).
Four of a Kind- any 4 cards with the same number.
Full House- three of a kind (3 cards with the same number) and a pair (two cards with the same number).
Flush- any 5 cards of the same suit.
Straight- any 5 cards in numeric order.
Three of a Kind- any 3 cards with the same number.
Two Pair- 2 sets of pairs.
Pair- any 2 cards with the same number.
High Card in your Hand- if you don't have any of the above, your high card is the best hand.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will need to create additional classes with more responsibilities than the Deck and Card classes.&lt;/p&gt;

&lt;p&gt;Your program needs an 'evaluator' that can look at a collection of cards and determine the best hand that can be made from those cards. In order to determine probabilities, deal a great number of hands and keep track of how many times each hand shows up. In other words, your program might create 100,000 collections of five cards to be evaluated. The evaluator will count how many times a royal flush comes up, how many times a straight flush comes up, an so on. Your program will show the probabilities as percentages of the likelihood of getting each hand.&lt;/p&gt;

&lt;p&gt;Below is a driver to illustrate how to use the evaluator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//five card evaluator&lt;/span&gt;
    &lt;span class="c1"&gt;//create a poker evaluator for 5 card poker&lt;/span&gt;
    &lt;span class="n"&gt;PokerEvaluator&lt;/span&gt; &lt;span class="n"&gt;fiveCardPokerEvaluator&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;//set the number of hands to play- one hundred thousand this time&lt;/span&gt;
    &lt;span class="n"&gt;fiveCardPokerEvaluator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setNumberOfHandsToPlay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;//play all the hands and track the statistics, then print the results to the screen&lt;/span&gt;
    &lt;span class="n"&gt;fiveCardPokerEvaluator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;playAndDisplay&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Part 10: Data Structures
&lt;/h1&gt;

&lt;p&gt;This section describes how to build some common data structures: a hash table, a binary search tree, and a graph. It also describes how to use the STL &lt;code&gt;unordered_map&lt;/code&gt; class.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/1" rel="noopener noreferrer"&gt;10.1 Simple linked list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/2" rel="noopener noreferrer"&gt;10.2 Simple hash table&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/3" rel="noopener noreferrer"&gt;10.3 More complex hash table&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/4" rel="noopener noreferrer"&gt;10.4 STL &lt;code&gt;unordered_map&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/5" rel="noopener noreferrer"&gt;10.5 Binary search tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/6" rel="noopener noreferrer"&gt;10.6 Graph adjacency matrix&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program that includes a class which is equivalent of the &lt;code&gt;vector&lt;/code&gt; called SafeArray. SafeArray has a method called &lt;code&gt;at&lt;/code&gt; that returns the element at the specified position. A SafeArray maintains a pointer to an array on the heap. Use the pointer to make the array grow and shrink with calls to &lt;code&gt;push_back&lt;/code&gt; and &lt;code&gt;pop_back&lt;/code&gt;. The SafeArray will have a method called &lt;code&gt;size&lt;/code&gt; that returns the number of items in it. Include a default constructor that sets the initial size of the underlying array to hold 10 elements. Include a destructor to &lt;code&gt;delete&lt;/code&gt; the array when the SafeArray falls out of scope.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 11: SQLite Databases
&lt;/h1&gt;

&lt;p&gt;This section describes working with a SQLite database. SQLite is my favorite Database Management System (DBMS) because it is powerful and easy to add to any program. This section assumes that you are familiar with relational database design and SQL. &lt;/p&gt;

&lt;p&gt;The first program shows how to use the API to write and run SQL queries in a C++ program. In the second, some of the repetitive code is abstracted into a separate class. In the third, transactions in SQLite are explained and it shows that they can be used to ensure the ACID properties of a database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/1" rel="noopener noreferrer"&gt;11.1 The C++ SQLite API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/2" rel="noopener noreferrer"&gt;11.2 An Object Oriented Auction Program&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/3" rel="noopener noreferrer"&gt;11.3 SQLite Transactions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Extend the auction program from the second playback to include a method that prints the names and email addresses of all of the users who won an auction. Then write a method that prints item followed by the names and email addresses of anyone who made a bid on the item.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comments and Feedback
&lt;/h2&gt;

&lt;p&gt;You can find all of these code playbacks in the free 'book', &lt;a href="https://playbackpress.com/books/cppbook/" rel="noopener noreferrer"&gt;An Animated Introduction to Programming in C++&lt;/a&gt;. There are more free books here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/pybook" rel="noopener noreferrer"&gt;An Animated Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/sqlbook" rel="noopener noreferrer"&gt;Database Design and SQL for Beginners&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/workedsqlbook" rel="noopener noreferrer"&gt;Worked SQL Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/sqlitebook" rel="noopener noreferrer"&gt;Programming with SQLite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/webdevbook" rel="noopener noreferrer"&gt;An Introduction to Web Development from Back to Front&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cljbook" rel="noopener noreferrer"&gt;An Animated Introduction to Clojure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/exbook" rel="noopener noreferrer"&gt;An Animated Introduction to Elixir&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/rubybook" rel="noopener noreferrer"&gt;A Brief Introduction to Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/flutterbook" rel="noopener noreferrer"&gt;Mobile App Development with Dart and Flutter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/patternsbook" rel="noopener noreferrer"&gt;OO Design Patterns with Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/wordzearchbook" rel="noopener noreferrer"&gt;How I Built It: Word Zearch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Comments and feedback are welcome via email: &lt;a href="//mailto:mark@playbackpress.com"&gt;mark@playbackpress.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Explore 'code playbacks' and C++ in this full intro course.</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Tue, 11 Mar 2025 16:08:42 +0000</pubDate>
      <link>https://dev.to/markm208/explore-code-playbacks-and-c-in-this-full-intro-course-337f</link>
      <guid>https://dev.to/markm208/explore-code-playbacks-and-c-in-this-full-intro-course-337f</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/markm208" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F553730%2F45334a02-eedc-4949-b410-0ad019030a23.jpeg" alt="markm208"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/markm208/an-animated-introduction-to-programming-in-c-4b6m" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;An Animated Introduction to Programming in C++&lt;/h2&gt;
      &lt;h3&gt;Mark Mahoney ・ Mar 10&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#cpp&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>cpp</category>
      <category>beginners</category>
    </item>
    <item>
      <title>An Animated Introduction to Programming in C++ [Full Course]</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Mon, 10 Mar 2025 23:19:06 +0000</pubDate>
      <link>https://dev.to/markm208/an-animated-introduction-to-programming-in-c-4b6m</link>
      <guid>https://dev.to/markm208/an-animated-introduction-to-programming-in-c-4b6m</guid>
      <description>&lt;p&gt;This post is a comprehensive introduction to programming in C++. You don't need to have any previous programming experience in order to begin. Along the way, you will learn about the flow of control, variables, conditional statements, loops, arrays, functions, structured data, pointers and dynamic memory, classes, common data structures, and working with databases.&lt;/p&gt;

&lt;p&gt;There are practice problems in each section so that you can practice while learning from the content. These are in the '&lt;strong&gt;Hands-On Practice&lt;/strong&gt;' section in each section. Integrated Development Environments (IDEs) are tools that allow you to write your own programs. There are some great, free C++ IDEs out there like &lt;a href="https://visualstudio.microsoft.com/vs/community/" rel="noopener noreferrer"&gt;Visual Studio&lt;/a&gt;, &lt;a href="https://developer.apple.com/xcode/" rel="noopener noreferrer"&gt;Xcode&lt;/a&gt;, and &lt;a href="https://www.jetbrains.com/clion/download" rel="noopener noreferrer"&gt;CLion&lt;/a&gt;. The simplest way to get started is to use a web-based IDE. &lt;a href="https://replit.com/" rel="noopener noreferrer"&gt;replit&lt;/a&gt; works great, use it if you are unable to install one of the other IDEs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Playbacks
&lt;/h2&gt;

&lt;p&gt;This material will not be delivered like traditional online tutorials or video series. Each section will have links to interactive &lt;strong&gt;code playbacks&lt;/strong&gt; that visually animate changes made to a program in a step-by-step manner, helping you understand how it was written. &lt;/p&gt;

&lt;p&gt;A code playback shows how a program evolves by replaying all the steps in its development. It has an author-supplied narrative, screenshots, whiteboard-style drawings, and self-grading multiple choice questions to make the learning process more dynamic and interactive.&lt;/p&gt;

&lt;p&gt;Here's a short YouTube video explaining how to view a code playback:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/uYbHqCNjVDM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Playback Press
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://playbackpress.com/books" rel="noopener noreferrer"&gt;Playback Press&lt;/a&gt; is a platform for sharing interactive code walkthroughs created by Mark Mahoney, a professor of computer science. These books provide interactive programming lessons through step-by-step animations, AI tutoring, and quizzes.&lt;/p&gt;

&lt;p&gt;If you want to see the full C++ 'book', you can go here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://playbackpress.com/books/cppbook" rel="noopener noreferrer"&gt;An Animated Introduction to Programming in C++&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;by Mark Mahoney&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Mark also built &lt;a href="https://markm208.github.io/" rel="noopener noreferrer"&gt;Storyteller&lt;/a&gt;, the free and open-source tool that powers code playbacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Tutor
&lt;/h2&gt;

&lt;p&gt;When viewing a code playback, you can ask an AI tutor about the code. It answers questions clearly and patiently, making it a helpful resource for learners. You can also ask the AI tutor to generate new self-grading multiple-choice questions to test your knowledge of what you are learning.&lt;/p&gt;

&lt;p&gt;To access the AI tutor and self-grading quizzes, simply create a free account on Playback Press and add the &lt;a href="https://playbackpress.com/books/cppbook" rel="noopener noreferrer"&gt;book&lt;/a&gt; to your bookshelf. It is still free but you do need a free account in order to access the AI features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Part 1: Variables&lt;/li&gt;
&lt;li&gt;Part 2: Selection&lt;/li&gt;
&lt;li&gt;Part 3: Looping&lt;/li&gt;
&lt;li&gt;Part 4: Arrays&lt;/li&gt;
&lt;li&gt;Part 5: Functions&lt;/li&gt;
&lt;li&gt;Part 6: Vectors&lt;/li&gt;
&lt;li&gt;Part 7: Structured Data&lt;/li&gt;
&lt;li&gt;Part 8: Pointers&lt;/li&gt;
&lt;li&gt;Part 9: Object-Oriented Programming&lt;/li&gt;
&lt;li&gt;Part 10: Data Structures&lt;/li&gt;
&lt;li&gt;Part 11: SQLite Databases&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Part 1: Variables
&lt;/h1&gt;

&lt;p&gt;Simply watching an experienced artist paint is not enough to say that you have learned how to become a painter. Watching an experienced artist is an important &lt;em&gt;part&lt;/em&gt; of the learning process but you can only call yourself a painter after struggling to make your own paintings first. There are a lot of similarities between learning to paint and learning to program. The only way to truly learn programming is through practice!&lt;/p&gt;

&lt;p&gt;So, let's get started. Follow along with the code playbacks below. Click the links below to load each code playback (it may help to open them in a new tab). Click on the playback comments on the left-hand side of the playback screen to step through the code's development. &lt;/p&gt;

&lt;h2&gt;
  
  
  Flow of Control
&lt;/h2&gt;

&lt;p&gt;The following playback explains the &lt;strong&gt;flow of control&lt;/strong&gt; in a program by describing how to print to the screen from it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/1" rel="noopener noreferrer"&gt;1.1 Name printer program&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Variables and Types
&lt;/h2&gt;

&lt;p&gt;This next group of programs describes declaring variables to hold data in a program. All variables have a &lt;strong&gt;type&lt;/strong&gt; which specifies what can be stored in them and what operations can be performed on them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/2" rel="noopener noreferrer"&gt;1.2 Distance formula&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/3" rel="noopener noreferrer"&gt;1.3 Basic types in C++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/4" rel="noopener noreferrer"&gt;1.4 Number types&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/5" rel="noopener noreferrer"&gt;1.5 Characters and strings&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reading from the Keyboard
&lt;/h2&gt;

&lt;p&gt;This final group of programs builds on previous concepts and shows how to prompt the user for input.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/6" rel="noopener noreferrer"&gt;1.6 Weekly pay calculator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/7" rel="noopener noreferrer"&gt;1.7 Distance formula revisited&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/1/8" rel="noopener noreferrer"&gt;1.8 Gas Mileage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program that prompts the user for three integers- one representing an hour, one representing a minute, and one representing a second. Next, calculate the number of seconds until midnight based on the time that was input. Print the number of seconds until midnight on the screen.&lt;/p&gt;

&lt;p&gt;Then, prompt the user for a single integer representing the number of seconds until midnight. From that value, do the reverse calculation to find the hour, minute, and second of that time. Print it to the screen in a time format HH:MM:SS.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 2: Selection
&lt;/h1&gt;

&lt;p&gt;This section discusses altering the flow of control with &lt;code&gt;if/else&lt;/code&gt; statements. These statements ask the computer to evaluate whether a condition is &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt; and changes the flow of control based on the answer. It also explains the data type, &lt;code&gt;bool&lt;/code&gt;, which can hold either true or false and it shows a few examples of how to use selection with &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;if/else&lt;/code&gt;, &lt;code&gt;if/else if/else&lt;/code&gt;, and &lt;code&gt;switch&lt;/code&gt; statements. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/1" rel="noopener noreferrer"&gt;2.1 Booleans&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/2" rel="noopener noreferrer"&gt;2.2 Even/odd calculator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/3" rel="noopener noreferrer"&gt;2.3 Overtime pay with an if/else&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/4" rel="noopener noreferrer"&gt;2.4 Water temperature&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/2/5" rel="noopener noreferrer"&gt;2.5 Switch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, try to write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to write a program to determine if one date comes after another. The program will ask for two sets of dates. Next, the program will determine if the first date comes before, is equal to, or comes after.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in the first month: 2
Enter in the first day: 21
Enter in the first year: 2012

Enter in the second month: 2
Enter in the second day: 22
Enter in the second year: 2011

The first date comes after the second.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to write a programs that prompts the user for a date and determines if that date is valid. For example, 9/19/2017 is a valid date but these are not valid dates:&lt;/p&gt;

&lt;p&gt;4/31/2006 (only 30 days in April)&lt;br&gt;
2/29/2005 (not a leap year)&lt;br&gt;
16/1/2010 (invalid month)&lt;br&gt;
4/59/2013 (invalid day)&lt;/p&gt;

&lt;p&gt;If the date is correct print it out. If it is incorrect display an error message explaining why the date is not correct. &lt;/p&gt;
&lt;h3&gt;
  
  
  Problem 3
&lt;/h3&gt;

&lt;p&gt;Problem 3 asks you to write a program that will calculate change for a sales purchase. Your program should prompt for a sales price. Validate that the data entered is a number greater than 0. If the data entered is incorrect, display an error message and end the program. Next, prompt the user for the amount that the customer will pay to the cashier. Validate that this value is greater than or equal to the sales price. If it is not, display an error message and end the program.&lt;/p&gt;

&lt;p&gt;If the entry is correct, your program must calculate the amount of change to return to the user.  Next, calculate what bills and coins that the the cashier needs to return to the customer. The fewest number of paper bills and coins should be returned. You can make change in many different combinations, however, the only correct implementation is the one that returns the fewest paper bills and coins.&lt;/p&gt;

&lt;p&gt;Display the number of each of the bills and coins. Here is a sample run of the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in a sales amount: $20.38
Enter in the amount the customer pays: $30.00

The change due back is $9.62

You should give the customer this change:
0 $100 bills
0 $50 bills
0 $20 bills
0 $10 bills
1 $5 bills
4 $1 bills
1 Half Dollars
0 Quarters
1 Dimes
0 Nickels
2 Pennies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because of the way arithmetic works with float variables, storing the monetary values as floats may cause some problems. For example, if you had a float variable that held 1.29 to represent $1.29 and you subtracted the .05 from it (to represent giving back a nickel) you would think that you would be left with exactly 1.24. Unfortunately, the computer might store that value or it might store 1.2399999 or 1.2400001 instead of exactly 1.24. These very small inconsistencies can cause a problem calculating the number of pennies to return. Consider converting the amounts into ints to solve this problem.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 3: Looping
&lt;/h1&gt;

&lt;p&gt;This group of playbacks discusses repeatedly executing the same code over and over again in a loop. They show how to create count controlled and event controlled loops with the &lt;code&gt;while&lt;/code&gt; keyword, nested loops, a &lt;code&gt;for&lt;/code&gt; loop, and how to exit a loop with &lt;code&gt;break&lt;/code&gt; and &lt;code&gt;continue&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/1" rel="noopener noreferrer"&gt;3.1 A simple loop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/2" rel="noopener noreferrer"&gt;3.2 More loops&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/3" rel="noopener noreferrer"&gt;3.3 Summation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/4" rel="noopener noreferrer"&gt;3.4 Nested loop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/5" rel="noopener noreferrer"&gt;3.5 &lt;code&gt;for&lt;/code&gt; loop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/6" rel="noopener noreferrer"&gt;3.6 Capitalization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/3/7" rel="noopener noreferrer"&gt;3.7 &lt;code&gt;break&lt;/code&gt; and &lt;code&gt;continue&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to write a program that will calculate the sum of the squares from 1 up to and including that number. For example if the user entered in the value 5 then the sum of the squares for the numbers one through five would be (1 + 4 + 9 + 16 + 25) = 55.&lt;/p&gt;

&lt;p&gt;Your program should repeatedly calculate this value until the user enters in a value of -99. This is the sentinel value that the program uses to determine when to quit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in an integer number(ex. 10), -99 to quit: 5
The sum of the squares up to 5 is 55

Enter in an integer number(ex. 10), -99 to quit: 4
The sum of the squares up to 4 is 30

Enter in an integer number(ex. 10), -99 to quit: -99
Have a nice day!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to write a program that will determine whether a number is prime or not. A prime number is any number that is evenly divisible only by the number one and itself.&lt;/p&gt;

&lt;p&gt;7 is prime because the only numbers that divide into it without a remainder are 1 and 7.&lt;/p&gt;

&lt;p&gt;12 is not prime because the numbers that divide into it evenly are 1, 2, 3, 4, 6, and 12.&lt;/p&gt;

&lt;p&gt;Your program will prompt for a number and then display whether the number is prime or not. The number entered must be a positive number. Repeatedly prompt for a number until a positive number is entered.&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 3
&lt;/h3&gt;

&lt;p&gt;Problem 3 asks you to calculate a mortgage schedule for someone thinking of buying a new house. The inputs to determine a monthly schedule are the principal loan amount and the annual interest rate. Assume this will be a conventional 30 year loan.&lt;/p&gt;

&lt;p&gt;Your program should prompt for these inputs and find a monthly payment using this calculation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                                   monthly interest rate                                              
monthly payment =  ------------------------------------------------- * principal
                   1 - (1 + monthly interest rate)^-number of months
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that you will have to calculate the monthly interest rate (the annual interest rate divided by 12.0) and number of months (360 for a 30 year loan). The ^ in this formula means raise one number to a power. There is a function called &lt;code&gt;pow()&lt;/code&gt; which raises one number to another and returns the result. For example, if one wanted to raise 2 to the -3rd power they would do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;float result = pow(2.0, -3.0);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you have calculated the monthly payment create a summary of the loan characteristics. Display the loan amount, the interest rate, the monthly payment, the total amount paid for the loan, the total amount of interest paid, and the ratio of amount paid over the principal.&lt;/p&gt;

&lt;p&gt;After you have printed the summary you can begin to make the schedule. Prompt the user for the ending month to display in the schedule. The schedule should display the month number, the monthly payment, the amount paid in principal in that month, the amount paid in interest in that month, and the amount remaining in the principal (the amount paid in principle each month is deducted from the remaining principle). A month's interest amount is equal to monthly interest rate times the remaining principal. The monthly principal is the difference between the monthly payment and the monthly interest paid. Remember to update the remaining principal after every month.&lt;/p&gt;

&lt;p&gt;After each year of the schedule has been printed display a message with the year number.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 4: Arrays
&lt;/h1&gt;

&lt;p&gt;This batch of programs shows how to use arrays in C/C++. An array is a collection of variables (all of the same type) that have a single name and sit next to each other in memory. Loops are almost always used to go through the elements of an array. They show how to create two and three dimensional arrays and use the random number generator in C/C++.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/1" rel="noopener noreferrer"&gt;4.1 Arrays&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/2" rel="noopener noreferrer"&gt;4.2 Average and standard deviation of an array of values&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/3" rel="noopener noreferrer"&gt;4.3 Problems with arrays&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/4" rel="noopener noreferrer"&gt;4.4 Flipping coins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/4/5" rel="noopener noreferrer"&gt;4.5 Multi-dimensional arrays&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to write a program that displays a menu with three options. &lt;/p&gt;

&lt;p&gt;The first option allows the user to enter in a month number (between 1-12) and a day number within that month (1-31) and calculates the day number in the year. January 1 is day 1. January 31 is day 31. February 1 is day 32. February 28 is day 59. December 31 is day 365 (don’t worry about leap year). If the user enters an invalid combination (like February 31) the program should continuously prompt the user to enter in a new value until they enter a valid date.&lt;/p&gt;

&lt;p&gt;The second menu option allows the user to enter in a day number (1-365) and prints out the month name and day number of that month. If the user enters in 59 the program should print out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Day 59 is February 28
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the user enters an invalid day number the program should continuously prompt the user to enter in a new value until it is in the correct range.&lt;/p&gt;

&lt;p&gt;The last menu option allows the user to quit the program. The menu should repeatedly be displayed until the user chooses to quit the program.&lt;/p&gt;

&lt;p&gt;Use an array of integers to hold the number of days in each of the months. Use the array to keep a running sum to help with your day calculations. You may also want to create an array of strings with the month names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int numDaysInMonths[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a sample run of the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Enter in a month and day
2. Enter in a day number
3. Quit
Enter in a menu option: 1

Enter in a month number: 2
Enter in a day number: 1

February 1 is day 32

1. Enter in a month and day
2. Enter in a day number
3. Quit
Enter in a menu option: 2

Enter in a day number: 59
Day 59 is February 28

1. Enter in a month and day
2. Enter in a day number
3. Quit
Enter in a menu option: 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to create a program that will find the number of days in between two dates.&lt;/p&gt;

&lt;p&gt;For example, if one would like to know how many days are in between two dates (1/1/2000) and (3/19/2030). The program must find out how many whole days are in between these two dates (include the starting and ending date).&lt;/p&gt;

&lt;p&gt;If the two dates are in the same year then the algorithm to find the number of days may be different than if the dates are in different years. Your program must handle each case.&lt;/p&gt;

&lt;p&gt;Here is a sample run of the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in a start month: 1
Enter in a start day: 1
Enter in a start year: 2000

Enter in an end month: 3
Enter in an end day: 19
Enter in an end year: 2030

There are 11035 days in between 1/1/2000 and 3/19/2030
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Part 5: Functions
&lt;/h1&gt;

&lt;p&gt;This group of playbacks describes another flow of control altering mechanism called functions. A function is a named block of code that can be &lt;em&gt;called&lt;/em&gt; and the flow of control will jump to it. &lt;/p&gt;

&lt;p&gt;When calling a function some data can be passed into it (called parameters) and the function can return a piece of data when it is complete (called a return value). These playbacks discuss passing in data 'by value' versus 'by reference'. They show that every variable has a limited lifetime that it sits in memory, or scope.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/1" rel="noopener noreferrer"&gt;5.1 Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/2" rel="noopener noreferrer"&gt;5.2 Value returning functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/3" rel="noopener noreferrer"&gt;5.3 Functions with parameters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/4" rel="noopener noreferrer"&gt;5.4 Passing parameters by reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/5" rel="noopener noreferrer"&gt;5.5 The scope of variables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/6" rel="noopener noreferrer"&gt;5.6 Prime number function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/5/7" rel="noopener noreferrer"&gt;5.7 Passing arrays to functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to extend the prime number problem from a previous section. Write a program that includes a function that will print all the prime numbers in a range. The program will ask for a lower bound and an upper bound and print all the primes in that range.&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to write a function that takes an integer year number and returns a &lt;code&gt;bool&lt;/code&gt; whether that year is a leap year or not. The calculation for leap year is as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;most years evenly divisible by four are leap years&lt;/li&gt;
&lt;li&gt;if a year is divisible by four and is a century year, like 1800 or 1900, then it is NOT a leap year&lt;/li&gt;
&lt;li&gt;if a century year also happens to be divisible by 400, like 2000 or 2400, then it is a leap year&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The function should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bool isLeapYear(int year)
{
    //calculate if it is leap year or not and return true or false
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 3
&lt;/h3&gt;

&lt;p&gt;Problem 3 asks you to write a program that will print a calendar for a whole year given the day that January 1st falls on. Your program will prompt for the day that January 1st falls on and the year. You must print the calendar for all 12 months of that year. The options for the first day of the year will be entered with the first three letters of each of the seven days of the week from Sunday ('sun') to Saturday ('sat').&lt;/p&gt;

&lt;p&gt;The year does not need to be validated, but the day of the week does. You should not allow the user to enter in a value other than 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', or 'sat'.&lt;/p&gt;

&lt;p&gt;The format of your calendar should be very similar to the example below. You must use at least one function in addition to the main function. Pass data between functions, do not use global variables.&lt;/p&gt;

&lt;p&gt;The final requirement is that your program should only display one month at a time and then wait for some user input before continuing.&lt;/p&gt;

&lt;p&gt;It is very important that you come up with a plan to solve this program before you begin coding (as it is with every program). Think about how you would print a single month's calendar given the day of the month that it begins on.&lt;/p&gt;

&lt;p&gt;Sample Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What year do you want the calendar for?
2003

What day of the week does January 1st fall on (sun for Sunday, mon for Monday, etc..)?
s
Invalid Entry- please enter the first three letters of the day

What day of the week does January 1st fall on (sun for Sunday, mon for Monday, etc..)?
wed

    January 2003
 S  M  T  W  T  F  S
---------------------
          1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Do you want to continue? y

   February 2003
 S  M  T  W  T  F  S
---------------------
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

Do you want to continue? y
...
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Part 6: Vectors
&lt;/h1&gt;

&lt;p&gt;C++ comes with the Standard Template Library (STL) which is a collection of different containers. This section will cover vectors. A &lt;code&gt;vector&lt;/code&gt; is an array-based container that holds data very much like an array does but it is &lt;em&gt;smarter&lt;/em&gt;. It knows how many elements are in it and it can grow as the program is running. It also shows how to read and write data from a file, efficiently search through an array-based container, sort values, and more.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/1" rel="noopener noreferrer"&gt;6.1 &lt;code&gt;vector&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/2" rel="noopener noreferrer"&gt;6.2 Passing a &lt;code&gt;vector&lt;/code&gt; to a function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/3" rel="noopener noreferrer"&gt;6.3 Advanced features of &lt;code&gt;vector&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/4" rel="noopener noreferrer"&gt;6.4 Reading from a file and storing in a &lt;code&gt;vector&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/5" rel="noopener noreferrer"&gt;6.5 Linear search and binary search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/6" rel="noopener noreferrer"&gt;6.6 Bubble sort&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/7" rel="noopener noreferrer"&gt;6.7 Writing to a file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/6/8" rel="noopener noreferrer"&gt;6.8 Two dimensional &lt;code&gt;vector&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program to read in whole words from a file and store them in a vector of strings. Create a simple text file (.txt) using your coding editor. Then, add a few sentences of text to it. Strip any punctuation marks from the words and make them all lowercase letters. Only store a word in the vector if it is not already present. &lt;/p&gt;




&lt;h1&gt;
  
  
  Part 7: Structured Data
&lt;/h1&gt;

&lt;p&gt;This section describes how to use structured data types. Structured data types allow you to group related data together so that it can be passed around easily.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/1" rel="noopener noreferrer"&gt;7.1 Simple &lt;code&gt;struct&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/2" rel="noopener noreferrer"&gt;7.2 Hierarchical &lt;code&gt;struct&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/3" rel="noopener noreferrer"&gt;7.3 &lt;code&gt;vector&lt;/code&gt;s as members of &lt;code&gt;struct&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/4" rel="noopener noreferrer"&gt;7.4 &lt;code&gt;struct&lt;/code&gt;s with a &lt;code&gt;vector&lt;/code&gt; of objects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/7/5" rel="noopener noreferrer"&gt;7.5 Calculus with &lt;code&gt;struct&lt;/code&gt;s&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program that has a struct to represent a cell phone. Every cell phone has a model name and manufacturer along with a camera with a mega-pixel resolution. For example, one may want to store information about an Apple IPhone X with a 12 MP camera or a Google Pixel 4 with a 16 MP camera.&lt;/p&gt;

&lt;p&gt;Your program will create three cell phone objects, fill them, and then add them to a vector. Lastly, print out the information about each cell phone on the screen.&lt;/p&gt;

&lt;p&gt;Write a function that takes a cell phone object by reference and prompts the user to enter in the model, manufacturer, and camera resolution. Write another function that prints information about a cell phone. Write a function that takes a vector of cell phones and prints each one.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 8: Pointers
&lt;/h1&gt;

&lt;p&gt;This section describes pointers in C/C++. A pointer is a variable that holds the address of another variable. Pointers are important because they allow us to use a special section of memory called the 'heap'. It discusses the different types of memory that can be used in a program (global, local, and dynamic).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/1" rel="noopener noreferrer"&gt;8.1 Simple pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/2" rel="noopener noreferrer"&gt;8.2 Pointer to an object&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/3" rel="noopener noreferrer"&gt;8.3 Vectors of pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/4" rel="noopener noreferrer"&gt;8.4 Arrays are pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/5" rel="noopener noreferrer"&gt;8.5 Passing data to functions with pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/6" rel="noopener noreferrer"&gt;8.6 Comparing pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/7" rel="noopener noreferrer"&gt;8.7 Three types of variables- global, local, and dynamic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/8" rel="noopener noreferrer"&gt;8.8 Dynamic variables example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/9" rel="noopener noreferrer"&gt;8.9 Dangling pointers and null pointers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/8/10" rel="noopener noreferrer"&gt;8.10 Dynamic array of students&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program that will read a sequence of words from the keyboard and store them in a dynamic array of strings. Use the word 'quit' as the word that terminates the input. Print the words back to the screen in the order in which they were entered each on its own line. Do not store the same word twice.&lt;/p&gt;

&lt;p&gt;Up until now the size of an array has been determined at compile time, now that you know about pointers and about the keyword &lt;code&gt;new&lt;/code&gt;, write a program which is not restricted to selecting an upper bound at compile time for the number of words which can be read in.&lt;/p&gt;

&lt;p&gt;One way to do this is to use &lt;code&gt;new&lt;/code&gt; to create arrays of strings on the fly. Each time an array fills up, dynamically create an array which is twice as large, copy over the contents of the existing array to the new array, and continue (remember to &lt;code&gt;delete&lt;/code&gt; the original array). Start with an array of 5 elements.&lt;/p&gt;

&lt;p&gt;Here is an example of the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter in some text and end with the word quit:
This lab asks you to write a program that will read a sequence of words from the keyboard and store them in a dynamic array of strings. Use the word 'quit' as the word that terminates the input. Print the words back to the screen in the order in which they were entered each on its own line. Do not store the same word twice. quit

Doubling Array from 5 to 10
Doubling Array from 10 to 20
Doubling Array from 20 to 40
Doubling Array from 40 to 80
1. This
2. lab
3. asks
4. you
5. to
6. write
7. a
8. program
9. that
10. will
11. read
12. sequence
13. of
14. words
15. from
16. the
17. keyboard
18. and
19. store
20. them
21. in
22. dynamic
23. array
24. strings.
25. Use
26. word
27. 'quit'
28. as
29. terminates
30. input.
31. Print
32. back
33. screen
34. order
35. which
36. they
37. were
38. entered
39. each
40. on
41. its
42. own
43. line.
44. Do
45. not
46. same
47. twice.
Press any key to continue . . .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Part 9: Object-Oriented Programming
&lt;/h1&gt;

&lt;p&gt;This section discusses object-oriented programming using classes in C++. A class is like a &lt;code&gt;struct&lt;/code&gt; except that in addition to collecting data it also collects methods that work on that data. This is called encapsulation. It also discusses inheritance and polymorphism that make it easier to reuse code. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/1" rel="noopener noreferrer"&gt;9.1 Simple class&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/2" rel="noopener noreferrer"&gt;9.2 A class with data members&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/3" rel="noopener noreferrer"&gt;9.3 A class with objects for data members&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/4" rel="noopener noreferrer"&gt;9.4 Common word analysis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/5" rel="noopener noreferrer"&gt;9.5 Student and course registration system&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/6" rel="noopener noreferrer"&gt;9.6 Inheritance and polymorphism&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/7" rel="noopener noreferrer"&gt;9.7 Shape inheritance hierarchy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/8" rel="noopener noreferrer"&gt;9.8 Inheritance and polymorphism in C++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/9/9" rel="noopener noreferrer"&gt;9.9 Copy Constructor Example&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a few programs:&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 1
&lt;/h3&gt;

&lt;p&gt;Problem 1 asks you to create a Date class to represent a date.&lt;/p&gt;

&lt;p&gt;There should be an int for the day number, month number, and year number declared in the private section. Instead of having a setter for each of those have one method called setDate(int m, int d, int y) that sets the date. You can have a getter method for each piece of data.&lt;/p&gt;

&lt;p&gt;Add two constructors- one that takes no data and sets the date to 1/1/2000 and another that takes three ints to set the date.&lt;/p&gt;

&lt;p&gt;Include a print() method that will print the date in this format: MM/DD/YYYY and a method called printLong() that prints in this format: MonthName Day, Year. For example today's date would print &lt;code&gt;November 16, 2021&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Include a method to add some number of days, months, and years to a Date:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void addDays(int d)
void addMonths(int m)
void addYears(int y)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 2
&lt;/h3&gt;

&lt;p&gt;Problem 2 asks you to create some related classes for playing card games. The data needed to be stored for a card is a numeric value and a suit. A card is responsible for being able to display itself. For example, when we want to display a two of hearts, ten of diamonds, jack of clubs, or ace of spades the output would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 of Hearts
10 of Diamonds
J of Clubs
A of Spades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, create a deck class. A deck is a collection of fifty-two cards. Each card is unique. There should be a card with a numeric value from two to the ace in each of the four suits. The responsibilities of the deck class are that it must be able to shuffle itself and deal out some number of cards from the deck. To shuffle the deck you will need to randomly move cards around in the deck. One can generate a random number in C++ using the rand() function.&lt;/p&gt;

&lt;p&gt;When dealing out cards the user will ask the deck for some number of cards. If there are enough cards in the deck it should deal those cards out. Once a card is dealt from the deck it cannot be dealt again from the same deck. The user will pass in a vector of cards and the deck will fill it with the number of cards requested. If there aren't enough cards in the deck print an error message and then kill the program with an exit(0).&lt;/p&gt;

&lt;p&gt;When creating a class one always has to think about the data needed for the class and the responsibilities of the class. The data for the class should be private and an interface to the class should be provided. Think about how each card and deck should be constructed. Write at least one constructor for each class. Write the card class first and test it in a driver program. Then work on the deck class. To test the deck, create a deck object, ask for 52 cards, and print each of those cards to the screen.&lt;/p&gt;

&lt;p&gt;Next, alter the program so that it will allow a person to evaluate the probabilities of getting certain poker hands. Poker is a card game played with a deck of 52 cards. In this program you only need to handle the five card variety of poker. The program will repeatedly get groups of five cards from the deck and count how many times each hand occurs.&lt;/p&gt;

&lt;p&gt;In most variations of poker the precedence of hands goes like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Royal Flush- 5 cards that are a straight (5 cards in numeric order) and a flush (5 cards that are the same suit) from the 10 to the Ace.
Straight Flush- 5 cards that are a straight (5 cards in numeric order) and a flush (5 cards that are the same suit).
Four of a Kind- any 4 cards with the same number.
Full House- three of a kind (3 cards with the same number) and a pair (two cards with the same number).
Flush- any 5 cards of the same suit.
Straight- any 5 cards in numeric order.
Three of a Kind- any 3 cards with the same number.
Two Pair- 2 sets of pairs.
Pair- any 2 cards with the same number.
High Card in your Hand- if you don't have any of the above, your high card is the best hand.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will need to create additional classes with more responsibilities than the Deck and Card classes.&lt;/p&gt;

&lt;p&gt;Your program needs an 'evaluator' that can look at a collection of cards and determine the best hand that can be made from those cards. In order to determine probabilities, deal a great number of hands and keep track of how many times each hand shows up. In other words, your program might create 100,000 collections of five cards to be evaluated. The evaluator will count how many times a royal flush comes up, how many times a straight flush comes up, an so on. Your program will show the probabilities as percentages of the likelihood of getting each hand.&lt;/p&gt;

&lt;p&gt;Below is a driver to illustrate how to use the evaluator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//five card evaluator&lt;/span&gt;
    &lt;span class="c1"&gt;//create a poker evaluator for 5 card poker&lt;/span&gt;
    &lt;span class="n"&gt;PokerEvaluator&lt;/span&gt; &lt;span class="n"&gt;fiveCardPokerEvaluator&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;//set the number of hands to play- one hundred thousand this time&lt;/span&gt;
    &lt;span class="n"&gt;fiveCardPokerEvaluator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setNumberOfHandsToPlay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;//play all the hands and track the statistics, then print the results to the screen&lt;/span&gt;
    &lt;span class="n"&gt;fiveCardPokerEvaluator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;playAndDisplay&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Part 10: Data Structures
&lt;/h1&gt;

&lt;p&gt;This section describes how to build some common data structures: a hash table, a binary search tree, and a graph. It also describes how to use the STL &lt;code&gt;unordered_map&lt;/code&gt; class.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/1" rel="noopener noreferrer"&gt;10.1 Simple linked list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/2" rel="noopener noreferrer"&gt;10.2 Simple hash table&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/3" rel="noopener noreferrer"&gt;10.3 More complex hash table&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/4" rel="noopener noreferrer"&gt;10.4 STL &lt;code&gt;unordered_map&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/5" rel="noopener noreferrer"&gt;10.5 Binary search tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/10/6" rel="noopener noreferrer"&gt;10.6 Graph adjacency matrix&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Now that you have reviewed the guided code walk-throughs, write a program that includes a class which is equivalent of the &lt;code&gt;vector&lt;/code&gt; called SafeArray. SafeArray has a method called &lt;code&gt;at&lt;/code&gt; that returns the element at the specified position. A SafeArray maintains a pointer to an array on the heap. Use the pointer to make the array grow and shrink with calls to &lt;code&gt;push_back&lt;/code&gt; and &lt;code&gt;pop_back&lt;/code&gt;. The SafeArray will have a method called &lt;code&gt;size&lt;/code&gt; that returns the number of items in it. Include a default constructor that sets the initial size of the underlying array to hold 10 elements. Include a destructor to &lt;code&gt;delete&lt;/code&gt; the array when the SafeArray falls out of scope.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 11: SQLite Databases
&lt;/h1&gt;

&lt;p&gt;This section describes working with a SQLite database. SQLite is my favorite Database Management System (DBMS) because it is powerful and easy to add to any program. This section assumes that you are familiar with relational database design and SQL. &lt;/p&gt;

&lt;p&gt;The first program shows how to use the API to write and run SQL queries in a C++ program. In the second, some of the repetitive code is abstracted into a separate class. In the third, transactions in SQLite are explained and it shows that they can be used to ensure the ACID properties of a database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/1" rel="noopener noreferrer"&gt;11.1 The C++ SQLite API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/2" rel="noopener noreferrer"&gt;11.2 An Object Oriented Auction Program&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/3" rel="noopener noreferrer"&gt;11.3 SQLite Transactions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Practice
&lt;/h2&gt;

&lt;p&gt;Extend the auction program from the second playback to include a method that prints the names and email addresses of all of the users who won an auction. Then write a method that prints item followed by the names and email addresses of anyone who made a bid on the item.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comments and Feedback
&lt;/h2&gt;

&lt;p&gt;You can find all of these code playbacks in the free 'book', &lt;a href="https://playbackpress.com/books/cppbook/" rel="noopener noreferrer"&gt;An Animated Introduction to Programming in C++&lt;/a&gt;. There are more free books here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/pybook" rel="noopener noreferrer"&gt;An Animated Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/sqlbook" rel="noopener noreferrer"&gt;Database Design and SQL for Beginners&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/workedsqlbook" rel="noopener noreferrer"&gt;Worked SQL Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/sqlitebook" rel="noopener noreferrer"&gt;Programming with SQLite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/webdevbook" rel="noopener noreferrer"&gt;An Introduction to Web Development from Back to Front&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cljbook" rel="noopener noreferrer"&gt;An Animated Introduction to Clojure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/exbook" rel="noopener noreferrer"&gt;An Animated Introduction to Elixir&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/rubybook" rel="noopener noreferrer"&gt;A Brief Introduction to Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/flutterbook" rel="noopener noreferrer"&gt;Mobile App Development with Dart and Flutter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/patternsbook" rel="noopener noreferrer"&gt;OO Design Patterns with Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/wordzearchbook" rel="noopener noreferrer"&gt;How I Built It: Word Zearch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Comments and feedback are welcome via email: &lt;a href="//mailto:mark@playbackpress.com"&gt;mark@playbackpress.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Programming in C++ (SQLite Databases)</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Mon, 10 Mar 2025 18:46:40 +0000</pubDate>
      <link>https://dev.to/markm208/sqlite-databases-6jn</link>
      <guid>https://dev.to/markm208/sqlite-databases-6jn</guid>
      <description>&lt;p&gt;This post describes working with a SQLite database. SQLite is my favorite Database Management System (DBMS) because it is powerful and easy to add to any program. This post assumes that you are familiar with relational database design and SQL. &lt;/p&gt;

&lt;p&gt;In the first program, I cover the API to write and run SQL queries in a C++ program. In the second, I abstract out some of the repetitive code into a class. In the third I discuss transactions in SQLite and how they can be used to ensure the ACID properties of a database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/1" rel="noopener noreferrer"&gt;The C++ SQLite API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/2" rel="noopener noreferrer"&gt;An Object Oriented Auction Program&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playbackpress.com/books/cppbook/chapter/11/3" rel="noopener noreferrer"&gt;SQLite Transactions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Call to Action
&lt;/h2&gt;

&lt;p&gt;Extend the auction program from the second playback to include a method that prints the names and email addresses of all of the users who won an auction. Then write a method that prints item followed by the names and email addresses of anyone who made a bid on the item.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comments and Feedback
&lt;/h2&gt;

&lt;p&gt;You can find all of these code playbacks in my free 'book', &lt;a href="https://playbackpress.com/books/cppbook/" rel="noopener noreferrer"&gt;An Animated Introduction to Programming in C++&lt;/a&gt;. I am always looking for feedback so please feel free to comment here or to send me a direct message.&lt;/p&gt;

</description>
      <category>sqlite</category>
      <category>cpp</category>
      <category>database</category>
      <category>beginners</category>
    </item>
    <item>
      <title>New AI Integration into Code Playbacks</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Tue, 03 Sep 2024 23:41:41 +0000</pubDate>
      <link>https://dev.to/markm208/new-ai-integration-into-code-playbacks-2hkm</link>
      <guid>https://dev.to/markm208/new-ai-integration-into-code-playbacks-2hkm</guid>
      <description>&lt;p&gt;I have integrated two AI features into all &lt;a href="https://markm208.github.io/" rel="noopener noreferrer"&gt;code playbacks&lt;/a&gt;, a medium designed to bring code to life through animated walkthroughs, on the &lt;a href="https://playbackpress.com/books" rel="noopener noreferrer"&gt;Playback Press&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/9x4L_Gimvv4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Ask Questions, Get Answers: AI as Your Coding Companion
&lt;/h3&gt;

&lt;p&gt;One of the biggest challenges learners face when learning from a book, video, or online tutorial is when they encounter a question that isn't covered by the author. To solve this, I’ve added an AI powered 'question and answer' feature to code playbacks. Now, if something isn’t clear while you’re viewing a playback, you can ask the AI directly within the interface. The AI will provide context-specific answers, helping to clarify concepts without disrupting your learning flow.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Self-Grading Multiple Choice Questions: Test Your Knowledge
&lt;/h3&gt;

&lt;p&gt;Learning to code isn’t just about absorbing information; it’s about applying it. To reinforce this, code playbacks now include AI generated multiple choice questions. These questions are designed to test comprehension of the material presented, giving learners immediate feedback on their progress. It’s like having a mini-quiz at any point in a playback, tailored specifically to the content you’ve just engaged with.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why These Features Matter
&lt;/h3&gt;

&lt;p&gt;The goal of these integrations isn’t to replace the human element of teaching but to complement it. The AI features are there to assist learners in a more interactive and personalized way, making coding education more accessible and effective. Whether you’re a beginner trying to grasp new concepts or an experienced developer brushing up on skills, these AI tools provide an additional layer of support tailored to your needs.&lt;/p&gt;

&lt;p&gt;I’m looking forward to seeing how these features help others on their coding journey. If you’ve had a chance to try them out, I’d love to hear your feedback!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>learning</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>An Animated Introduction to Elixir</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Thu, 20 Oct 2022 02:12:03 +0000</pubDate>
      <link>https://dev.to/markm208/an-animated-introduction-to-elixir-2lac</link>
      <guid>https://dev.to/markm208/an-animated-introduction-to-elixir-2lac</guid>
      <description>&lt;p&gt;This is a collection of guided code walk-throughs introducing the functional, concurrent programming language, Elixir. Elixir is based on another really cool language called Erlang. If you have never programmed in the functional paradigm or explicitly created and managed processes then learning Elixir should be a fascinating introduction into these topics.&lt;/p&gt;

&lt;p&gt;I begin by covering the basics of the Elixir programming language. Elixir is a functional programming language that relies heavily on pattern matching. Pattern matching makes it so that you almost never need to write an 'if statement'. Elixir also has immutable data. Immutable data cannot change. I discuss 'efficient immutability' and the built in data structures throughout the book. &lt;/p&gt;

&lt;p&gt;Elixir has excellent support for high order functions to process collections of data. These high order functions make it so that you rarely need to write a traditional loop. Elixir supports tail call optimizations for recursive functions which also helps reduce the number of loops that one has to write.&lt;/p&gt;

&lt;p&gt;In the second part of this tutorial, I cover concurrency in Elixir. Elixir makes it easy to create many communicating processes. Using processes really changes the way one thinks about solving problems. Each process has its own flow of control, call stack, and mailbox used to receive and queue messages sent from other processes. There are built in functions so that one process can send and receive messages to others. I go over a few interesting problems that use processes in this chapter.&lt;/p&gt;

&lt;p&gt;Part 1 Elixir&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/01/index.html"&gt;1.1 Hello Elixir!!!&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/02/index.html"&gt;1.2 Numbers and the Match Operator&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/03/index.html"&gt;1.3 Functions and More Matching&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/04/index.html"&gt;1.4 Modules and More Matching with SimpleMath&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/05/index.html"&gt;1.5 Closures&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/06/index.html"&gt;1.6 Ranges and the Enum Module&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/07/index.html"&gt;1.7 Tuples&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/08/index.html"&gt;1.8 Maps&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/09/index.html"&gt;1.9 SimpleDateFormatter Module with Maps&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/10/index.html"&gt;1.10 Lists, Matching, and Recursion&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/11/index.html"&gt;1.11 Poker Probabilities&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter1/12/index.html"&gt;1.12 Recursion in Elixir&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 2 Concurrency&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter2/01/index.html"&gt;2.1 Adding Tests to the Mix&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter2/02/index.html"&gt;2.2 Process Basics&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter2/03/index.html"&gt;2.3 Prime Sieve&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter2/04/index.html"&gt;2.4 Calendar with Processes&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/exbook/chapter2/05/index.html"&gt;2.5 Poker with Processes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have more tutorials here: &lt;a href="https://markm208.github.io"&gt;https://markm208.github.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you'd like to stay connected and get updates when I add new playbacks you can follow me on twitter: &lt;a href="https://twitter.com/markm208"&gt;@markm208&lt;/a&gt;. You can contact me directly at &lt;a href="mailto:markm208@gmail.com"&gt;markm208@gmail.com&lt;/a&gt;. Let me know what you think!&lt;/p&gt;

</description>
      <category>elixir</category>
      <category>tutorial</category>
      <category>functional</category>
    </item>
    <item>
      <title>A Brief Introduction to Ruby</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Wed, 14 Sep 2022 02:18:34 +0000</pubDate>
      <link>https://dev.to/markm208/a-brief-introduction-to-ruby-4mc2</link>
      <guid>https://dev.to/markm208/a-brief-introduction-to-ruby-4mc2</guid>
      <description>&lt;p&gt;This is a brief introduction to Ruby. Ruby is a masterfully designed language. It has been around for many years and is incredibly popular, especially among web developers. It is a friendly programming language that is intuitive and a joy to work with.&lt;/p&gt;

&lt;p&gt;This introduction to Ruby is for people who have some programming experience. One interesting feature of Ruby is the ability to pass code around to methods to be executed. This is a very powerful technique.&lt;/p&gt;

&lt;p&gt;What you will see in this post is a collection of code playbacks. Playbacks were designed to help guide a reader through code examples. You will get to see how I build programs up from scratch and hear me explain it in comments that I make along the way. These comments will have text, screenshots, and hand drawn pictures. This will allow you to get inside my head and hopefully this will demystify the programming process. When you click on a playback title below it will open a new tab. Then, just click on the comments on the left hand side of the screen and you will be guided through the code.&lt;/p&gt;

&lt;p&gt;Click on the first playback below to begin your journey with Ruby!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://markm208.github.io/rubybook/chapter1/01/index.html"&gt;1.1 Hello Ruby!!!&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/02/index.html"&gt;1.2 Variables and Types&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/03/index.html"&gt;1.3 Selection and Looping&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/04/index.html"&gt;1.4 Arrays&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/05/index.html"&gt;1.5 Hashes&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/06/index.html"&gt;1.6 Methods&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/07/index.html"&gt;1.7 Closures&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/08/index.html"&gt;1.8 Iterators&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/09/index.html"&gt;1.9 Classes in Ruby&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/10/index.html"&gt;1.10 Interacting Classes&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/chapter1/11/index.html"&gt;1.11 Unit Testing in Ruby&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is a link to the original book:&lt;br&gt;
&lt;a href="https://markm208.github.io/rubybook/"&gt;A Brief Introduction to Ruby&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you'd like to stay connected and get updates when I add new playbacks you can follow me on twitter: &lt;a href="https://twitter.com/markm208"&gt;@markm208&lt;/a&gt;. I have several different free programming books &lt;a href="https://markm208.github.io/"&gt;here&lt;/a&gt;. Check them out!&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>tutorial</category>
      <category>rails</category>
    </item>
    <item>
      <title>Database Design and SQL for Beginners</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Tue, 01 Jun 2021 22:02:51 +0000</pubDate>
      <link>https://dev.to/markm208/database-design-and-sql-for-beginners-ong</link>
      <guid>https://dev.to/markm208/database-design-and-sql-for-beginners-ong</guid>
      <description>&lt;p&gt;This is a short introduction to relational database design and the Structured Query Language (SQL). Many people organize their electronic data into spreadsheets. This works great if the data is simple, small, and not likely to be tracked for very long periods of time. However, when you have more sophisticated, larger, and long-lived data sets the spreadsheet approach breaks down. In these examples I discuss why this is the case and how to build and query relational databases.&lt;/p&gt;

&lt;p&gt;I use a relational database management system called SQLite. SQLite is one of my favorite tools. It is an open-source, full-featured relational database management system where an entire database is stored in a single file. I also use an accompanying tool called 'DB Browser for SQLite' because it provides a nice user interface to interact with SQLite databases.&lt;/p&gt;

&lt;p&gt;I start by discussing what makes a good database design. I explain entity-relationship diagrams and schemas. These modeling tools aide in the design of a database. I talk about one-to-many and many-to-many relationships and how to use them in a relational database. Perhaps most importantly, though, I cover the basics of SQL so that you can retrieve meaningful information from your databases.&lt;/p&gt;

&lt;p&gt;Each of the links below will take you to a 'playback' that shows how I wrote some SQL to build and query a database for a fictitious pet adoption center. There are some videos that go along with the changes in the editor window. I move pretty fast in these playbacks so it is important that you spend some time after each of my comments to try and fully understand the SQL in the editor window.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 1 Database Design and SQL
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://markm208.github.io/sqlbook/chapter1/01/index.html"&gt;1.1 Database Design and Simple SQL&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter1/02/index.html"&gt;1.2 One-to-Many Relationships and More SQL&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter1/03/index.html"&gt;1.3 Many-to-Many Relationships and Even More SQL&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 2 A Beginner's Reference to SQL
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://markm208.github.io/sqlbook/chapter2/01/index.html"&gt;2.1 CREATE TABLE and ALTER TABLE&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/02/index.html"&gt;2.2 INSERT&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/03/index.html"&gt;2.3 SELECT&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/04/index.html"&gt;2.4 FROM&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/05/index.html"&gt;2.5 WHERE&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/06/index.html"&gt;2.6 UPDATE and DELETE&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/07/index.html"&gt;2.7 ORDER BY&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/08/index.html"&gt;2.8 Aggregate Operators, GROUP BY, and HAVING&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/09/index.html"&gt;2.9 Nested Queries with IN and Common Table Expressions&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/10/index.html"&gt;2.10 UNION, INTERSECT, EXCEPT&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/11/index.html"&gt;2.11 Transactions&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter2/12/index.html"&gt;2.12 CREATE INDEX&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Chapter 3 Worked SQL Query Examples
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://markm208.github.io/sqlbook/chapter3/01/index.html"&gt;3.1 Which Dogs Have Had the Most Visits?&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter3/02/index.html"&gt;3.2 Number of Adoptions and Average Age&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter3/03/index.html"&gt;3.3 Locations with Least/Most Aggressive Dogs&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter3/04/index.html"&gt;3.4 Average Time to Adoption By Location&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter3/05/index.html"&gt;3.5 Finding Available Capacity at Each Location&lt;/a&gt;&lt;br&gt;
&lt;a href="https://markm208.github.io/sqlbook/chapter3/06/index.html"&gt;3.6 Who Visited then Adopted an Aggressive Dog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you liked these the playbacks I have 30 more here: &lt;a href="https://markm208.github.io/workedsqlbook/"&gt;Worked SQL Examples&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are curious about how to use SQLite databases in different programming languages then check out my other 'book', &lt;a href="https://markm208.github.io/sqlitebook/"&gt;Programming with SQLite&lt;/a&gt;. This shows how to use SQLite in a C/C++, Python, and Java programs. If you'd like to stay connected and get updates when I add new playbacks you can follow me on twitter: &lt;a class="mentioned-user" href="https://dev.to/markm208"&gt;@markm208&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>sqlite</category>
    </item>
    <item>
      <title>Storing Data in a Flutter App</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Tue, 18 May 2021 02:13:37 +0000</pubDate>
      <link>https://dev.to/markm208/storing-data-in-a-flutter-app-cci</link>
      <guid>https://dev.to/markm208/storing-data-in-a-flutter-app-cci</guid>
      <description>&lt;p&gt;This series of posts covers mobile app development with Google's &lt;a href="https://flutter.dev/"&gt;Flutter&lt;/a&gt;. Flutter apps are written in Dart and can be compiled into Android, iOS, and web apps all using a single codebase. &lt;/p&gt;

&lt;p&gt;The last post covers storing data in a Flutter app. I discuss storing data on the device and off of it. I show how to use some of Firebase's services (Cloud Firestore and Auth).&lt;/p&gt;

&lt;p&gt;You will be asked to follow along with the programs below. Just click on the links and a code playback will load (you might want to open each one in a new tab). Then click on the comments on the left hand side of the screen or hit the play button to drive the development of the code. You can download the code at any point or copy/paste it. There are some controls in the top right hand side of the screen to make the text bigger or to switch to blog mode (which is good for small screens).&lt;/p&gt;

&lt;h4&gt;
  
  
  Storing data on the device
&lt;/h4&gt;

&lt;p&gt;These playbacks show how to store data on the device using shared preferences, files, and SQLite databases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter3/01/index.html"&gt;Storing App Data in a File
&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter3/02/index.html"&gt;Storing App Data in a SQLite Database&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Storing data off of the device
&lt;/h4&gt;

&lt;p&gt;These playbacks show how to store data off of the device by using the http package and Google's Firebase products.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter3/03/index.html"&gt;Storing App Data in a Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter3/04/index.html"&gt;Storing App Data in the Firebase Cloud Firestore&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter3/05/index.html"&gt;Firebase Authentication&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Comments and Feedback
&lt;/h4&gt;

&lt;p&gt;You can find all of these code playbacks in my free 'book', &lt;a href="https://markm208.github.io/flutterbook/"&gt;Mobile App Development with Dart and Flutter&lt;/a&gt;. I am always looking for feedback so please feel free to comment here or to send me a message. You can follow me on twitter &lt;a href="https://twitter.com/markm208"&gt;@markm208&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>mobile</category>
    </item>
    <item>
      <title>An Introduction to Flutter</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Tue, 18 May 2021 02:13:29 +0000</pubDate>
      <link>https://dev.to/markm208/an-introduction-to-flutter-40gh</link>
      <guid>https://dev.to/markm208/an-introduction-to-flutter-40gh</guid>
      <description>&lt;p&gt;This series of posts covers mobile app development with Google's &lt;a href="https://flutter.dev/"&gt;Flutter&lt;/a&gt;. Flutter apps are written in Dart and can be compiled into Android, iOS, and web apps all using a single codebase. &lt;/p&gt;

&lt;p&gt;In this post I cover the basics of Flutter apps- widgets, state management, navigation, and packages. There are pre-built Flutter widgets for just about everything you can think of and you can compose them together to make your own. There are also a lot of free, open-source 'packages' or libraries on &lt;a href="https://pub.dev/"&gt;pub.dev&lt;/a&gt; that allow your app to use the device's sensors, fetch data, and more. &lt;/p&gt;

&lt;p&gt;You will be asked to follow along with the programs below. Just click on the links and a code playback will load (you might want to open each one in a new tab). Then click on the comments on the left hand side of the screen or hit the play button to drive the development of the code. You can download the code at any point or copy/paste it. There are some controls in the top right hand side of the screen to make the text bigger or to switch to blog mode (which is good for small screens).&lt;/p&gt;

&lt;h4&gt;
  
  
  Intro
&lt;/h4&gt;

&lt;p&gt;These two playbacks show how to create and run Flutter apps and how to use the tools.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter2/01/index.html"&gt;Flutter Hello World&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter2/02/index.html"&gt;flutter create demo_app&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Widgets
&lt;/h4&gt;

&lt;p&gt;These playbacks cover some of the basic UI widgets in Flutter and how to lay them out on the screen.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter2/03/index.html"&gt;ListViews&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter2/04/index.html"&gt;Laying Out Widgets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter2/05/index.html"&gt;Navigation in Flutter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter2/06/index.html"&gt;Forms&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Packages
&lt;/h4&gt;

&lt;p&gt;There is a thriving community of developers contributing open source packages on &lt;a href="https://pub.dev/"&gt;pub.dev&lt;/a&gt;. Packages help you access features of the device like sensors, storage, and more.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter2/07/index.html"&gt;Using Packages in Flutter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Comments and Feedback
&lt;/h4&gt;

&lt;p&gt;You can find all of these code playbacks in my free 'book', &lt;a href="https://markm208.github.io/flutterbook/"&gt;Mobile App Development with Dart and Flutter&lt;/a&gt;. I am always looking for feedback so please feel free to comment here or to send me a message. You can follow me on twitter &lt;a href="https://twitter.com/markm208"&gt;@markm208&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>mobile</category>
    </item>
    <item>
      <title>An Introduction to Dart</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Tue, 18 May 2021 02:13:17 +0000</pubDate>
      <link>https://dev.to/markm208/an-introduction-to-dart-4pem</link>
      <guid>https://dev.to/markm208/an-introduction-to-dart-4pem</guid>
      <description>&lt;p&gt;This series of posts covers mobile app development with Google's UI toolkit, &lt;a href="https://flutter.dev/"&gt;Flutter&lt;/a&gt;. Flutter apps are written in Dart and can be compiled into Android, iOS, and web apps all using a single codebase. &lt;/p&gt;

&lt;p&gt;I begin by covering the Dart programming language. Dart is a statically typed, OO language that will feel comfortable to anyone with a background in Javascript, Java, or C#. If you are feeling adventurous you may be able to skip the first post and move on to the next one in the series to dive right into Flutter.&lt;/p&gt;

&lt;p&gt;You will be asked to follow along with the programs below. Just click on the links and a code playback will load (you might want to open each one in a new tab). Then click on the comments on the left hand side of the screen or hit the play button to drive the development of the code. You can download the code at any point or copy/paste it. There are some controls in the top right hand side of the screen to make the text bigger or to switch to blog mode (which is good for small screens).&lt;/p&gt;

&lt;h4&gt;
  
  
  Installing
&lt;/h4&gt;

&lt;p&gt;This playback covers installing the tools needed to run Dart programs and to build Flutter apps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter1/01/index.html"&gt;Hello World!!! and Flutter/Dart Install Instructions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Types
&lt;/h4&gt;

&lt;p&gt;These playbacks cover basic data types in Dart including some data structures.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter1/02/index.html"&gt;Simple Types in Dart&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter1/03/index.html"&gt;Lists (Array Based Containers)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter1/04/index.html"&gt;Maps and Sets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Flow of control
&lt;/h4&gt;

&lt;p&gt;These playbacks covers ifs, loops, and functions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter1/05/index.html"&gt;Altering the Flow of Control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter1/06/index.html"&gt;Closures&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Asynchronous programming in Dart
&lt;/h4&gt;

&lt;p&gt;Asynchronous programming is critical in UI focused programs like Flutter apps. This playback begins to cover Futures and await/async.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter1/07/index.html"&gt;Asynchronous Code in Dart&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Classes in Dart
&lt;/h4&gt;

&lt;p&gt;This playback covers classes in Dart. There are some interesting features of Dart classes like named constructors and initializers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/flutterbook/chapter1/08/index.html"&gt;Classes in Dart&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Comments and Feedback
&lt;/h4&gt;

&lt;p&gt;You can find all of these code playbacks in my free 'book', &lt;a href="https://markm208.github.io/flutterbook/"&gt;Mobile App Development with Dart and Flutter&lt;/a&gt;. I am always looking for feedback so please feel free to comment here or to send me a message. You can follow me on twitter &lt;a href="https://twitter.com/markm208"&gt;@markm208&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>mobile</category>
    </item>
    <item>
      <title>A Brief Introduction to React</title>
      <dc:creator>Mark Mahoney</dc:creator>
      <pubDate>Mon, 26 Apr 2021 14:12:45 +0000</pubDate>
      <link>https://dev.to/markm208/a-brief-introduction-to-react-1i7g</link>
      <guid>https://dev.to/markm208/a-brief-introduction-to-react-1i7g</guid>
      <description>&lt;p&gt;This is a short introduction to &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt;. React is an incredibly popular front-end framework that allows you to create encapsulated components that manage their own state. React has helped transform web development and bring it inline with modern software development practices.&lt;/p&gt;

&lt;p&gt;You will be asked to follow along with the programs below. Just click on the links and a code playback page will load (you might want to open each one in a new tab). Then click on the comments on the left hand side of the playback screen or hit the play button to drive the development of the code. You can download the code at any point and run it on your machine. There are some controls in the top right hand side of the screen to make the text bigger or to switch to blog mode (which is good for small screens).&lt;/p&gt;

&lt;h3&gt;
  
  
  React
&lt;/h3&gt;

&lt;p&gt;I start by showing a basic example of React and JSX. I will build a site to serve info about Computer Science legends in the first three examples. This program shows the beginning of the app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/webdevbook/chapter4/01/index.html"&gt;Basic React&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, I continue to build the CS Legends app in a React project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/webdevbook/chapter4/02/index.html"&gt;Creating a React App with create-react-app&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I complete the CS Legends app by creating a back-end to serve legend data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/webdevbook/chapter4/03/index.html"&gt;React with Express&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, I show the beginnings of creating a scoreboard app for a kids hockey league. At the end you will be asked to download the code and add to it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://markm208.github.io/webdevbook/chapter4/04/index.html"&gt;Scoreboard React App&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Comments and Feedback
&lt;/h3&gt;

&lt;p&gt;You can find all of these code playbacks in my free 'book', &lt;a href="https://markm208.github.io/webdevbook/"&gt;An Introduction to Web Development from Back to Front&lt;/a&gt;. I am always looking for feedback so please feel free to comment here or to send me a message. You can follow me on twitter &lt;a href="https://twitter.com/markm208"&gt;@markm208&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
