Programming

Part of my passion in life, besides life itself, is programming and computers. I especially like the idea of smart computers through smart programs and OS. Which is what I want to focus on in my career, creating intelligence to various degrees to help create better and more efficiency user experiences for computers.

Bellow is a table of various code snippets and articles organized by language.

C/C++ C# Java JavaScript
Returning an Array of Pointers javascript trim

15 Exercises for Learning a new Programming Language

This is an exercise to both learn a language, but also to compare different languages. The original idea can be found here.

  1. Display series of numbers (1,2,3,4, 5....etc) in an infinite loop. The program should quit if someone hits a specific key (Say ESCAPE key).
  2. Fibonacci series, swapping two variables, finding maximum/minimum among a list of numbers.
  3. Accepting series of numbers, strings from keyboard and sorting them ascending, descending order.
  4. Reynolds number is calculated using formula (D*v*rho)/mu Where D = Diameter, V= velocity, rho = density mu = viscosity Write a program that will accept all values in appropriate units (Donメt worry about unit conversion) If number is < 2100, display Laminar flow, If itメs between 2100 and 4000 display メTransient flowメ and if more than メ4000メ, display メTurbulent Flowメ (If, else, then...)
  5. Modify the above program such that it will ask for メDo you want to calculate again (y/n), if you say メyメ, itメll again ask the parameters. If メnメ, itメll exit. (Do while loop)

    While running the program give value mu = 0. See what happens. Does it give メDIVIDE BY ZEROメ error? Does it give メSegmentation fault..core dump?メ. How to handle this situation. Is there something built in the language itself? (Exception Handling)
  6. Scientific calculator supporting addition, subtraction, multiplication, division, square-root, square, cube, sin, cos, tan, Factorial, inverse, modulus
  7. Printing output in different formats (say rounding up to 5 decimal places, truncating after 4 decimal places, padding zeros to the right and left, right and left justification)(Input output operations)
  8. Open a text file and convert it into HTML file. (File operations/Strings)
  9. Time and Date : Get system time and convert it in different formats メDD-MON-YYYYメ, メmm-dd-yyyyメ, メdd/mm/yyメ etc.
  10. Create files with date and time stamp appended to the name
  11. Input is HTML table, Remove all tags and put data in a comma/tab separated file.
  12. Extract uppercase words from a file, extract unique words
  13. Implement word wrapping feature (Observe how word wrap works in windows メnotepadメ)
  14. Adding/removing items in the beginning, middle and end of the array.
  15. Are these features supported by your language: Operator overloading, virtual functions, references, pointers etc.

C# Java
Learn 2 C# 1 Learn 2 Java 1



(comments (0) | permalink)
Name
Email (required)
URL
Enter your comment