Homework 7: Lists

--Originally published at Let's CODE

This program will ask the user for 10 numbers and will be stored in a vector. Then, the user will be able to see the total of the sum, average and standard deviation of those numbers. A vector is very easy to use, you have to asign a type to the vector and give it … Continue reading Homework 7: Lists

Homework 6: Factorial Calculator

--Originally published at Let's CODE

Let’s make a factorial calculator! First of all, we have to know what a factorial number is. If you see a number that is accompanied by an exclamation sign, you’re seing a factorial number, that consists in a number multiplied by all the precedent integer numbers until reach one. For example, 6!= 65432*1 = 720. … Continue reading Homework 6: Factorial Calculator

Quiz Week 6: Multiple exercises in an only quiz

--Originally published at Let's CODE

The quiz for today consited in five exercises that we had to do during the class, which came from a page called C/C++ PROGRAMMING EXERCISES (they were the first five ones). In the first problem, we had to modify a determinated code to make it work. The original code was: #include main() { /* PROGRAM … Continue reading Quiz Week 6: Multiple exercises in an only quiz

Quiz Week 6: Multiple exercises in an only quiz

--Originally published at Let's CODE

The quiz for today consited in five exercises that we had to do during the class, which came from a page called C/C++ PROGRAMMING EXERCISES (they were the first five ones). In the first problem, we had to modify a determinated code to make it work. The original code was: #include main() { /* PROGRAM … Continue reading Quiz Week 6: Multiple exercises in an only quiz

Homework 5: Calculator

--Originally published at Let's CODE

This program will make some basic operations. It’s just like the program of the first homework, but using functions. We have to create 5 functions: sum, subtraction, multiplication, division and remainder. Each function must read two integer parameters (the same for each one) given for the user. Also, we have to declare another variable which … Continue reading Homework 5: Calculator

Homework 4: Sum of Numbers

--Originally published at Let's CODE

This program sums a range of consecutive numbers, between a given range by the user. It’s very simple to make, I will show you step by step how to make it. As usual, you need to call the necessary libraries and open the main function. We have to declare two variables for the bounds, one … Continue reading Homework 4: Sum of Numbers

Homework 3: Pick a number

--Originally published at Let's CODE

I have to say that this task is a little more complicated than the previous exercises, because it was necessary to use a special function to generate numbers randomly. This program was thought as a game, where the user have to guess a random number. I decided to give the user only five chances to … Continue reading Homework 3: Pick a number

Quiz Week 4: The minimum value and sum of squares

--Originally published at Let's CODE

I utilized two functions to do this program, one is in charge of comparing two values and then keep the minor of both, to campare it again with any other value. The other function calculate the sum of the square of given values. After stablish that, I proceeded to ask the user for the quantity … Continue reading Quiz Week 4: The minimum value and sum of squares

Homework 2: Temperature

--Originally published at Let's CODE

Now our task was to biuld a program that convert the temperature mesures from Fahrenheit to Celsius degrees, and at the same time indicate if the water boils at the given temperature. It was necessary a few calculations, cout commands and some conditionals to make it work, being this the result: #include <iostream> using namespace … Continue reading Homework 2: Temperature

Homework 1: Fun with numbers

--Originally published at Let&#039;s CODE

Our first assigment was to make a program that asked the user for two numbers and then showed the sum, difference, product, integer quotient and remainder of that numbers. The code I made is very simple, I just included an additional library (<math.h>) to use the fabs function whe dividing the numbers, because the instructions … Continue reading Homework 1: Fun with numbers