Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152
‘#333333’ Articles at TC101 Fall 2015, Page 3
Introduction to Programming Python and C++

Tag Archives: #333333

#QUIZ07

When I first look at the Quiz, I didn´t know what to do, but with some research and using the string library I realize how to write the code and eventually, compile and run it.

The first programm is the one that calculates the fibonacci of a given position number, it was way difficult than I thought, but it the end…it works just fine.

 <iostream> //Ever Ibarra Almaral TC1017
using namespace std;

long fibonacci(long n){
  long x;
      if (n<=1){
      x=n;
      return x;
  }
      else{
      if(n>1){
          int y=0;
          int z=1;
          long temp;
          for(int i=1;i<n;i++){
      temp=y+z;
      y=z;
      z=temp;
    }
    return z;}
  }
  }

  void newline(){
    cout<<endl;
  }
  int main () {
    long a;
  cout << "Hello, I´m a calculator of fibonacci algorithm";
  newline();   newline();
  cout << "Please, enter the position of the number in the fibonacci algorithm: ";
  cin >> a;
  newline();
  cout << "The fibonacci number is: " << fibonacci (a);

  return 0;


}

https://github.com/everibarra/TC101-C-/blob/master/PROGRAMM%201%20QUIZ07

The second programm deals with strings in order to check if the word is a palindrome or not.

 <iostream> //Ever Ibarra Almaral TC1017
<string>
using namespace std;

string palindrome(string a){

a=string(a.rbegin(), a.rend());
return a;
}

void newline(){
  cout<<endl;
}

int main(){
  string b;
  cout<<"Enter the string "<<endl;
  cin>>b;
  newline();
  cout<<"the reverse string equals to "<<palindrome(b);
newline();
  if (b==palindrome(b)){
    cout<<"The string is a palindrome"<<endl;
    newline();
  }
  else{
    cout<<"The string its not a palindrome"<<endl;
    newline();
  }

  return 0;
}

https://github.com/everibarra/TC101-C-/blob/master/PROGRAMM%202%20QUIZ07

 

#WSQ10 Lists

Lists

 

In this wsq I had to do a program where the user had to input 10 numbers whatever and the program have to give him the total of the addition of all the numbers, average and standard deviation of those numbers. Every time I feel this like, ooh look I´am a c++ function, use me but I ´m not going to tell you how to use me so, teach by yourself loser, and I´am like, 🙁 okay (cries in spanish), but this like my teacher said,: It´s not difficult, you only have to remember each one and what they do, and I ´am like 🙁 okay, but kids don´t mess with c++, if you do, maybe it can beat you.

Link to my acount of github:https://github.com/MarAnMu13575/-WSQ10-Lists/tree/master

Links where I found information about the topic:  

http://www.cplusplus.com/reference/list/list/

http://www.cplusplus.com/reference/list/list/

https://www.youtube.com/watch?v=o5wJkJJpKtM

The code:

 <iostream>
 <math.h>
using namespace std;

float aver(float x){
  return (x/10);
}

int main (){
	float array1[10];
	float suma=0;
	float square=0, deviation;
	for (int i=0; i<10; i++)
	{
		cout<<"Introduce an value, and be gentle:  "<<(i+1)<<" : "<<endl;
		cin>>array1[i];
	}

	for (int i=0; i<10; i++)
	{
	suma+=array1[i];
	square+=(array1[i])*(array1[i]);
	}
	deviation=sqrt(square/10);
	cout<<"The addition is equals to: "<<suma<<endl;
	cout<<"The average of the numbers you introduce is: "<<aver(suma)<<endl;
	cout<<"The standard deviation of the numbers you introduce is: "<<deviation<<endl;

return 0;
}

 

15 cute postals for your enemy: http://9gag.com/gag/apB80jE (This is 9gag, this is fun)

 

#WSQ09 Factorial

 

Factorials

In this WSQ I used the factorials, and what is that? you maybe are asking, this is a factorial: 

 

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal ton. For example,

5! = 5  times  4  times  3  times  2  times  1 = 120.

And I´m here, yeah, you can ask me whatever about it, if I don´t know maybe I can talk with my classmates and help you, you little human, jajaja :).

 

 <iostream>

<cmath>

 using namespace std;

int main(){

    int num, factorial= 1;

cout<<"Enter number to find it´s factorial: ";

cin>>num;

for (int a=1; a<= num; a++)

{

factorial= factorial*a;

}

cout <<"The factorial is:  over 9000 "<<endl; 

cout <<"Na, I´m joking, this is the real:  "<<factorial<<endl;

cout<<"Thanks for visiting us, see you "<<endl;

return 0;

}

 

Github link (This dark place where I save all my programs if you want, take a look over here):

 https://github.com/MarAnMu13575/-WSQ09-Factorials/tree/master

#WSQ08 On to functions.

 I´ve been studying functions for a little while, in this occasion I was able to rewrite the code from the wsq03 and improve certain parts of the code with functions.

Functions are an essential tool when we are writting code, because it makes our lifes easy, just think about writting the same formula over and over again in a programm…when all you have to do is to create a function and then called it as many times as you want. Programming ain´t easy, but it´s interesting how every technological device works with some kind of source code.

 

 Here´s my code.

 

#include <iostream>
#include <math.h>
using namespace std;

double addition  (double a, double b){ //addition is the name of the function
return a+b;
}

double sustraction (double a, double b){
return a-b;
}

double product (double a, double b){
return a*b;
}

double division (double a, double b){
return a/b;
}

int remainder (int a, int b){
return a%b;
}

void newline(){
  cout<<endl;
}

int main(){
double a;
double b;
cout<<"Hi, I´m a calculator of two numbers, I will make operations of addition, product"<<endl;
cout<<"sustraction, division and eventually calculate the remainder between the numbers you´ll give me"<<endl;
newline();
cout<<"Please, give me the first value "; cin>>a;
newline();
cout<<"Please, give me the second value "; cin>>b;
newline();
cout<<"The addition of the numbers equals to "<< addition(a,b)<<endl; //We are calling the function
cout<<"The sustraction of the numbers equals to "<< sustraction(a,b)<<endl;
cout<<"The product of the numbers equals to "<< product(a,b)<<endl;
cout<<"The division of the numbers equals to "<< division(a,b)<<endl;
cout<<"The remainder of the division equals to "<< remainder(a,b)<<endl;

return 0; //...So the programm wont return values.
}

Mastery 10!

Here is video of mastery 10 😀

Hope it helps.

It’s about:

  1. Basic output (printing) and input (text based) in C++

 

#Mastery04 – Submit work via Blog RSS and GitHub

Hey this is about RSS and Github

What is a RSS?

The RSS is a system that is kind of a bookmark where you can get subscribed to pages and get a feed of it in certain periods of time, this is actually really efficient because, you don´t need to be entering the page multiple times, you just need to subscribe and RSS will do all the rest.

96

Normal
0

21

false
false
false

ES-TRAD
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Tabla normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Calibri;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-fareast-language:EN-US;}

This is a technology used by many people to follow their favorite webpages. Its is not a book mark. Bookmarks, when installed in your browser stay the same as they ore from the beginning. Rss lets you keep track of what is happening around and keeps your Bookmarks on date.

It´s really simple to get to use the “Really Simple Syndication” what you want to do is to hook yourself up with an RSS reader, there are many available online.

What is Gitbuh?

 

Github is a social programming platform where you can publish all of your coding works and share them to people. Publish them if you need any help or want to help others too. This site is kind of a facebook for programmmers. The libraries are called repositories in which you can save your programming works.

WATCH MY VIDEO https://youtu.be/l4iIsBH6r4M

Mastery #10

Mastery #10

 

10. Basic output (printing) and input (text based) in C++ (This is in spanish, because it´s more easy for me to explain)

https://www.youtube.com/watch?v=NneV7ZA4Yt4&feature=youtu.be

Masteries 3 and 4!

Here is my third video about the masteries. 

Hope it helps.

It’s about:

  1. Create accounts: Blog, Twitter, GitHub
  2. Submit work via Blog RSS and GitHub

 

Masteries 15 and 16!

Here is my SECOND video about the masteries. 

Hope it helps.

It’s about:

  1. Use of the conditional “if”
  2. Use of “else” with a conditional

Masteries 1 and 7!

Here is my first video about the masteries. Using http://www.screencast-o-matic.com which is a realy easy-to-use recording software.

Hope it helps.

It’s about:

  1. Ability to create C++ file and run from command line
  2. Use of comments in C++

What should you work on?

Week #12 and more partial exams for you.

For this week's readings:
C++ (TC1017) should either be looking at support for your project, ImageMagick C++ libraries are a good start.
Python (TC1014) should be finishing chapter 11 (Dictionaries).