C# course university of piraeus Discussions - Classroom 2.02024-03-29T09:20:33Zhttps://www.classroom20.com/group/koukosgroup/forum?feed=yes&xn_auth=noΤεστ Αξιολογησης-2οtag:www.classroom20.com,2016-06-02:649749:Topic:11118732016-06-02T16:59:18.625ZNikosKoukoshttps://www.classroom20.com/profile/NikosKoukos
<p>Το παρακατω τεστ αξιολογησης πρεπει να συμπληρωθει μεχρι την της 15/6/2016. Μπορειτε να στειλετε τις απαντησεις ειτε στο προσωπικο μου inbox ειτε στο ενακολουθη διευθυνση email <strong><span style="text-decoration: underline;">nkoukos@hotmail.com</span></strong></p>
<p></p>
<p></p>
<p> <span class="font-size-5">ΤΕΣΤ ΑΞΙΟΛΟΓΗΣΗΣ 2ο</span></p>
<p></p>
<p></p>
<p></p>
<br />
<h4 class="western"><b>Ques 1 :</b> Which of the following are NOT true about .NET Framework?…</h4>
<p>Το παρακατω τεστ αξιολογησης πρεπει να συμπληρωθει μεχρι την της 15/6/2016. Μπορειτε να στειλετε τις απαντησεις ειτε στο προσωπικο μου inbox ειτε στο ενακολουθη διευθυνση email <strong><span style="text-decoration: underline;">nkoukos@hotmail.com</span></strong></p>
<p></p>
<p></p>
<p> <span class="font-size-5">ΤΕΣΤ ΑΞΙΟΛΟΓΗΣΗΣ 2ο</span></p>
<p></p>
<p></p>
<p></p>
<br />
<h4 class="western"><b>Ques 1 :</b> Which of the following are NOT true about .NET Framework?</h4>
<div id="Section1" dir="ltr"><h4 class="western" style="margin-bottom: 0in;">1. It provides a consistent object-oriented programming environment whether </h4>
<h4 class="western" style="margin-bottom: 0in;"> object code is stored and executed locally, executed locally but Internet- </h4>
<h4 class="western" style="margin-bottom: 0in;"> distributed, or executed remotely.</h4>
<h4 class="western" style="margin-bottom: 0in;">2.It provides a code-execution environment that minimizes software deployment and versioning conflicts.</h4>
<h4 class="western" style="margin-bottom: 0in;">3.It provides a code-execution environment that promotes safe execution of code, including code created by an</h4>
<h4 class="western" style="margin-bottom: 0in;"> unknown or semi-trusted third party.</h4>
<h4 class="western" style="margin-bottom: 0in;">4.It provides different programming models for Windows-based applications and Web-based applications.</h4>
<h4 class="western">5.It provides an event driven programming model for building Windows Device Drivers.</h4>
<p style="margin-bottom: 0in;">(A) 1, 2</p>
<p style="margin-bottom: 0in;">(B) 2, 4</p>
<p style="margin-bottom: 0in;">(C) 4, 5</p>
<p style="margin-bottom: 0in;">(D) 1, 2, 4</p>
</div>
<div id="Section2" dir="ltr"><h4 class="western"><a name="ques2" id="ques2"></a><b>Ques 2 :</b> Which file contains configuration data for each unique URl resource used in project?</h4>
<p style="margin-bottom: 0in;">(A) web.config</p>
<p style="margin-bottom: 0in;">(B) global.asax</p>
<p style="margin-bottom: 0in;">(C) webapplication.vsdisco</p>
<p style="margin-bottom: 0in;">(D) assemblyinfo.cs</p>
</div>
<div id="Section3" dir="ltr"><h4 class="western"><a name="ques3" id="ques3"></a><b>Ques 3 :</b> Which of the following namespaces used in C#.NET?</h4>
<p style="margin-bottom: 0in;">(A) using System;</p>
<p style="margin-bottom: 0in;">(B) using System.Collections.Generic;</p>
<p style="margin-bottom: 0in;">(C) using System.Windows.Forms;</p>
<p style="margin-bottom: 0in;">(D) All of the above are used</p>
</div>
<div id="Section4" dir="ltr"><h4 class="western"><a name="ques4" id="ques4"></a><b>Ques 4 :</b> If a class is using an interface, it must</h4>
<p style="margin-bottom: 0in;">(A) contain the same methods as the interface</p>
<p style="margin-bottom: 0in;">(B) inherit the properties of the interface</p>
<p style="margin-bottom: 0in;">(C) create an interface object</p>
<p style="margin-bottom: 0in;">(D) all of the above</p>
</div>
<div id="Section5" dir="ltr"><h4 class="western"><a name="ques5" id="ques5"></a><b>Ques 5 :</b> Which keyword is used to achieve shadowing in C#?</h4>
<p style="margin-bottom: 0in;">(A) Abstract</p>
<p style="margin-bottom: 0in;">(B) New</p>
<p style="margin-bottom: 0in;">(C) Shadow</p>
<p style="margin-bottom: 0in;">(D) Sealed</p>
</div>
<div id="Section6" dir="ltr"><h4 class="western"><a name="ques6" id="ques6"></a><b>Ques 6 :</b> Which of the following components of the .NET framework provide an extensible set of classes that can be used by any .NET compliant programming language?</h4>
<p style="margin-bottom: 0in;">(A) .NET class libraries</p>
<p style="margin-bottom: 0in;">(B) Common Language Infrastructure</p>
<p style="margin-bottom: 0in;">(C) Common Language Runtime</p>
<p style="margin-bottom: 0in;">(D) Common Type System</p>
</div>
<div id="Section7" dir="ltr"><h4 class="western"><a name="ques7" id="ques7"></a><b>Ques 7 :</b> What is the wild card character in the SQL "like" statement?</h4>
<p style="margin-bottom: 0in;">(A) * (Asterisk)</p>
<p style="margin-bottom: 0in;">(B) # (Pound)</p>
<p style="margin-bottom: 0in;">(C) % (Percent)</p>
<p style="margin-bottom: 0in;">(D) $ (Dollar)</p>
</div>
<div id="Section8" dir="ltr"><h4 class="western"><a name="ques8" id="ques8"></a><b>Ques 8 :</b> Which of the following are not types of access modifiers in C#?</h4>
<p style="margin-bottom: 0in;">(A) external protect</p>
<p style="margin-bottom: 0in;">(B) internal protect</p>
<p style="margin-bottom: 0in;">(C) protect</p>
<p style="margin-bottom: 0in;">(D) internal</p>
</div>
<div id="Section9" dir="ltr"><h4 class="western"><a name="ques9" id="ques9"></a><b>Ques 9 :</b> What is the output of the code public class B : A { }</h4>
<p style="margin-bottom: 0in;">(A) It defines a class that inherits the public methods of A only.</p>
<p style="margin-bottom: 0in;">(B) It defines a class that inherits all the methods of A but the private members cannot be accessed.</p>
<p style="margin-bottom: 0in;">(C) Errors</p>
<p style="margin-bottom: 0in;">(D) a and b</p>
</div>
<div id="Section10" dir="ltr"><h4 class="western"><a name="ques10" id="ques10"></a><b>Ques 10 :</b> Which of the following class cannot be inherited?</h4>
<p style="margin-bottom: 0in;">(A) Abstract</p>
<p style="margin-bottom: 0in;">(B) Sealed</p>
<p style="margin-bottom: 0in;">(C) Both</p>
<p style="margin-bottom: 0in;">(D) None</p>
</div>
<div id="Section11" dir="ltr"><h4 class="western" style="margin-bottom: 0in;"><a name="ques11" id="ques11"></a><b>Ques 11 :</b> Which of the following jobs are NOT performed by Garbage Collector?</h4>
<h4 class="western" style="margin-bottom: 0in;">1.Freeing memory on the stack.</h4>
<h4 class="western" style="margin-bottom: 0in;">2.Avoiding memory leaks.</h4>
<h4 class="western" style="margin-bottom: 0in;">3.Freeing memory occupied by unreferenced objects.</h4>
<h4 class="western" style="margin-bottom: 0in;">4.Closing unclosed database collections.</h4>
<h4 class="western">5.Closing unclosed files.</h4>
<p style="margin-bottom: 0in;">(A) 1, 2, 3</p>
<p style="margin-bottom: 0in;">(B) 1, 4, 5</p>
<p style="margin-bottom: 0in;">(C) 3, 5</p>
<p style="margin-bottom: 0in;">(D) 3, 4</p>
</div>
<div id="Section12" dir="ltr"><h4 class="western"><a name="ques12" id="ques12"></a><b>Ques 12 :</b> Identify which is true</h4>
<p style="margin-bottom: 0in;">(A) DataView ia subset of row and not columns</p>
<p style="margin-bottom: 0in;">(B) find can be done only on sorted columns</p>
<p style="margin-bottom: 0in;">(C) Sorting can be done on multiple columns</p>
<p style="margin-bottom: 0in;">(D) None of these</p>
</div>
<div id="Section13" dir="ltr"><h4 class="western"><a name="ques13" id="ques13"></a><b>Ques 13 :</b> Is it possible to store multiple data types in System.Array?</h4>
<p style="margin-bottom: 0in;">(A) Yes</p>
<p style="margin-bottom: 0in;">(B) No</p>
</div>
<div id="Section14" dir="ltr"><h4 class="western"><a name="ques14" id="ques14"></a><b>Ques 14 :</b> Sealed Classes cannot be a base class.</h4>
<p style="margin-bottom: 0in;">(A) True</p>
<p style="margin-bottom: 0in;">(B) False</p>
</div>
<div id="Section15" dir="ltr"><h4 class="western"><a name="ques15" id="ques15"></a><b>Ques 15 :</b> In C#, the statement that is used to replace multiple if statements is called?</h4>
<p style="margin-bottom: 0in;">(A) The nestedif statement</p>
<p style="margin-bottom: 0in;">(B) The #endif statement</p>
<p style="margin-bottom: 0in;">(C) The switch case statement</p>
<p style="margin-bottom: 0in;">(D) None of these</p>
</div>
<div id="Section16" dir="ltr"><h4 class="western"><a name="ques16" id="ques16"></a><b>Ques 16 :</b> Which of the following .NET components can be used to remove unused references from the managed heap?</h4>
<p style="margin-bottom: 0in;">(A) Class Loader</p>
<p style="margin-bottom: 0in;">(B) Garbage Collector</p>
<p style="margin-bottom: 0in;">(C) CTS</p>
<p style="margin-bottom: 0in;">(D) CLR</p>
</div>
<div id="Section17" dir="ltr"><h4 class="western"><a name="ques17" id="ques17"></a><b>Ques 17 :</b> A master page is merged with a content page ________ in the page execution life cycle</h4>
<p style="margin-bottom: 0in;">(A) Very early</p>
<p style="margin-bottom: 0in;">(B) Very late</p>
<p style="margin-bottom: 0in;">(C) Early</p>
<p style="margin-bottom: 0in;">(D) Late</p>
</div>
<div id="Section18" dir="ltr"><h4 class="western"><a name="ques18" id="ques18"></a><b>Ques 18 :</b> Which of the following is/are not types of arrays in C#?</h4>
<p style="margin-bottom: 0in;">(A) Single-Dimensional</p>
<p style="margin-bottom: 0in;">(B) Multidimensional</p>
<p style="margin-bottom: 0in;">(C) Jazzed arrays</p>
<p style="margin-bottom: 0in;">(D) Jagged arrays</p>
</div>
<div id="Section19" dir="ltr"><h4 class="western"><a name="ques19" id="ques19"></a><b>Ques 19 :</b> ___________________ allow to encapsulate discrete units of functionality and provide a graphical representation of that functionality to the user</h4>
<p style="margin-bottom: 0in;">(A) object</p>
<p style="margin-bottom: 0in;">(B) controls</p>
<p style="margin-bottom: 0in;">(C) class</p>
<p style="margin-bottom: 0in;">(D) graphics</p>
</div>
<div id="Section20" dir="ltr"><h4 class="western"><a name="ques20" id="ques20"></a><b>Ques 20 :</b> Which of these is a valid path declaration?</h4>
<p style="margin-bottom: 0in;">(A) string strPath="c:\\abc.txt";</p>
<p style="margin-bottom: 0in;">(B) string strPath=@"c:\abc.txt";</p>
<p style="margin-bottom: 0in;">(C) string strPath="c:/abc.txt";</p>
<p style="margin-bottom: 0in;">(D) All of these</p>
</div>
<p></p>
<p></p> Τεστ Αξιολογησης-1οtag:www.classroom20.com,2016-06-02:649749:Topic:11119562016-06-02T16:55:48.709ZNikosKoukoshttps://www.classroom20.com/profile/NikosKoukos
<p>Το παρακατω τεστ αξιολογησης πρεπει να συμπληρωθει μεχρι την της 9/6/2016. Μπορειτε να στειλετε τις απαντησεις ειτε στο προσωπικο μου inbox ειτε στο ενακολουθη διευθυνση email <strong><span style="text-decoration: underline;">nkoukos@hotmail.com</span></strong></p>
<br />
<h4 class="western"></h4>
<h4 class="western"><b> <span class="font-size-4">ΤΕΣΤ ΑΞΙΟΛΟΓΗΣΗΣ 1ο</span></b></h4>
<h4 class="western"></h4>
<h4 class="western"></h4>
<h4 class="western"><b>Ques 1 :</b> Which of the following…</h4>
<p>Το παρακατω τεστ αξιολογησης πρεπει να συμπληρωθει μεχρι την της 9/6/2016. Μπορειτε να στειλετε τις απαντησεις ειτε στο προσωπικο μου inbox ειτε στο ενακολουθη διευθυνση email <strong><span style="text-decoration: underline;">nkoukos@hotmail.com</span></strong></p>
<br />
<h4 class="western"></h4>
<h4 class="western"><b> <span class="font-size-4">ΤΕΣΤ ΑΞΙΟΛΟΓΗΣΗΣ 1ο</span></b></h4>
<h4 class="western"></h4>
<h4 class="western"></h4>
<h4 class="western"><b>Ques 1 :</b> Which of the following statements are TRUE about the .NET CLR?</h4>
<div id="ques1" dir="ltr"><h4 class="western" style="margin-bottom: 0in;">1. It provides a language-neutral development & execution environment.</h4>
<h4 class="western" style="margin-bottom: 0in;">2.It ensures that an application would not be able to access memory that it is not authorized to access.</h4>
<h4 class="western" style="margin-bottom: 0in;">3.It provides services to run "managed" applications.</h4>
<h4 class="western" style="margin-bottom: 0in;">4.The resources are garbage collected.</h4>
<h4 class="western">5.It provides services to run "unmanaged" applications.</h4>
<p style="margin-bottom: 0in;">(A) Only 1 and 2</p>
<p style="margin-bottom: 0in;">(B) Only 1, 2 and 4</p>
<p style="margin-bottom: 0in;">(C) 1, 2, 3, 4</p>
<p style="margin-bottom: 0in;">(D) Only 4 and 5</p>
</div>
<div id="ques2" dir="ltr"><h4 class="western"><b>Ques 2 :</b> In data reader, what can be used before read method?</h4>
<p style="margin-bottom: 0in;">(A) Getvalue</p>
<p style="margin-bottom: 0in;">(B) Getstring</p>
<p style="margin-bottom: 0in;">(C) GetNumber</p>
<p style="margin-bottom: 0in;">(D) None</p>
</div>
<div id="ques3" dir="ltr"><h4 class="western"><b>Ques 3 :</b> What is ENUM?</h4>
<p style="margin-bottom: 0in;">(A) It is used to initialize variables</p>
<p style="margin-bottom: 0in;">(B) It is used to define constants</p>
<p style="margin-bottom: 0in;">(C) It is used to define variables</p>
<p style="margin-bottom: 0in;">(D) None</p>
</div>
<div id="ques4" dir="ltr"><h4 class="western"><b>Ques 4 :</b> A variable which is declared inside a method is called a________variable</h4>
<p style="margin-bottom: 0in;">(A) Local</p>
<p style="margin-bottom: 0in;">(B) Private</p>
<p style="margin-bottom: 0in;">(C) Static</p>
<p style="margin-bottom: 0in;">(D) Serial</p>
</div>
<div id="ques5" dir="ltr"><h4 class="western"><b>Ques 5 :</b> Can an Interface be instantiated directly?</h4>
<p style="margin-bottom: 0in;">(A) Yes</p>
<p style="margin-bottom: 0in;">(B) No</p>
</div>
<div id="ques6" dir="ltr"><h4 class="western" style="margin-bottom: 0in;"><b>Ques 6 :</b> Which of the following are valid .NET CLR JIT performance counters?</h4>
<h4 class="western" style="margin-bottom: 0in;">1. Total memory used for JIT compilation</h4>
<h4 class="western" style="margin-bottom: 0in;">2.Average memory used for JIT compilation</h4>
<h4 class="western" style="margin-bottom: 0in;">3.Number of methods that failed to compile with the standard JIT</h4>
<h4 class="western" style="margin-bottom: 0in;">4.Percentage of processor time spent performing JIT compilation</h4>
<h4 class="western">5.Percentage of memory currently dedicated for JIT compilation</h4>
<p style="margin-bottom: 0in;">(A) 1, 2</p>
<p style="margin-bottom: 0in;">(B) 1, 5</p>
<p style="margin-bottom: 0in;">(C) 3, 4</p>
<p style="margin-bottom: 0in;">(D) 4, 5</p>
</div>
<div id="ques7" dir="ltr"><h4 class="western"><b>Ques 7 :</b> Automatic paging is possible in</h4>
<p style="margin-bottom: 0in;">(A) datareader</p>
<p style="margin-bottom: 0in;">(B) dataset</p>
<p style="margin-bottom: 0in;">(C) datatabel</p>
<p style="margin-bottom: 0in;">(D) all</p>
</div>
<div id="ques8" dir="ltr"><h4 class="western"><b>Ques 8 :</b> What does Dispose method do with connection object?</h4>
<p style="margin-bottom: 0in;">(A) Close the connection</p>
<p style="margin-bottom: 0in;">(B) Temporary dispose the connection</p>
<p style="margin-bottom: 0in;">(C) Deletes it from the memory</p>
<p style="margin-bottom: 0in;">(D) All of the above</p>
</div>
<div id="ques9" dir="ltr"><h4 class="western"><b>Ques 9 :</b> Feature of a local variable</h4>
<p style="margin-bottom: 0in;">(A) It must be declared within a method</p>
<p style="margin-bottom: 0in;">(B) It represent a class object</p>
<p style="margin-bottom: 0in;">(C) It can be used anywhere in the program</p>
<p style="margin-bottom: 0in;">(D) It must accept a class</p>
</div>
<div id="ques10" dir="ltr"><h4 class="western"><b>Ques 10 :</b> What is the Difference between Convert.ToInt32 and Int.Parse?</h4>
<p style="margin-bottom: 0in;">(A) Both are Same</p>
<p style="margin-bottom: 0in;">(B) Convert.ToInt32 Can't Handle Null Values ,it will throws rgumentNullException error.</p>
<p style="margin-bottom: 0in;">(C) Int.Parse Can't Handle Null values , It will throws ArgumentNullException Error.</p>
<p style="margin-bottom: 0in;">(D) Both can Handle Null Values</p>
</div>
<div id="ques11" dir="ltr"><h4 class="western"><b>Ques 11 :</b> Which of the following statements is correct about Managed Code?</h4>
<p style="margin-bottom: 0in;">(A) Managed code is the code that runs on top of Windows.</p>
<p style="margin-bottom: 0in;">(B) Managed code is the code that is written to target the services of the CLR.</p>
<p style="margin-bottom: 0in;">(C) Managed code is the code where resources are Garbage Collected.</p>
<p style="margin-bottom: 0in;">(D) Managed code is the code that is compiled by the JIT compilers.</p>
</div>
<div id="ques12" dir="ltr"><h4 class="western"><b>Ques 12 :</b> What object can help you maintain data across users?</h4>
<p style="margin-bottom: 0in;">(A) Session object</p>
<p style="margin-bottom: 0in;">(B) Server Object</p>
<p style="margin-bottom: 0in;">(C) Response Object</p>
<p style="margin-bottom: 0in;">(D) Application Object</p>
</div>
<div id="ques13" dir="ltr"><h4 class="western"><b>Ques 13 :</b> Is it possible to change the value of a variable while debugging a C# application?</h4>
<p style="margin-bottom: 0in;">(A) Yes</p>
<p style="margin-bottom: 0in;">(B) No</p>
</div>
<div id="ques14" dir="ltr"><h4 class="western"><b>Ques 14 :</b> Two methods with the same name but with different parameters.</h4>
<p style="margin-bottom: 0in;">(A) Overloading</p>
<p style="margin-bottom: 0in;">(B) Multiplexing</p>
<p style="margin-bottom: 0in;">(C) Duplexing</p>
<p style="margin-bottom: 0in;">(D) Loading</p>
</div>
<div id="ques15" dir="ltr"><h4 class="western"><b>Ques 15 :</b> C# doesnot support:</h4>
<p style="margin-bottom: 0in;">(A) abstraction</p>
<p style="margin-bottom: 0in;">(B) polymorphism</p>
<p style="margin-bottom: 0in;">(C) multiple inheritance</p>
<p style="margin-bottom: 0in;">(D) inheritance</p>
</div>
<div id="ques16" dir="ltr"><h4 class="western"><b>Ques 16 :</b> Which of the following utilities can be used to compile managed assemblies into processor-specific native code?</h4>
<p style="margin-bottom: 0in;">(A) gacutil</p>
<p style="margin-bottom: 0in;">(B) ngen</p>
<p style="margin-bottom: 0in;">(C) sn</p>
<p style="margin-bottom: 0in;">(D) ildasm</p>
</div>
<div id="ques17" dir="ltr"><h4 class="western"><b>Ques 17 :</b> Which property will you use to process different server paths in a page?</h4>
<p style="margin-bottom: 0in;">(A) Request</p>
<p style="margin-bottom: 0in;">(B) Response</p>
<p style="margin-bottom: 0in;">(C) Server</p>
<p style="margin-bottom: 0in;">(D) Application</p>
</div>
<div id="ques18" dir="ltr"><h4 class="western"><b>Ques 18 :</b> Are private class-level variables can inherited?</h4>
<p style="margin-bottom: 0in;">(A) Yes, and we can access them</p>
<p style="margin-bottom: 0in;">(B) No, and we can not access them</p>
<p style="margin-bottom: 0in;">(C) Yes, but we can not access them</p>
<p style="margin-bottom: 0in;">(D) All of the above are wrong</p>
</div>
<div id="ques19" dir="ltr"><h4 class="western"><b>Ques 19 :</b> Is there any errors in this -> EmployeeMgmt constructor: Public int EmployeeMgmt { emp_id = 100; }</h4>
<p style="margin-bottom: 0in;">(A) Return type</p>
<p style="margin-bottom: 0in;">(B) Formal parameters</p>
<p style="margin-bottom: 0in;">(C) No errors</p>
<p style="margin-bottom: 0in;">(D) Name</p>
</div>
<div id="ques20" dir="ltr"><h4 class="western"><b>Ques 20 :</b> Which is true about Interface and abstract methods?</h4>
<p style="margin-bottom: 0in;">(A) We can write only one abstract method inside interface.</p>
<p style="margin-bottom: 0in;">(B) No method is abstract inside interface</p>
<p style="margin-bottom: 0in;">(C) All the methods inside Interface in an abstract method.</p>
<p style="margin-bottom: 0in;">(D) None of the above</p>
</div> C# Μεταβλητες.tag:www.classroom20.com,2016-06-01:649749:Topic:11120022016-06-01T15:24:04.986ZNikosKoukoshttps://www.classroom20.com/profile/NikosKoukos
<p class="Standard">Οι μεταβλητές ειναι το ονομα και ο τυπος που δινουμε σε μια συγκεκριμενη τιμη πορκειμενου να αποθηκευτει στη μνημη. Αναλογα με το υπο της μεταβλητης καταλμβανει συγκεκριμενο χωρο στη μνυμη. Στη γλωσσα προγραμματισμου C# εχουμε τους παρακατω τυπουσ μεταβλητων</p>
<p class="Standard"> </p>
<p class="Standard"> </p>
<table border="0" cellspacing="0" width="497">
<tbody><tr><td width="134"><p align="left" class="TableHeading">Τυπος…</p>
</td>
<td width="363"></td>
</tr>
</tbody>
</table>
<p class="Standard">Οι μεταβλητές ειναι το ονομα και ο τυπος που δινουμε σε μια συγκεκριμενη τιμη πορκειμενου να αποθηκευτει στη μνημη. Αναλογα με το υπο της μεταβλητης καταλμβανει συγκεκριμενο χωρο στη μνυμη. Στη γλωσσα προγραμματισμου C# εχουμε τους παρακατω τυπουσ μεταβλητων</p>
<p class="Standard"> </p>
<p class="Standard"> </p>
<table border="0" cellspacing="0" width="497">
<tbody><tr><td width="134"><p class="TableHeading" align="left">Τυπος</p>
</td>
<td width="363"><p class="TableHeading" align="left">Παραδειγματα</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Integral types</p>
</td>
<td width="363"><p class="TableContents">sbyte, byte, short, ushort, int, uint, long, ulong, and char</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Floating point types</p>
</td>
<td width="363"><p class="TableContents">float and double</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Decimal types</p>
</td>
<td width="363"><p class="TableContents">decimal</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Boolean types</p>
</td>
<td width="363"><p class="TableContents">true or false values, as assigned</p>
</td>
</tr>
<tr><td width="134"><p class="TableContents">Nullable types</p>
</td>
<td width="363"><p class="TableContents">Nullable data types</p>
</td>
</tr>
</tbody>
</table>
<p class="Standard"> </p>
<p class="Standard"> </p>
<p class="Standard"><span class="font-size-4" style="color: #000000;"> Ορισμος μεταβλητων</span></p>
<p class="Standard"></p>
<p class="Standard">Η διαδικασια κατα την οποια οριζουμε μια μεταβλητη και δηλωνουμε τον τυπο της.</p>
<p class="PreformattedText"><τυπος_μεταβλητης> <οvονομα>;</p>
<p class="Textbody"><br/> ακολουθουν ορισμενα παραδειγματα:</p>
<div><p class="PreformattedText">int i, j, k;</p>
<p class="PreformattedText">char c, ch;</p>
<p class="PreformattedText">float f, salary;</p>
<p class="PreformattedText">double d;</p>
</div>
<p class="Textbody"></p>
<p class="Textbody"><span class="font-size-4">Αρχικοποιηση μεταβλητων:</span></p>
<p class="Textbody"></p>
<p class="Textbody">Δινουμε τις αρχικες τημες των μεταωλητων με τον εξης τροπο: ονομα_μεταβλητης = τιμη;</p>
<p class="Textbody">Μπορουμε επισης να αρχικοποιησουμε και να ορισουμε μια μεταβλητη στον ιδιο χρονο με τον εξης τροπο: <τυπος_μεταβλητης> <ονομα_μεταβλητης> = <τιμη>;</p>
<p class="Textbody">Οριμενα παραδειγματα:</p>
<p class="Textbody"> </p>
<p class="PreformattedText">int d = 3, f = 5; /* initializing d and f. */</p>
<div><p class="PreformattedText">byte z = 22; /* initializes z. */</p>
<p class="PreformattedText">double pi = 3.14159; /* declares an approximation of pi. */</p>
<p class="PreformattedText">char x = 'x'; /* the variable x has the value 'x'. */</p>
</div>
<p class="Textbody"> </p>
<p class="Textbody">Ακολουθει προγραμμα το οποιο συνηστατε να εκετελεσεται προκειμενου να εχεται μια εικονα απο το πως λειτουργουν οι μεταβλητες στη πραξη:</p>
<p class="PreformattedText"> </p>
<div><p class="PreformattedText">using System;</p>
<p class="PreformattedText">namespace VariableDefinition</p>
<p class="PreformattedText">{</p>
<p class="PreformattedText"> class Program</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> static void Main(string[] args)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> short a;</p>
<p class="PreformattedText"> int b ;</p>
<p class="PreformattedText"> double c;</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> /* actual initialization */</p>
<p class="PreformattedText"> a = 10;</p>
<p class="PreformattedText"> b = 20;</p>
<p class="PreformattedText"> c = a + b;</p>
<p class="PreformattedText"> Console.WriteLine("a = {0}, b = {1}, c = {2}", a, b, c);</p>
<p class="PreformattedText"> Console.ReadLine();</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText">}</p>
</div>
<p class="Textbody"></p>
<p class="Textbody"><span style="color: #000000;" class="font-size-4">Εισοδος μεταβλητων απο το χρηστη:</span></p>
<p class="Textbody"> </p>
<p class="Textbody">Η ταξη <b>Console</b> του πεδιου <b>System</b> παρεχει τη συναρτηση <b>ReadLine</b><b>()</b> η οποια λαμβανει εισοδο απο το πληκτρολογιο του χρηστη</p>
<p class="Textbody"> </p>
<p class="Textbody">πχ</p>
<p class="PreformattedText"> </p>
<div><p class="PreformattedText">int num;</p>
<p class="PreformattedText">num = Convert.ToInt32(Console.ReadLine());</p>
</div>
<p>χρησημοποιησαμε τη συναρτηση <b>Convert.ToInt32() </b> για να μετατρεψουμε σε ακαιρεο την εισοδο της συναρτησης <b>Console.ReadLine()</b> καθως δεχεται ορισμα σε μορφη συμβολων (string).</p> Βρογχοι επαναληψηςtag:www.classroom20.com,2016-06-01:649749:Topic:11120002016-06-01T15:23:13.759ZNikosKoukoshttps://www.classroom20.com/profile/NikosKoukos
<p class="Textbody"><span class="font-size-4"><strong>Βρογχοι επαναληψης</strong></span></p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody">Μια βασικη τεχνικη που χρησιμοποιηται στο προγραμματισμου προκειμενου να επιτευθει επαναληψη μιας αυτοματοποιημενης διαδικασιας ειναι οι βρογχοι επαναληψης.Στη γλωσσα προγραμματισμου C#</p>
<p class="Textbody">εχουμε τεσσεροις βασικους βργχους επαναληψης: while loop,do loop,for loop και foreach loop.…</p>
<p class="Textbody"><span class="font-size-4"><strong>Βρογχοι επαναληψης</strong></span></p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody">Μια βασικη τεχνικη που χρησιμοποιηται στο προγραμματισμου προκειμενου να επιτευθει επαναληψη μιας αυτοματοποιημενης διαδικασιας ειναι οι βρογχοι επαναληψης.Στη γλωσσα προγραμματισμου C#</p>
<p class="Textbody">εχουμε τεσσεροις βασικους βργχους επαναληψης: while loop,do loop,for loop και foreach loop.</p>
<p class="Textbody"> </p>
<p class="Textbody"><b>while</b> <b>loop</b>: εκταιλει τις εντολες που βρισκονται αναμεσα στα αγγιστρα εως οτου η συνθηκη μεσα στις παρενθεσεις ειναι αληθης.Δηλαδη</p>
<p class="Textbody">while(true)</p>
<p class="Textbody">{</p>
<p class="Textbody"> do instruction 1;</p>
<p class="Textbody">do instruction 2;</p>
<p class="Textbody">}</p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody"> </p>
<p class="Textbody"> Παραδειγμα:</p>
<p class="PreformattedText"> </p>
<div><p class="PreformattedText">using System;</p>
<p class="PreformattedText">namespace ConsoleApplication1</p>
<p class="PreformattedText">{</p>
<p class="PreformattedText"> class Program</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> static void Main(string[] args)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> int number = 0;</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> while(number < 5)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> Console.WriteLine(number);</p>
<p class="PreformattedText"> number = number + 1;</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> Console.ReadLine();</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText">}</p>
</div>
<p class="Textbody">Εαν εκετελεσται τον κωδικα θα παρεται ως αποτελεσμα τους αριθμους 0,1,2,3,4. Ο λογος που δεν θα παρεται τον αριθμο 5 ειναι διοτι η συνθηκη ελεγχεται πριν εκτελεσθει ο βρογχος οποτε μολις η μεταβλητη number παρει την τιμη 5 ο βρογχος δεν θα ξαναεκτελεσθει</p>
<p class="Textbody"> </p>
<p class="Textbody"><b>do</b> <b>loop</b>: Παρομοιος με τον βρογχο while με τη διαφορα οτι ο κωδικας θα εκετελσθει απαριατητα μια φορα.Αυτο συμβαινει διοτι η ο ελεγχεος της συνθηκης γινεται στο τελος του βρογχου και οχι στην αρχη</p>
<p class="Textbody">Παραδειγμα:</p>
<div><p class="PreformattedText">do</p>
<p class="PreformattedText">{</p>
<p class="PreformattedText"> Console.WriteLine(number);</p>
<p class="PreformattedText"> number = number + 1;</p>
<p class="PreformattedText">} while(number < 5);</p>
</div>
<p class="Textbody"> </p>
<p class="Textbody"><b>for</b> <b>Loop</b>: Αυτος ο βρογχος επαναληψης σου επιτρεπει να προσθεσεις ορισμενες ενεργεις στη συνθηκη οπως αρχικοπιηση μεταβλητης και αυξηση της κατα μια σταθερα.Συνηστατε σε περιπτωσεις που εχουμε γνωση για τον αριθμο των επαναληψεων. Παραδειγμα:</p>
<p class="PreformattedText"> </p>
<div><p class="PreformattedText">using System;</p>
<p class="PreformattedText">namespace ConsoleApplication1</p>
<p class="PreformattedText">{</p>
<p class="PreformattedText"> class Program</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> static void Main(string[] args)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> int number = 5;</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> for(int i = 0; i < number; i++)</p>
<p class="PreformattedText"> Console.WriteLine(i);</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> Console.ReadLine();</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText">}</p>
</div>
<p class="Textbody"> </p>
<p class="Textbody"><strong>Foreach loop</strong>: Εκετελει ενα προκαθαροσμενο αριθμο επαναληψεων.Στη συνθηκη μπορει να λαβει ως ορισμα arrays και αλλες μεταβλητες.Διαφερει απο τους πορηγουμενους βργχους καθως δεν ελεγχει αν μια συνθηκη ειναι αληθης, αντ' αυτου εκτελειτε με αριθμιτικα κρητιρια. Ακολουθει παραδειγμα με δειγμα εξοδου. Συνηστατε να το εκτελεσεται καθως και να πειραμαστιστηται αλλαζοντας τους αριθμους για βαθυτερη κατανοηση του βρογχου επαναληψης.</p>
<p class="PreformattedText">class ForEachTest</p>
<p class="PreformattedText">{</p>
<p class="PreformattedText"> static void Main(string[] args)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> int[] fibarray = new int[] { 0, 1, 1, 2, 3, 5, 8, 13 };</p>
<p class="PreformattedText"> foreach (int element in fibarray)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> System.Console.WriteLine(element);</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> System.Console.WriteLine();</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> // Compare the previous loop to a similar for loop.</p>
<p class="PreformattedText"> for (int i = 0; i < fibarray.Length; i++)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> System.Console.WriteLine(fibarray[i]);</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> System.Console.WriteLine();</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> // You can maintain a count of the elements in the collection.</p>
<p class="PreformattedText"> int count = 0;</p>
<p class="PreformattedText"> foreach (int element in fibarray)</p>
<p class="PreformattedText"> {</p>
<p class="PreformattedText"> count += 1;</p>
<p class="PreformattedText"> System.Console.WriteLine("Element #{0}: {1}", count, element);</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> System.Console.WriteLine("Number of elements in the array: {0}", count);</p>
<p class="PreformattedText"> }</p>
<p class="PreformattedText"> // Output:</p>
<p class="PreformattedText"> // 0</p>
<p class="PreformattedText"> // 1</p>
<p class="PreformattedText"> // 1</p>
<p class="PreformattedText"> // 2</p>
<p class="PreformattedText"> // 3</p>
<p class="PreformattedText"> // 5</p>
<p class="PreformattedText"> // 8</p>
<p class="PreformattedText"> // 13</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> // 0</p>
<p class="PreformattedText"> // 1</p>
<p class="PreformattedText"> // 1</p>
<p class="PreformattedText"> // 2</p>
<p class="PreformattedText"> // 3</p>
<p class="PreformattedText"> // 5</p>
<p class="PreformattedText"> // 8</p>
<p class="PreformattedText"> // 13</p>
<p class="PreformattedText"> </p>
<p class="PreformattedText"> // Element #1: 0</p>
<p class="PreformattedText"> // Element #2: 1</p>
<p class="PreformattedText"> // Element #3: 1</p>
<p class="PreformattedText"> // Element #4: 2</p>
<p class="PreformattedText"> // Element #5: 3</p>
<p class="PreformattedText"> // Element #6: 5</p>
<p class="PreformattedText"> // Element #7: 8</p>
<p class="PreformattedText"> // Element #8: 13</p>
<p class="PreformattedText"> // Number of elements in the array: 8</p>
<p class="PreformattedText">}</p>