Thursday, June 29, 2017

Turbo C assignment - No 1 - C Sharp - 170629Thu

  Turbo C assignment # 1  
.
(Re-Written in visual C# 2010 for producing here)
Version: 170629Thu
.
A few decades ago when I was learning computer programming in some institute in Karachi, Sindh, Pakistan, during orientation class a teacher, who after-wards taught us 'dBASE III plus' and was very good teacher, praised 'C' computer programming language a lot. And that created special kind of curiosity in me for 'C' programming language. And a line he spoke about benefits of learning 'C' computer programming language is still very valid in 2017.
.
And when in 2nd semester we started learning 'C' programming language, I was going ahead of class work; at least I was thinking so. I was reading my 'C' book faster than class lecture was going. I was going to library and reading different books on 'C' programming language. I was going to computer lab and writing sample and example programs from books looking interesting to me and experimenting with those programs and was also solving exercises from different books.
.
In that class I/we learned 'C' programming language through 'Turbo C Ver 2'. 'Turbo C's IDE was very excellent and advance. During that time before and beside 'Turbo C' I liked 'GW-Basic' for its own good IDE and 'dBASE III plus' for it's very good IDE.
.
As I am writing this text, time then spent in that institute is coming to my mind. Friends of that time/institute, teachers and specially that of 'C' subject, class room, computer labs and especially 'C' lab, library etc. Everything is revisiting my mind in pieces in random sequence. And a gentle wish of some-how going back in time to that time and place is also coming in my mind. But because it cannot happen so I am getting a strange feeling of loosing something.
.
From that time a program written in 'Turbo C' is still available with me in hard copy. Special thing about that program is that it was first assignment of 'Turbo C', my favorite subject/class of 2nd semester, and so still is very memorable for me. One more thing special about it is that, on assignment submitting day in 'C Lab' after loading 'C' assignment in 'Turbo C' IDE, I was waiting for 'C' teacher to come up to me to inspect/check my assignment. I was sitting in front of PC with my back towards PC. On my turn teacher came to me and while looking on monitor of PC I was using said to me with his ever smiling face and eyes "Oh, you did nothing". I got shocked and looked back at computer screen ... Computer monitor was blank ... "What happened? Where is everything? ..." I said to myself. Meanwhile teacher touched some key on keyboard and everything came back, monitor becomes alive again. I felt relieved and relaxed. My teacher then looked at the code for a while and then ran/executed the program by pressing 'Ctrl+F9'. Turbo C IDE compiled the program and displayed it’s output. Teacher looked at program’s output and smiled. Then teacher again looked at the code and ran the code a few more times. Then my teacher praised me for my assignment, but not before disturbing my heart beat, and went to next student sitting in front of next PC beside me, who was then a very good friend of mine. Meanwhile my heart beat started to come back to normal.
.
Turbo C assignment requirement
Requirement for 'Turbo C' assignment #1 was to display all tables from '2' to '10' together on computer monitor with proper formatting.
.
Assignment Code migration from Turbo C to C# 2010
'Turbo C' is available on my Pentium 3 and that Pentium 3 is not booting, in fact it is not getting ON, and I am neither fixing it myself nor taking it to shop for fixing it. So I cannot write that assignment in 'Turbo C'. So I wrote it in visual c# 2010 as a console application for producing here on my this blog post.
.
Following is the C# code for achieving above discussed 'Turbo C' assignment requirements in 'C# 2010' Console application. I made a few +/- to original code for adjusting to C# console application. Code is well documented and easy to understand.
.

.
Visual C# 2010 Code
.

.
Application Output
(Console screen/window after program execution)
.
If there are any mistakes then I will surely remove them whenever found.
.
I used 'Snipping Tool' for getting Screen-shot of application discussed above. And I did this for the first time for this post. Doing this helped me keeping background color of post.

Enjoy Complete Source code of application written and compiled in visual studio 2010 Ultimate by me. Download it. Extract it. Read 'ReadMeFirst.txt' file and do as is explained in it.


No comments:

Post a Comment