Unit I:  CS 1130 (VB)

J. Philip East — Spring 2018

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 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.

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. It is 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?

Take Roll

I'm going to take roll now. Next time we will create a seating chart to make taking roll more efficient.

Course Goal and Strategy

The goal is that you learn to program. So, how will I/we go about accomplishing that? 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

Students using our computers and any who do not yet have Visual Studio installed should get a computer from the cart right now. You may want to get a mouse also. Open it and click power button. (We are doing this because it takes time. While the computers are starting up we will do roll and the seating chart.

Course Structure

Any questions/comments about the nature of the course?

Laptop Use in ITTC 328

Hopefully the computers are now at the log-in point. (These computers were just re-imaged so I am not totally familiar with their setup.

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

Find and start visual studio (this will take a while).

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 competency demo. 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. Upload the zipped file using the web page at http://cs.uni.edu/~east/teaching/uploading/vb_submit.html
  6. Send me a message with the following characteristics:
    • Addressed to east@cs.uni.edu
    • Be CCd or also addressed to sender
    • With subject of  CD-I.a
    • Message body contains
      • your name
      • the name of the file you uploaded
      • any comments you have for me
  7. 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, and compressing the project folder.

You will have to be able to do all this and upload a file using my submissions

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