370 likes | 495 Views
Intro to C#. Head First C#. Programming Coverage. Who is this book for?. Do you want to Learn C#? Do you like to tinker – do you learn by doing rather than by reading? Do you prefer stimulating dinner conversation to dry, dull academic lectures?
E N D
Who is this book for? • Do you want to Learn C#? • Do you like to tinker – do you learn by doing rather than by reading? • Do you prefer stimulating dinner conversation to dry, dull academic lectures? • Does the idea of writing code make you bored and a little twitchy? • Are you a kick-butt C++ or Java programmer looking for a reference book? • Are you afraid to try something different?
Book’s Design • Brain craves novelty
Head First Principles • Make it visual • Conversational, casual style instead of formal, lecture style • Challenge the learner to think • Get the learner’s attention • Uses unexpected images and techniques • Touch the learner’s emotions • Redundancy • Same topic presented multiple times in different ways for multiple learning styles • Different activities to learn and remember when doing, not just when reading
Bend Your Brain Into Submission • Slow down. The more you understand the less you have to memorize. • Do the exercises. Write your own notes. • Read the “There are no Dumb Questions” sections. • Make this the last thing you read before bed, or the last challenging thing. • Drink lots of water.
Bend Your Brain Into Submission • Talk about it. Out loud. • Listen to your brain. Pay attention when it feels overloaded or you find yourself skimming. • Feel something. Your brain needs to feel that it matters. • Write a lot of software!
Activities and Exercises • The activities and exercises are part of the core content of the book. • They are not optional! • Ok to peek at the solutions in the book, but you should try to solve them first. • We will do some similar activities and exercises in class.
C# Demonstration Walkthrough • Try this on your computer • Will introduce C#.NET and the Visual Studio IDE – Integrated Development Environment – which is a program used to write programs
Contacts Database • Start up Visual Studio, follow along book/lecture • Points to make: • IDE creates files for you from a template • Major windows of the IDE • Reset layout
Contacts Database • Add picturebox to form • Insert logo graphic from http://www.headfirstlabs.com/books/hfcsharp/ • Will need to download and unzip the file
Picturebox Click Event • Double-click on the picturebox to add an event. This is called a method. Type the code inside the curly braces: private void pictureBox1_Click(object sender, EventArgs e) { MessageBox.Show("Contact list 1.0.\nWritten by: Kenrick Mock", "About"); }
Run your program • Where are my files? Click Green Triangle
Next Steps • See book/lecture for details • Add database • Add “People” Table
Complete The Table Also, type in sample data into the table (see in class)
Connect Database • Add new database • Add new data source • Drag onto form • Click “Detail” for separate fields • Configure text/font/etc. • Test Drive • Skip installer, database diagram
Intro to Computing (From C# Software Solutions)
The CPU • Fetches instructions from main memory • Carries out the operations commanded by the instructions • Each instruction produces some outcome • A program is an entire sequence of instructions • Instructions are stored as binary numbers • Binary number - a sequence of 1’s and 0’s
Knowing About: Computer Hardware • Bit: smallest and most basic data item in a computer; represents a 0 or a 1 • Byte: a grouping of eight bits • E.g., 00010001 • What does this represent? • Word: a grouping of one or more bytes
Bits could represent sound We said that 00010001 could represent anything, a number, sound, color, etc.
Layers of Software Systems Applications Operating System BIOS CPU
The .NET Platform • C# .NET is in a sense one step removed from a typical high-level language • C# runs using a “Virtual Machine” or “Common Language Runtime” • The physical computer simulates a virtual computer that runs your program .NET Software .NET Software .NET Program
.NET Framework C# VB.NET C++.NET Other Visual Studio .NET Common Language Specification Framework Class Library ASP.NET Windows Forms Web Services Web Forms Controls Drawing ASP.NET Application Services Windows Application Services ADO.NET XML Threading IO Network Security Diagnostics Etc. Common Language Runtime Common Type System Lifecycle Monitoring Memory Management Operating System