Factorial calculator

--Originally published at Valeria CT

For this assignment I tried different types of loops until I found out how to use a goto command and found that it was really helpful. I finally used a string and discovered that I had to include a special library for it.

Here is the link to my program: https://github.com/valeriact/tc1017/blob/master/wsq06.cpp

And the resources that I used:

 

-Valeria


On To Functions

--Originally published at Valeria CT

For this WSQ, I wrote a code that did practically the same thing that my WSQ01 did, but creating and a calling a different function for each mathematical operation. I had read about the creation of creation of function a long time ago, so I didn’t really remember how to do it. Luckily, I have an extra workspace on Cloud9 where I write short programs with the commands that I read about on the book that I feel the need to practice or that aren’t included on the WSQ’s that I’ve done so far, so I just went back to my practice code on functions and was able to do WSQ05 quickly.

My program doesn’t fit completely in the image above, so here’s a link to my code on GitHub: https://github.com/valeriact/tc1017/blob/master/wsq05.cpp

I haven’t set up completely my GitHub account nor have I installed Atom and Cygwin on my laptop because I need to update and reset my laptop first and I haven’t had the chance to do so; therefore all of my programs are on Cloud9. As soon as I have all of these set up, I’ll post an entry with the link to all of my WSQ’s.

The resource that I used for WSQ05 was the book How To Think Like a Computer Scientist. 

-Valeria


Sum of Numbers

--Originally published at Valeria CT

I believe that this is the practice that I’ve struggled with the most and the longest. I tried doing what was asked through conditionals, recursion, functions, “while” loops, etc. I read How to think like a computer scientist again and again and did a lot of reasearch on the Internet. Finally, Damian helped me by explaining to me how a “for” loop works and I was able to write my code. I had a few syntax errors at first, but that didn’t take as long to correct.

Here are the resources that I used:

 

-Valeria


Pick a Number

--Originally published at Valeria CT

This was the assignment that I’ve struggled with the most. I had to read a lot, reasearch many terms and ask for help. After about three days working on this, I finally figured out a simple way to write the code.

The resources that I used were:

The picture of my code running can be found on top.

-Valeria


Temperature

--Originally published at Valeria CT

For this assignment, the challenge was to learn how to use conditionals. This, in comparison to the previous assignments, was easy for me because I did a program in middle school with this language that consisted basically of these functions. You can find a screenshot of my code above.

– Valeria


Fun with Numbers

--Originally published at Valeria CT

The assignment for week 2 was Fun with Numbers. It consisted on developing a program in which the user could type in two numbers and the program would display the sum, difference, product, quotient, and remainder of these.

To do this, I read through the chapter of How To Think Like a Computer Scientist on Operators. When I got the basic idea, I began to write the code. As soon as I started doing this I realized that I knew that I had to create a variable for each of the numbers that the user would type, but I didn’t know how inputs worked, so I looked it up online and found a few webpages that explained it. It was pretty simple, thus I finished my code and tried running it.

On my first attempt my code would only display the first part of the program, so I thought that I hadn’t understood inputs quite well, but when I looked further into it, I saw that what I had was a syntax error: I was missing the “<<” between my string output and my operation outputs. I typed in the missing “<<” and ran the program again, this time successfully!

 

Here are the links that helped me develop the wsq01:

 

– Valeria


First Entry

--Originally published at Valeria CT

To begin my first post I’d like to say that I agree to the TC1017 Page 1.

Now about WSQ00:

For our fisrt assignment we had to set up our laptops with the appropiate software to program in C++. Since my computer has Windows 8.1, the bash terminal that I needed was Cygwin, so I saw Ken’s video on how to download and install it. I was able to do the forst part, but when it came to the actual installation I didn’t understand how to do it. I could’ve just copied what Ken did, but I don’ like to do things without knowing what they are.

Thus I asked Ken to help me but there were some schedule complications, so we agreed that he’d help the next class. However, by then he had proposed another option: Cloud9. With this platform I had no need to install Cygwin anymore, so I signed up on the website and erased Cygwin from my files.

Simultaneously, I began reading the recomended book How To Think Like a Computer Scientist by Allen B. Downey. The first few pages were about what is C++ and the basic program for learners “Hello World.” I got the hang of it, but I found annoying that it didn’t explain thouroughly what each word in the code meant or what they were for; so I was able to do the “Hello World,” but I didn’t really get what I was doing. Watching Ken’s video on the subject helped  little, but I would like to research more or practice so I can fully understand what’s going on when I compile and run each program. I’ll try to do more research and practice more the basics before I move on to WSQ01.

-Valeria