Hello, curious readers! Welcome to my sixth program, which is very interesting. Basically , it´s a factorial calculator. A factorial is the result of multiplying a sequence of descending natural numbers down to 1 (such as 4 × 3 × 2 × 1).
-For example : 4! = 4 × 3 × 2 × 1 = 24
In this program below, user is asked to enter a POSITIVE integer. Then the factorial of that number is computed and displayed in the screen. Specifically in my program , I found the factorial of a non-negative integer (entered by the user) using recursion.
Remember that a function that calls itself is known as a recursive function. And, this technique is known as recursion.
Hello programmers. This is my fifth program using Atom and ubuntu bash on windows. This is a very important code , because I did all of the math operations using functions. I defined my own functions, I didn´t use libraries, so it is a user-defined function, which groups code to perform a specific task and that group of code is given a name(identifier).
When the function is invoked from any part of program, it all executes the codes defined in the body of function.
I did WSQ01 – fun with numbers again , but now I needed to ask the user for the input and then call each function to calculate the answer for each of the parts.
¡Hello , programmers and curious friends! This is my fourth program , created using Ubuntu bash and Atom. For this task , my classmates and I were instructed to create a program that asks for a range of integers and then prints the sum of the numbers in that range (inclusive).
For example, the sum from 6 to 10 would be 0 + 6 + 7 + 8 + 9 + 10.
I decided to use a loop to calculate the sum, because my programming teacher Ken Bauer, wanted us to practice repetitive work.
The third task was to create a program that picks a random integer in the range of 1 to 100. After that , the game starts when the user has to guess which number does the program picked, with hints of ’too high’ or ’too low’.
The program continues to run until the user guesses the integer.
I added some extra steps, because I wanted to show more information to the users , like:
¿How many guesses they had to make to get the right answer?
For this task , my classmates and I were instructed to create a program that will prompt the user for a temperature in Fahrenheit and them convert it to Celsius. The formula that made the conversion possible was C = 5 ∗ (F − 32)/9 (where F = Fahrenheit).
The resources that helped me were:
-cpluplus.com -How to think like a computer scientist.
I added some extra steps to show more information to the user , depending on the number (x) given , like if:
-Water boils at x temperature.
-Water is in its solid state, ice.
-Water, in its solid state, becomes liquid due to its melting point.
Hello! curious readers. “Fun with numbers” is the first problem that Professor Ken Bauer assigned us. The task was to create a program that complies with the points shown in the image and thereby solve the problem.
The language is simple to understand once you study a little. The book “How to think like a computer scientist” was very useful to conceive my code, in addition to several videos of youtube.
I hope you like program and really understand the whole code
Welcome! , curious readers. This is my first post of the semester but it´s not my first approach to programming. For some health causes I had to take some months to take care of myself , but now I´m back and going to be publishing a lot of atom programs.
In this post I only show the simple code to output “Hello world” . It´s a great first example of what you can do with C++.