Skip to main content
 

Final Project #5

1 min read

Here is a link to our code for the final sodoku project of Kens TC1017 C++ course:

Final Code

 

Mastery 27

2 min read

   To receive points for the 27th mastery we must prove we have mastered the concept of Validating User Input. This means that if the user is asked to input something that the input follows the specifications given earlier.

   For example, If the programs need the user to input a number between 1 and 100, the user is not able to input anything but that specification. They are not able to input numbers below 1 nor numbers above 100. Those are the simple things. The user is also not allowed to input any letters.

   Purpose of the mastery is to show a master of checking the input and amking sure it follows the specifications given. This is fairly easy because it can be done simply with 'if' and 'else' statements.

   If the code does not originally contain a check to see if the user inputed values meet the specifications desired, all that must be done is create an 'if' statement which is only triggered if the specificatinos are met which contains the code which is desired to be compiled. Then contain an 'else' statement which contains something that could restart the input process or simply output "not a valid input"

   Here is my completed code for mastery 27 of Kens TC1017 C++ course: mastery27

   Here is a picture of the running code:

 

Mastery 25

1 min read

   In order to earn points for the mastery #25 for Kens TC1017 C++ course you must show the mastery of the topic of strings. 

   A string is a line of values. Another way to describe it is a 'char' value except it acts as a list ordered in one row. The string can hold both letters and numbers. Below is an example of what i just said.

   The string "letters" is given the value "T" at first, then the string "letters" has its current value ("T") added to another "T" making the new value "TT"

   The string does not only have to be individual letters but it can be a word. Another example is in Quiz #11 we had to make a function which counted how many times the word "banana" was in a text file. The way to complete this was to use a string to find the word in the text file.

   Here is a link to my code for the 25th mastery for Kens TC1017 C++ course via GitHub: mastery25

   Below is a picture of the working code:

 

Mastery 26

2 min read

   The task for this mastery was to create a matrix using C++. in order to complete the mastery you must first know what a matrix is. A matrix is a set of values arranged in a rectangle or a square. Show below are 2 examples of very simple matrices:

            1  2

            3  4

           -and-

         1  2  3  4

   Matrices are able to hold a value of any size and they are also able to have any amount of rows and columns. The matrices are defined by its size, for example: a 3X3 matrix (shown in the picture below) contains 3 rows and 3 columns, or a 5X1 matrix contains 5 rows and 1 column.

   To make a matrix in C++ you have a few options, you can use: vectors, arrays, or strings. The easiest to use in my opinion are arrays because you are able to change the values of the cells in  easily.

   Using arrays you must first decide how many rows you want because this will lead to the number of arrays which need to be created.

   The next step is to decide the number of columns you want so each array created will have a certain amount of values.

   The third step is to declare the set amount of arrays with the set amount of values in each one.

   The fourth step is to insert values into the cells of each row or column so the matrix holds values.

 

   Here is my code for the 26th mastery for Kens TC1017 C++ course via GitHub: mastery26

   Here is a picture of the code running on my MacBook:

 

Final Project Post #4

1 min read

Here is my 2nd to last post regarding the Final Sodoku Project in Kens TC1017 C++ course.

The code is very similair to the code for week except for a few small changes. The code is completed and only needs to have a few things rewritten so it is able to be comprehended easier. Just one more week everyone. I've had a great time. See you all on the flip side.

 

WSQ16

1 min read

Here is my code for the 16th WSQ in Kens TC1017 C++ programming class via GitHub: WSQ16

Here is a picture of the code working:

 

Quiz 11

1 min read

Here is my code for the 11th quiz via GitHub: Quiz11

I hope this helps those of you who have not completed the quiz yet :D

 

Final Project Post #3

1 min read

Here is my 3rd post regarding the final project in Kens TC1017 C++ programming course.

We only have a few things to add in the prgram now. We have implemented color and made sure the user can only input valid (legal) numbers. Although the code works well and there are no bugs, it is pretty long. We might be able to shorten it using some math functions but for now we have left it long.

We only have 2 more weeks

Push through everyone

 

Quiz 10 TC1017

1 min read

Here is my code for the 10th quiz in Kens TC1017 C++ course

Question 1

Question 2

 

Bonus Quiz

1 min read

Here is proof i completed my bonus quiz

 

Final Project Post #2

1 min read

This is another post regarding the final project in Ken Bauers TC1017 C++ programming class.

Our progress on my teammate and i's sodoku is very far. We have created a all of the necessary  functions in the program it it works wonderfully. We have even added color and changed the code so the user is not able to input certain rows, columns, numbers, and even in certain locations. The sodoku is almost completed we just have to fix a few errors in it.

 

Final Project Post #1

1 min read

This is a post regarding the final sodoku project in Kens TC1017 course on C++ programming. 

My teammate Juan Fransico and I have made a lot of progress. We have nearly completed the code. What we have left is re-coloring the code and making the code easier to read. The Sodoku is completed and works perfectly but it is very long. We are able to shorten it using a few math formulas. 

I hope you all are progressing well on your code.

 

WSQ 15

1 min read

My plan for completing all of the work for Kens course TC1017:

This Week: Work on the code for the Sodoku and finish all the WSQ's

Next Week: Finish all of the Masteries so the only work i have left is the Final Project

Week After: Complete all of the Sodoku code and study for final test

Final Week: Relax

 

Quiz 9

1 min read

Here is my corrected code for the final exam in Partial 2

Q1 Code

Q2 Code

Q3 Code

Q4 Code

 

Mastery 21

1 min read

Here is my code for the 21st mastery via GitHub: Mastery21

For the 21st mastery, you must use and show the use of recursion. As an example, i created a program to calculate the factorial of a inputted number. The way to compute the factorial without a loop is by recalling itself (recursion). 

In my code, The 'Fact' function contains the inputted number and a new 'int' named 'factorial' The code then will assign the value 1 to the 'factorial' int if the number inputted is 0. Otherwise, the 'factorial' int will be assigned to itself multiplied times the whole function again, except with the inputted number minus 1.

The recusion process has nothing to do with any outputting nor inoutting. The only thing needed to create repetition using recusion, is for one function to recall itself.

 

WSQ14

1 min read

Here is a link to my code for the 14th WSQ via GitHub: WSQ14

 

Mastery 22

1 min read

In order to eceive credit for the 22nd mastery, when a certain type of repetition should be used must be described.

There are 2 ways of creating repetition

1: Loops

     Examples of loops are 'for' or 'do and while' loops. These repetitions sould be used when large amouns of repetitions are needed.

2: Recursion

     A recursion is where a function is created to recall itself. This repetition should only be used when the amount of repetitions needed are fairly small. This is because the recursion process must recall itself fully each time making the amount of time between completions of reetitions grow exponentially.

 

Mastery 17

1 min read

Below is a picture of my code for mastery 17 working

A link to my code on GitHub is also attached: mastery 17

 

Mastery 09

2 min read

In order to receive points for this mastery, you must descibe basic types and their uses.

In C++ there are not many basic types. These basic types incude:

     void, int, float, double, char, string, and, bool

and other more specific variations of the 7 listed.

- The 'void' type is used for fucntions and it makes the fucntion not have a number value. As seen on the test for Partial 2 the triangle function must be a void function because i does not hold any numerical values

- An 'int' type creates an integer number, meaning the 'int' type does not hold any decimals

- A 'float' type is another type which holds a number but different than the 'int' it is able to hold decimal values

- A 'double' type is very similar to the 'float' type except it is able to hold more decimals making the caluclations more accurate

- A 'char' type is a type which hold letters and variables but no number values

- A 'string' type is a type which can hold, numbers, letters, and variables which can be reacalled individually

- A 'bool' type is a type which is commonly used to evaluate a function only if the statement given is true

Most of these basic types are able to have other modifications. For example the 'char' type only holds only letter or variable but there are other 'char' types which are able to hold more values.

I hope this breif summary has given you a better grasp on the meanings and uses of the basic C++ types

 

Mastery 13

1 min read

For the 13th mastery of the TC1017 C++ course, you must import and use C++ libraries.

You may not have known, but you have been cokmlpeting this mastery ever since your first WSQ of the class. Ken taught us to include a library called:

     <iostream>

and also to use:

     namespace std;

These are libraries which simplify the code we write and are necessities for creating certain code.

For example, for the 10th WSQ, we were required to use Arrays and/or Vectors to calculate the sum, average, and standard deviation of a group of numbers. In order to complete this you must, first of all, use the square root function. This is included in a library called

     <cmath>

for c++. Without inculding this library you willl not be able to complete the program. Also, when using Vectors, the library

     <vector>

must be included because vectors are not included in the library:

     <iostream> 

nor when using

     namespace std;