Author Archives: Asa Puls

Final Project Post

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.

Project Post

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

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

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

Q1 Code

Q2 Code

Q3 Code

Q4 Code

Mastery 21

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

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

Mastery 22

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

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

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

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;