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. |
Thursday, June 29, 2017
Turbo C assignment - No 1 - C Sharp - 170629Thu
Tuesday, June 13, 2017
The Great Green ReCycle - 170613Tu
The Great Green ReCycle - 2017 |
. |
(Simplified method for making world greener) |
Version: 170613Tu |
. |
I have a great fondness for two types of plants. Firstly, those that produce vibrant flowers with captivating colors, fragrances, and shapes. Secondly, those with striking leaves in a kaleidoscope of colors, shapes, and designs. I'm thrilled to see the vast array of colors and patterns in nature, both in flowers and leaves. While collecting and planting these plants in our home lawn a few years ago, I realized that there wasn't enough space to accommodate all the varieties I wanted. It dawned on me that a single lawn couldn't possibly showcase the vast diversity of plants that nature has to offer. |
. |
After running out of space in our home lawn, I reluctantly moved outside and started planting different type of plants in a park near our home. There, I met a retired military havaldar, who shared my passion for gardening. Every morning, he was diligently watering plants in the same park. His dedication inspired me, and I found the motivation to continue my mission of planting a diverse range of species in the park, transforming it into a beautiful oasis for the community. |
. |
Almost during those same days in evening after walking for some time I used to sit in a park, near our home and beside main road, to enjoy gentle and cool breeze of evening. There were and still are a lot of “Azadirachta indica” neem trees on both sides of that main road. But where I used to sit there was sadly an old but dead tree on other side of the main road. Daily watching that tree not matching with it's surroundings something came in my mind. So one day I went to place of that old tree with right tools and around 4 liters of water and a few tree seedlings of “neem tree” and planted them right beside that old and now dead tree. After that I started daily watering those young seedlings. |
. |
Slowly and steadily they started growing. At beginning their growth was very slow but with time they picked speed. There growth took speed specialty when dept. responsible for up-keep of trees etc in our area started giving re-cycled water to all trees and plants in the area. It made me very happy and I stopped watering plants planted by me. Within few years those seedlings planted by me were, young trees, taller than me and it made me excited and very satisfied. |
. |
I started showing those young “neem” trees to my friends and relatives and slowly, slowly also started to feel like those people who earlier, in fact very earlier, had planted those now fully grown beautiful neem trees. For some years time passed like that very happily. BUT ... suddenly one day when I went to see “neem” trees planted by me I was shocked and surprised to see that those trees were completely cut by someone and there branches were lying on ground nearby. I watched here and there but no one was there to give answer to my questions. A few days after that sad day I again went to same place and was again surprised to see that almost all trees on one side of main road were cut to ground completely. On inquiry I got reply that govt. is making these roads wider and thus they are cutting trees. :). I felt relieved and relaxed. |
. |
After that I stopped planting plants any where other then lawn of our home. But at the same time started thinking how in some other way this can be done. After thinking and thinking I made some ideas and one of them looked very interesting and simple also. |
. |
. |
That idea was and still is something like this: |
. |
First: Collect seeds of long living and hardy building, fruit giving, flower giving and/or shadow giving trees etc from common public, private companies, government organizations and/or farmers etc. |
Second: Categorize collected seeds according to their quality. Discard low quality seeds. |
Third: Categorize collected seeds according to their type. For example Building, Fruit-giving, Flower-giving and Shadow-giving etc. |
Fourth: Select suitable areas for each type of tree. |
Fifth: Plant/sow quality seeds selected in second step, just before rainy season, in areas which normally have good rains every year. |
Sixth: Do not do any thing else like giving water etc in planted area. |
Seventh: Let trees grow naturally and wildly. Do not trim them. |
Eighth: Do not remove any plants etc which grow beside/under planted trees. |
Ninth: Repeat from First step every year. There is no End time for this plan. |
. |
Note: There is no END time for this plan and START time for this plan is as early as possible. |
. |
. |
I think this scheme is simple and cheap to implement and maintain. Very easily any individual or group or private company or government organization can do it. |
. |
By keep planting trees in rainy areas and beside rivers, lakes etc every year we will one day have in Pakistan our own made rainforest like Amazon rainforest of Brazil etc. |
. |
HINT: We can also plant seeds of fruits (dates etc) we eat in every ramzan and any time else. Just think how much/many seeds we waist every year. We must surely re-cycle seeds. |
. |
If there are any mistakes then I will surely remove them whenever found. |
. |
Subscribe to:
Posts (Atom)