Rusty keys

#WSQ03 #WSQ1017

For this next program we were instructed to make some basic operations out of two numbers given by the user. It was completed almost with ease, and I say almost because I had to recheck some basic stuff such as the predecence of operators and some syntaxs rules when using cout and cin. This was achieved thanks to the ebook referred in the syllabus.

Below we can see both the source code and the running program:

proof_op.PNG

Source code:

#include <iostream>
using namespace std;

int firstnumber;
int secondnumber;

int main(){

cout << “Reminder: This program only accepts integer numbers” << endl;
cout << endl;
cout <<“Please enter the first number:”<< endl;
cin >> firstnumber;
cout << “Please enter the second number: “<< endl;
cin >> secondnumber;
cout << endl;

cout <<“The difference between your first number and your second number is: “;
cout << firstnumber – secondnumber << endl;
cout << endl;
cout <<“The difference between your second number and your first number is: “;
cout << secondnumber – firstnumber << endl;
cout << endl;

cout <<“The product of both numbers is: “;
cout << firstnumber*secondnumber <<endl;
cout << endl;

cout <<“The result of your first number divided by the second is: “;
cout << firstnumber/secondnumber << endl;
cout << endl;

cout <<“The remainder of the division is: “;
cout << firstnumber%secondnumber << endl;

}

———

Photo Credit: <a href=”https://www.flickr.com/photos/42333408@N02/6248243245/”>Felipe_Borges</a&gt; via <a href=”http://compfight.com”>Compfight</a&gt; <a href=”https://creativecommons.org/licenses/by-nc-nd/2.0/”>cc</a&gt;

(Re)loaded

15305597631_ef6846f709

Photo Credit: <a href=”https://www.flickr.com/photos/62490191@N04/15305597631/”>Stephen Tierney.</a> via <a href=”http://compfight.com”>Compfight</a&gt; <a href=”https://creativecommons.org/licenses/by-nc-sa/2.0/”>cc</a&gt;

—-

#TC1017 #WSQ02

Now that everything’s up and running as expected, I’m ready to tackle this course and actually quite excited about making new programs. As of now, the first problem has been solved: display “Hello World!” on the computer screen.

ProofHello

The picture above shows both the cygwin compiler and the folder in which the .cpp and .exe files for the source code were created:

#include <iostream>
using namespace std;

int main(){
cout << “Hello world!” << endl;
}

Making the program was easy, but it took me some time and a little help from Bauer to figure out how to properly run the program.

The rest of the problems will be uploaded soon.

TC1017: Week 1: Getting started

#WSQ01 #TC1017

The first of many blogs to come, things may look a bit dire for the moment but I’m just getting used to this. First of all, I must confess social media is really unknown territory for me, I use Facebook mainly for messaging and as a news feed and rarely do I share/comment/like anything, I just never had the interest. Twitter I’ve never used before so I’m feeling like an old grandma using it right now. Thigs should become more comfortable as days go by.

On the other hand, I’m quite familiar with programming. This is the second time I take this course, in fact I took it (and failed, obviously) a year and a half ago. This time things should run smoothely, I’m actually quite excited to learn properly this time.

Anyway, most of the to-do list sent by Ken has been done, now all that’s left is installing the various software. I’ll be back once everything has installed, hopefully no problems will arise. One can only dream, right?

——-

Photo Credit: <a href=”https://www.flickr.com/photos/53611153@N00/5215738292/”>Darwin Bell</a> via <a href=”http://compfight.com”>Compfight</a&gt; <a href=”https://creativecommons.org/licenses/by-nc/2.0/”>cc</a&gt;