Problem Çözme “Nasıl iyi bir programcı olabilirim?” The first step is understanding how to solve problems. Solving problems is the core of programming.
Örnek Problemler Yazıcının tonerini nasıl değiştiririm? Faturalarımı nasıl öderim? Bir sınava nasıl çalışırım? Nasıl börek pişiririm? Bir su ısıtıcısını nasıl tamir ederim? Okula nasıl gelirim?
Öğrencinin Okula Geliş Problemi Boş bir kağıt çıkarın Bugün okula nasıl geldiğinizi düşünün (5 dk.) Okula gelme sürecinizi kağıda dökün (5 dk.) Yanınızdaki bir arkadaşınızla kağıtlarınızı değiş tokuş edin Arkadaşınızın okula geliş sürecini inceleyin (5 dk.)
Problems require some process for obtaining and implementing a solution STAIR problem çözme süreci State the problem (Problemi tanımlayın) Identify the tools available for solving the problem (Problemi çözmek için mevcut araçları belirleyin) Write an algorithm (Bir algoritma yazın) Implement the solution (Çözümü gerçekleştirin) Refine the solution (Çözümü sadeleştirin)
Here’s how I would use the STAIR process to solve the water heater problem: State the problem. My water heater does not work. Cold water comes out of all faucets in the house, but no hot water. I had hot water last night, but none this morning. The temperature outside has been below freezing for the past week. The water heater is located in the garage, and all exposed pipes are insulated but are cold to the touch. I’ve determined that pipes are frozen. The product is made by XYZ Company and uses gas. Identify your tools. I have a portable heater that I could use to assist in thawing the exposed pipes if they are frozen. I have identified a couple of service-repair companies in the Yellow Pages. Write an algorithm. I choose to fix the problem myself by following these steps: 1. Make sure the portable heater has gas. 2. Plug in the portable heater. 3. Place the portable heater next to the water heater, and turn it on. 4. Leave the heater running, and check for hot water every hour or two. Implement the solution. Implement the preceding algorithm. Refine the solution. Does the hot water ever come on? If so, did it take a long time? Was this a good solution, and should I use it in the future? Is there a better long-term solution?
1.Use this key. 2.Start the car. Yeniçeri’nin Araba Problemi You must remember that he knows nothing about these contraptions called automobiles and that he is relying on you to give him instructions that he can understand. Instead of assuming so much, there might be better instructions.
Yeniçeri’nin Algoritması 1.Attached is the key to the car. You need it to start the car. 2.With the key in hand, go to the car door that is closest to the front door of the house. 3.Under the door's handle, you will see a round silver dollar–size metal part in which you can insert the key (with its rough side pointing down). 4.After sticking the key into the hole as far as it goes, turn it to the right until you hear a click. 5.Turn the key back to the left until it faces the same way as it did when you inserted it and remove the key. 6.Open the door and get into the car. Be sure to sit in front of the round wheel on the left side of the front seat. 7.Close the door. 8.On the right side of the column holding the big round wheel (called a steering wheel), you will see a slot into which you can put the key.
Programs As Directions a program is a list of detailed instructions that the computer carries out. it follows the instructions without second- guessing them. Programming is not difficult; what is difficult is breaking the computer's job into simple and detailed steps that assume nothing.
Bilgisayarın Bordro Problemi 1.Get the payroll data. 2.Calculate the payroll and taxes. 3.Print the checks.
To the computer, these instructions lack thousands of details that you might take for granted. It is the detailing of the program's instructions that provides the tedium and occasional frustration of programming. Programming computers isn't difficult, but breaking down real-world problems into lots of detailed steps that a computer can understand is hard. Not only are the programming instructions themselves important, but so is their order. When writing a program, you must think through the exact order necessary to perform the job at hand.
STAIR sürecinin programlamaya uygulanması State the problem (Problemi tanımlayın) –It begins by stating the problem, defining the problem, and understanding the problem Identify the tools available for solving the problem (Problemi çözmek için mevcut araçları belirleyin) –Visual Basic programming environment Write an algorithm (Bir algoritma yazın) –An algorithm is a well-defined, finite, step-by-step process for solving a problem. Implement the solution (Çözümü gerçekleştirin) –Use tools and algorithms to build a solution Refine the solution (Çözümü sadeleştirin) –Testing the solution, fixing bugs, and making enhancements