­
­
  • Twitter
  • Facebook
  • Google+
  • RSS Feed

Sunday, September 21, 2014

Reflections - Programming

No comments:
 
Before the Activity

I am going to CERN, the most important scientific laboratory in the world where they research nuclear and particle physics, during two weeks. I have been assigned as a supervisor a physicist, expert in developing software to analyze collisions of the particle super-accelerator, the LHC at CERN. I will be learning how to program using code. This is something I have never ever tried before and learning from such an important scientist is something to be proud of.

During the Activity

I have started to learn how to program with C++, a worldwide used code. My supervisor continuously assigns me different algorithms which I have to figure out how to write them in code and make it work.

After the Activity

C++ is a chracteristically difficult code to learn for begginners in the world of programming. Nevertheless, up until now, I am doing just fine. I have already developed several algorithms which work very well. Still, they are simple algorithms and I hope in the near future I can be able to write more complex and interesting algorithms. I never though programming would be so interesting.

The following algorithm written in C++ is the first one I have ever done! It finds, depending on a selection of the user, a prime number. Nevertheless, these prime numbers are very big and my supervisor, Dr. Carminati, thinks I could improve each much more:

//Welcome to the Prime Number Factory

#include <iostream>
#include <cmath>
using namespace std;

int PrimeFact()

{
double x = 1.306377883863080690;
int a = 3;
int b;

cout << "Choose a positive number from 1 to infinity and get your prime number!" << endl;
cin >> b;

double kaseo = power(x,power(a,b));

cout << "In order to get your prime number round "
<< kaseo << " to the nearest whole number" << endl;

return 0;
}

No comments:

Post a Comment

 
© 2012. Design by Main-Blogger - Blogger Template and Blogging Stuff