Unit I:  CS 1130 (VB)

J. Philip East — Fall 2017

Welcome (Day 1)

Hello

Hi. I'm Philip East and this is CS 1130 Visual Basic Programming. One thing you'll want to know about me is that I'm hard of hearing. I hope to get that worked on soon. If you need to contact me try one of the following (and speak up :-)

For the next few days, it would be helpful if you said your name (clearly & loudly—I'm hard of hearing) so I can get to know you and be more likely to get you class participation credit

Pair-Programming

For much of the course it will be okay if you use pair-programming. Pair-programming involves one person serving as the driver and one person serving as the navigator. Then, every so often, they swap roles. The driver does all the typing, program execution, etc. The navigator watches closely to make sure the driver is doing what's needed. They work together to decide what to do.

That means you'll need a partner. So, look around. Introduce yourselves. Be thinking about who you might like to partner up with. If you have a friend in the class that might make for a good partnership or it might end up hurting your friendship because programming partners need to be willing to say things like "you're wrong", "that won't work", ...

At the beginning of next class period, we will identify partners and create a seating chart. Partners will sit side by side. Be aware that the big tables have power (if you are using your own computer) and the middle tables do not.

Questions?, comments? wonderings?

Let's Get Started

The university catalog say this course is to address

Programming using the language Visual BASIC. Broad coverage of language syntax, programming practice, and programming problems appropriate to the novice or end-user programmer using a personal computer.

So, back to our earlier question (What is programming?). To me, programming is the development of a set of instructions that allow the computer to independently carry out a set of instructions. Typically, those instructions will produce some needed information or supervise some activity.   Have you ever run a computer program?   What did it do?

So, What does developing a set of computer instructions entail?   [note/discuss any responses]   One can certainly just jump in and write out some instructions and have the computer do them. For some very simple tasks that will work. But, my experience (and research that has been conducted) leads me to the conclusion that programming (done reasonably) consists of:

Only the last two of these tasks involve writing/producing code. Most of the problem solving required in programming should occur before any thought is given to coding.

Some people think programming is hard. Its not, or at least it is no harder than writing a research paper or designing and carrying out a science experiment or most any other activity that involves problem solving. Learning to program might be a little harder but that is because the learner has to learn a new kind of problem solving and how to convert the solution to a programming language which they don't know yet. It is somewhat like learning to write a new kind of poetry in a foreign language. You have to learn the poetry part and the foreign language.

Visual Basic uses a graphical user interface so some of it will seem/be familiar. Hopefully, we'll make the rest of it understandable for you.

Questions?, comments? wonderings?

Course Activity/Syllabus

  [ display course syllabus for discussion below ]  

Hopefully you all read the syllabus. Any questions? Comments? [scroll through projected version of the syllabus] I think most students want to know the following about the course:

Course Success

We have a shared goal in this course—to be successful. For me, that means you learn a lot (mostly what I wanted you to learn :-) For you, ... What?

What can you do to enhance the likelihood or degree of your success?

What can I do to enhance the likelihood or degree of your success?   [note and discuss suggestions]

Roll and Initial Seating Chart

Good day. I will be taking roll in the class and using a seating chart to make that process easier while I learn to match names and faces. So, please pick a place you'd like sit. Also, be aware that I will encourage you to work in pairs for much of the course, so maybe you'll also want to sit by someone that you know or think will help you learn. Note that, if you plan to use your own laptop in the course the two small center tables do not have power to them—the others do.

Take roll and prepare initial seating chart.

Any questions, comments, or wonderings before we proceed?

Course Goal and Strategy

My goal for this course is to help you become professionals who can program, but not professional programmers. As noted earlier, programming is the act of producing a set of instructions for the computer to carry out.

So, how will I/we go about getting you to learn programming? How will it be different from the programming courses for computer science majors? I think this course will be different from major courses in several ways.

(Actually, there is no reason CS major courses can't use these strategies. They just don't, yet.)

Dr. Hughes and I believe that you already know how to solve problems. You do it all the time. But, you don't know how to convert that solution that you have in your head or on paper into instructions for the computer. An example should illustrate this.

A Sample Problem

Suppose I take a deck of cards, shuffle them, and remove one without showing it to anyone. The problem in this case is to determine the missing card.

Please pick a person or two near you as a partner and talk over how you each would solve this problem. I'll give you a few minutes to do so.   Pairs/groups discuss solutions.   [After 3-5 minutes bring focus back to class.]

Disucussion

[Probably] These solutions need to be a little more precise for us to think of them as solutions that we can use for programming. Solutions to programming problems need to be unambiguous and to clearly indicate actions that happen depending on something and actions that get repeated. So, I will translate these solutions to what we call pseudocode.   [Produce translations to the problems on the board.]   Questions? Comments? Wonderings

Is there anything in my solution translation that you do not understand?   [Note and respond to any issues.]

and

    for each card
        examine it
        place it in a pile by rank
    for each pile
        determine the pile's count of cards
        if the count is not 4
            record the rank & stop further counting
    with the identified pile
        search the pile for a spade
        if spade was missing
            record suit as spades
        else
            search the pile for a diamond
            if diamond was missing
                record suit as diamonds
            else
                search the pile for a club
                if club was missing
                    record suit as clubs
                else
                    record sut as hearts
    report the rank and suit of the missing card

and (my favorite process which illustrates that sometimes you do not have the computer solve the problem like a human would)

    prepare a checkoff list for each card
    for each card
        examine the card
        check off the appropriate item on the checkoff list
    for each item on the checkoff list
        if the item is not checked off
            report the rank and suit of the card
            stop further processing

The solutions you see above are "algorithms" (step by step directions) that can be translated into a programming language. They are, I believe, readily understood by most people.   Again, anything here you do not understand?   [Address any issues.]

The fact that you understand all or nearly all of what you see here suggests that you already understand all or most of the concepts involved in programming. You just need to learn:

Next Time

Visual Studio; VB Projects; Comp.Demo I expectations (Day 2)

Logistics

Course Structure

Any questions/comments about the nature of the course?

Laptop Use in ITTC 328

Everyone get out your/a computer

If you have your own computer (that can run Visual Studio) you can ignore this. If you need to use our laptops, please note the following.

Visual Studio Intro

Unit I is about being able to create and share VB programs. There will be a competency demo for the unit. It will have two parts each which will look something like this sample. Any questions/wonderings?

If you haven't already done so, get out your computers (or get one from the cabinet).

Our Sample Project

We will work on a form that doesn't really do anything but which incorporates many of the common VB elements or "controls". Here is an image of our first "form". We will build this form in class.

As we work today if you are working in pairs one of you should probably do what I demonstrate and the other one take notes. Then hopefully, you can work together for the writing person to accomplish the same tasks after class (They will at least have good notes :-) We are going to fire up Visual Studio to create forms like those shown in Unit one practice. Let's get started.

Visual Studio

Building our sample form

Now we are ready to start putting controls on our form. We do so using the Toolbox.   [ find/show the toolbox and demonstrate finding controls ]   Mostly we can find what we want in the Common Controls.

We go to about here in class.

Run the Program

Zip and send the project

To share/submit your project, you will want to have the computer compress the folder into one file. The process for doing that is:

  1. be sure you get to the project folder (the one that contains everything else)
  2. right-click on the folder
  3. select Send to
  4. select Compressed (zipped) folder

    You may have a chance specify where you want the file to appear and what you the file to be named. Just be sure you can find it.

  5. change the name of the file

    Gmail will not allow you to attach .zip files, so you have to fool it by changing the name. I suggest changing .zip to .zipped or .zipp. To do so:

    • right click on the file name and select Rename
    • add ped or p to the name

    You should now be able to attach the file to your Gmail mail message. But you might have difficult here. You many not be able to see the .zip extension in which case changing the name does not affect the extension. You will need to fix it by:

    1. opening up the Control Panel in Windows (click on the Start icon and select Control Panel)
    2. selecting Appearance and Personalization
    3. selecting Folder Options
    4. clicking on the View tab
    5. clicking on Hide extensions for known file types so it is not checked

    Problems/questions/wonderings?

Next Time

Day 3 — Demonstration from last time; Comp.Demo I expectations

Logistics

Our Sample Project (continued)

Last time we had gotten started on our first/sample project. The project demonstrates how to:  use Visual Studio,  create a new project,  specify a Windows form application and name the form,  and adjust some of the form properties. We got most of the controls on the form but will still need to do the picture box and related resources and the menu strip that allows the file menu to show up.

Finish the demonstration — picture box, menu, compressing the project folder and renaming the zipped file.

Note. You may have difficulty in changing the name of the zipped file from something.zip to something.zipped. If you cannot see the .zip you cannot change it. Windows typically doesn't show the extension on a file unless it is uncommon. So, you don't see the .xlsx of Excel files or the .docx of Word files or the .pdf of PDF files or the .zip of compressed files. If you can't see the .zip on your file you need to change a setting on your computer. To do that:

Unit I Recap & Work Time

As a result of this unit you should be prepared to create Visual Basic projects with:

And you should be able to compress/zip projects, change their names, send the compressed folder as an e-mail attachment, and decompress/unzip them. The competency demo will require that you do this.

The rest of class time will be spent working on the Unit I practice activity. Hopefully you will be done (or nearly done by class time next time). The competency demo for Unit I will likely be next Tuesday.

Next Time