If there is one prayer that you should pray/sing every day and every hour, it is the
LORD's prayer (Our FATHER in Heaven prayer)
- Samuel Dominic Chukwuemeka
It is the most powerful prayer.
A pure heart, a clean mind, and a clear conscience is necessary for it.
For in GOD we live, and move, and have our being.
- Acts 17:28
The Joy of a Teacher is the Success of his Students.
- Samuel Dominic Chukwuemeka
I greet you this day,
For My Students, please do the following:
First: Download and install the Visual Studio IDE
Second: Review the notes for each week including the Student-Teacher scenarios.
Third View the videos for each week as applicable.
Fourth: Complete the weekly DB (Discussion Board) assignments.
Fifth: Assess your understanding for each topic.
Sixth: Begin to work on your midterm project, your final project, and your final exam.
Seventh: Review the midterm exam and final exam study guides.
Eighth: Should you have any questions, comments, concerns, areas of improvement, and constructive criticisms;
please contact me via the school's email system.
Ninth: If you are majoring in any IT (Information Technology) field
(especially for women and minorities),
you may want to check the Financial Aid section in any of my websites:
Scholarships or
Scholarships
For My Students and Visitors:
Comments, ideas, areas of improvement, questions, and constructive criticisms are welcome.
For All Those who Seek Peace:
Thank you for visiting!
Samuel Dominic Chukwuemeka (SamDom For Peace) B.Eng., A.A.T, M.Ed., M.S
(1.) Please review the
Rules of Nettiquette
(2.) Please be creative.
Please paraphrase in your words as applicable.
(3.) No two posts should discuss the same thing.
Each post should be unique.
This implies that you should review any previous posts before you submit your own post.
(4.) The initial post is due on Thursday of the week for which it is required.
(5.) At least one response to the initial post is due on Saturday of the week for which it is required.
(6.) Only one thread per student is allowed.
Please do not create more than one thread.
Please respond to my comments (as applicable) in the same initial thread.
Please make any repost in the same initial thread.
Besides the Introduction DB (where I am required to welcome each student); usually, I make comments to some posts and some
responses submitted by Thursday of the week that a DB assignment is due.
If I make any comment to your initial post and/or response (submitted by Thursday); then it is very important you address any
concern in my comments.
If you do not understand my comments, please send an email to me and ask for clarification.
I do not go back-and-forth (responding more than one time) to a student in DB forums.
The essence of DB forums is mainly for student communication and collaboration.
The professor only facilitates and makes few comments as necessary.
Typically, if I make any comment to your post and/or response for any DB assignment besides the Introduction DB,
it means that you need to fix some issues.
It is important you fix those issues to avoid deduction of points.
(7.) You may not do any of the same examples that I did for either a DB post or DB response.
(8.) You may do any of the questions in the Discuss tab as
a substantive post and/or substantive response.
(9.) You may make up your own substantive post and/or substantive response
if it is actually substantive.
If you do not know if your own post or response is substantive, please contact me via email,
and ask me for prior approval.
(10.) You may solve the problems in the Assess tab as a DB assessment (post and response).
Questions in the Assess tab count for both DB post and DB response.
Each question in the Assess tab is to be uniquely done by only one student.
This means that it can be done by more than one student.
However, each post must be unique.
Further: For Textbook Questions in the Assess tab:
(a.) Please submit a clear screenshot of the Question Number and the Question.
(b.) Any question from the textbook in the Assess tab should be done by only one student.
(11.) Sources must be cited accordingly.
You may use: APA (American Psychological Association) style, MLA (Modern Language Association) style, or the
Chicago Manual of Style.
(12.) For all applicable DB posts and responses, please use the Insert/Edit Image icon on the
Blackboard editor and insert screenshots of your code and the output.
Please submit clear screenshots.
This is because your colleagues and I should be able to see your code and the output clearly.
Line numbers and all necessary details are also required.
You may need to increase the font size of your IDE so it is very clear.
You may need to take the screenshots of only the relevant window (the code window).
You may need to take several screenshots.
Also, please ensure you use a clear format for your writings.
Avoid any background colors in the Blackboard Editor.
(13.) Please do not submit an attachment for any DB assignment.
If you do, it will not be clicked. It will not be read. It will not be graded.
Your colleagues and I should be able to see your work directly without opening any attachment.
Any response to such post will not be counted.
Hence clear screenshots are required.
(14.) For all DB responses, please mention the first name of your colleague.
(15.) Provide a substantive response to your colleague.
A substantive response is the response that provides constructive criticism,
alternative approach that gives the same correct output, addtional helpful information that will improve the post,
and the correction of any incorrect step and/or output among others.
How would you improve the initial post?
Did you find any errors in the initial post? If you do, please correct the error. Teach your colleague about the error, and
explain to him/her how to fix it. Provide screenshots as applicable.
What new knowledge can your colleague acquire from you based on your response?
Can you solve the initial post using an alternative approach that will give the same correct output?
What real-world examples/applications can you provide based on the initial post? Cite your sources accordingly.
Did your colleague learn anything meaningful from you based on your response to the initial post?
Please focus on the initial post. Do not deviate from the concept/topic in the initial post.
Do not bring up your own unrelated topic/concept.
Teach/Show your colleague something new and meaningful based on the initial post.
Write code examples of as applicable, run them, and explain to your colleague.
Substantive responses should include screenshots as applicable.
(16.) Please use at least a size of $14$ ($4$ pt) in your writings.
(17.) Please proof-read your writings for mechanical accuracy errors.
Any use of "i" attracts deduction of points.
Multiple mechanical accuracy errors will lead to deduction of points.
I understand that this is not an English class. However, you are expected to write well.
(18.) Please make sure that you write comments for any program you submit.
Rule of Thumb for Comments (for academic purposes): Anyone (including those with little or no programming knowledge) should be
able to read your comments and have a basic idea of your program.
Do you read my comments? Of course, you should. I provide explanations in my comments.
Does it make sense? Yours should not be different.
A Computer program is a set of instructions given to a computer to perform specific tasks.
A Computer programmer also known as a coder is a person who writes computer programs.
Identifiers are the names used for declared elements such as the names of variables, constructors, methods/functions, and
classes among others.
Every element name in Visual Basic must follow these rules:
(1.) It must begin with an alphabet character ($A - Z$, $a - z$) or an underscore ($_$).
(2.) It must only contain alphabet characters ($A - Z$, $a - z$), decimal digits ($0 - 9$), and underscores ($_$).
(3.) It must contain at least one alphabet character ($A - Z$, $a - z$) or a decimal digit ($0 - 9$) if it begins with an underscore ($_$).
Fields/Variables are usually named in Camel casing (like the hump back of a camel) or Pascal casing.
Camel casing: Begin with a lowercase alphabet, middle is an uppercase alphabet (the hump of a camel) and end with a lowercase alphabet such as $testScore$
Pascal casing: Begin with an uppercase alphabet, middle is an uppercase alphabet, end with a lowercase alphabet such as $TestScore$
Class names begin with an uppercase alphabet such as $Student$
Constructors begin with an underscore and then use Camel casing such as _$testScore$
Procedures (Sub and Function) procedures are usually named using Pascal casing such as $TestScore$
Object-oriented Programming (OOP) Language is a programming language that uses objects
to accomplish the goals of a computer program.
Controls are tools used to create objects in a Visual Basic program.
An Object is an element that is created in a Visual Basic program with the controls.
It is anything that can be touched, seen, or used.
These include: data types (it can be used), variables (it can be used),
toolbox controls (it can be seen and used) among others.
An Object is also defined an instance of the class (when you use the class that has been
created).
Instantiation is the act of creating an object.
The Behavior of an object includes methods and events.
A Method is an action that an object can perform.
For example: The Exit button can use the $Me.Close()$ method to close an application.
In Object-Oriented Programming, methods are often called procedures
Events are the actions to which an object can respond.
For example: The Click event of the Exit button allows the button to respond to
a mouse click by exiting the program.
When a procedure is associated with an event, it is known as an event handler or an event procedure.
Properties are the set of attributes that determine the appearance and behavior
of an object.
They are the characteristics of an object.
You see them in the Properties window of the Visual Studio IDE.
Access Modifiers specify the level of access classes and class members provide to other
classes.
Encapsulation is the combination of fields, properties, methods, and events of an object in a class(capsule).
In other words, keep all the data and program logic in one place.
Inheritance is the ability to create a new class that reuses, extends, and
modifies the behavior defined in another class.
The main class whose members are inherited is known as the Base class or Super class
The class that inherits the members of the main class is known as the Derived class or Sub class
The derived class inherits members of the main class using the Inherits clause.
Abstraction is the hiding away of some details about a program so one can focus on the main
details.
For example, the $PrintForm()$ class in Visual Basic enables one to print a Windows form application at run time (when the program is running)
There are so many details about the $PrintForm()$ class. However, that is not your concern. Your concern is to use that class and print a form. So, those details are hidden from you.
Another example: You do not really want to know how the printer was developed. You just want to know how to use the printer
and print your documents.
Constructors are class methods whose instructions are processed automatically whenever
the class is used to create/instantiate the object.
They are used to initialize the Private variables of the class.
They are always a Sub procedure named New
Declared Elements are programming elements that is defined in a declaration statement.
They include: variables, constants, structures, properties, events, methods/procedures, and classes among others.
A Procedure is a block of Visual Basic statements enclosed by a declaration statement (Function, Sub, Operator,
Get, Set) and a matching End declaration.
All executable statements in Visual Basic must be within some procedure.
Visual Basic.NET language introducing concepts of object-oriented, event-driven program design and implementation. Prerequisite: None.
By the end of this course, you should be able to do the following:
(1.) Demonstrate best practices for designing end-user computing interfaces.
(2.) Discuss software development methodologies.
(3.) Use a programming or a scripting language to solve a problem.
(4.) Discuss significant trends and emerging technologies and their impact on our global society.
machine language, assembly language, low level language, high level language, IDE (Integrated Development Environment), text editor, compiler, development toolchain, linker, program, header file library, white space, braces, curly brackets, semicolon, string interpolation, concatenation operator, variable, object, function, main function, integer, code, block of code, System namespace, namespace, Program.vb, class, method, console, console application, desktop application
Students will:
(1.) Download and install the Visual Studio IDE
The Visual Studio IDE is highly recommended.
(2.) Discuss an overview of the Visual Basic (VB) programming langauge.
(3.) Write a simple program (Console Application) in VB
(4.) Write a simple program (Desktop Application) in VB
(1.) Textbook Chapter
(2.) VB Tutorials by Microsoft: Welcome to the Visual Studio IDE | Visual Basic: Overview
(3.) VB Tutorials by Tutlane: From: VB Introduction to: VB Hello World Program
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type Visual Basic or VB in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type Visual Basic or VB in the search bar and view the results.
$00000$ | $10011110$ |
$00001$ | $11110100$ |
$00010$ | $10011110$ |
$00011$ | $11010100$ |
$00100$ | $10111111$ |
$00101$ | $00000000$ |
Teacher: Please look at the code above.
Do you understand that code?
Student: The bunch of zeros and ones?
I have no idea what those mean.
Public num1 as Integer
Public num2 as Integer
Public sumNum as Integer
sumNum = num1 + num2
Console.WriteLine(sumNum)
Teacher: What about this code?
Do you understand it?
Student: I do not fully understand it.
However, it makes much sense than the first code?
Teacher: Both codes execute the same tasks.
Ask the user to input those numbers. Add those numbers. Output the sum.
Which code is better?
Student: The second code of course.
Teacher: The first code is the machine code.
It is the machine language.
It is a low level language.
It is the language the computer understands directly without translation.
The second code is the high level language.
It is the language humans can read and understand better.
Hence, there is the need to compile or interpret the high level language to
the machine language so that computers would do what we want them to do.
VB is one of the high level languages that we can use.
It is a compiled language.
This means that it is translated into machine language that can be understood directly by the
system.
In that regard, a set of tools are needed.
The set of tools is known as development toolchain
The core of the development toolchain are a compiler and its linker.
The best way to compile and run VB programs is to use an Integrated Development Environment
(IDE).
An IDE typically has several development tools including a text editor and tool to compile VB
programs directly.
For this course, the Microsoft Visual Studio Community Edition (it is free) is highly
recommended.
However, you may choose to use any IDE that you wish.
Here are some free IDEs for VB:
(1.) Microsoft Visual Studio
Community Edition 2019 (Windows)
(Highly recommended. The only IDE used for this course.)
We do have online compilers for VB.
The online compilers typically do not require any downloads and installs.
However, please note that all files in the project are required for your Midterm Project, Final Project, and
Final Exam.
In the case where you prefer to use an applicable online IDE, please make sure you download the completed
VB project (that includes all files).
Here are some free online compilers/IDEs for VB:
(1.) C# Online Compiler | .NET Fiddle (includes VB)
(2.) Visual Basic (VB.NET) - OneCompiler
(3.) Online VB Compiler
(This one allows you to upload a file; also allows you to save your file if you have a Gmail or Facebook account.)
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Basic VB Syntax
From Step $6$:
Line $6:$ Imports System
This implies that we can use the classes from the System namespace.
We shall discuss classes in detail in the Advanced VB course.
System is the namespace
Console is a class in that namespace
If we do not include the Imports System, then we would have to write: System.Console.WriteLine
in Line $11$
So, the Imports keyword for the namespace, System eliminates the need for writing
System.Console.WriteLine.
This means that Namespaces are used to organize classes.
Lines $7$, $10$, and $12$: VB ignores white space.
Usually, it is good to separate blocks of code with blank lines.
This makes for more readable program.
Line $8$: The Module keyword is similar to a namespace.
Module in VB is similar to a namepsace in C# and similar to a package in Java
The name of the module in this case is Introduction.Program
I understand you probably see only Program. However, if you click it, you will see Introduction.Program
Line $9$: The Sub keyword with the Main method:
This is the sub procedure or subroutine. It is a method. It is the main method in this case.
Every VB program requires a main method.
Line $11$: This the VB statement.
Line $13$: End the sub procedure.
Codes(statements) inside the main method are executed.
VB statements do not end with a semicolon...isn't that great?
Also, you do not have to worry about curly braces...isn't that cool?
Step 7
Step 8
Step 9
As seen from the pictures:
Comments in the Visual Studio IDE is green in color. We shall keep it that way.
Comments in other IDEs might be different colors.
Student: Can you change the comments to display a different color?
Teacher: Yes Sir, you can.
Student: How do I do so, Sir?
Teacher: You do realize that if you change it, the change would be for all the
programs you develop with the Visual Studio IDE. It would not just be for C#. It would also be for C++.
Changing the color of comments would be applied to the entire Visual Studio IDE.
Student: I understand. How do I change the color of the comments?
Teacher: Here are the steps.
These are the steps I did for C#. However, they are also applicable to VB
If you have any questions, please let me know.
First:
Second:
Teacher: In the second picture, you can change the color by selecting from the
dropdown menu.
If you do not like the colors you see there, you can add your own custom color.
However, please leave the default color for all work done in this course.
Comments are required for any program you write in this course.
Rule of Thumb for writing comments (for academic purposes): Anyone should be able to read your comments and have
a basic understanding
of the program.
Both single-line comment and multi-line comments are denoted with a single beginning quotation mark(apostrophe).
Let us review more code examples. Study these codes, write them, observe the punctuation marks, and run them.
Save your work
Step 9
Then, exit
Step 10
We have closed the application.
The application is a Console application.
This means that we should be able to run the executable file and see the output directly in the console
window of the computer.
Let us locate the file and try to run it directly
The file to run is the executable file
It has .exe extension
Depending on where you saved your program, you can locate it by Clicking:
$Application \rightarrow Application\;\;folder\;\; \rightarrow bin \rightarrow Debug \rightarrow netcoreapp3.1 \rightarrow Application.exe$
The Application folder is where you have the solution file (Application.sln)
To get directly to your project, double-click the solution file.
But let us run the executable file. Double-click that .exe file.
What do you notice?
Student: Something came up and then disappeared.
Teacher: Let us fix that issue.
We want to be able to run our application directly and see the output in the console.
This leads us to another concept....
The Console.ReadLine method reads the next line of characters from the standard input stream.
This means that when we write it as the last code in our program, the program will not close unexpectedly when we
try to run it directly.
The program will wait to see if there is any line to read and will just keep waiting until the user presses a key to
exit the program.
Let's go ahead and add that to our program.
Just double-click the solution file (Application.sln) to open the project.
As you can see, when you run the program; the cursor is blicking on the next line. It is waiting for the user to
do something: either close the application or just press any key on your keyboard.
Go ahead and stop running the project bu clicking the Stop Debugging icon or press Shift + F5 key.
Save All.
Exit the project.
Locate the executable file and run it directly.
The use of this method is not required.
However:
If you choose to submit a console application for your Final Project, you are required to use the
Console.ReadLine method.
I should be able to run the executable file directly and see the output in the console.
Desktop Application is a GUI (Graphical User Interface)
Please review the Teacher-Student scenario
Student: Mr. C, why do we need to develop desktop application?
Can't we just focus on console applications?
Teacher: Desktop applications are required for several DB assessments and for your Midterm Project.
It is optional for your Final Project.
It is important you learn to develop them.
Student: But, why?
Teacher: These are the reasons:
(1.) GUIs (desktop applications) cover a significant part of Number (1.) of the Student Learning Outcomes of the course.
They also cover some parts of Numbers (2.), (3.), and (4.)
(2.) You can run the executable (.exe) file of a desktop application in any Windows desktop/laptop.
You can even run it on a Mac with some changes.
Student: What are executable files?
Teacher: Good question.
When you develop a VB program such as the one we shall develop in a moment, an executable file is also
developed. It is a file that is run on your computer to execute (do) something on your computer.
When you download and install a program on your computer, it is normally seen as install.exe,
setup.exe or other "something".exe with the word, Application used to describe it.
In our case, it is going to be a standalone file with the exe extension that when downloaded in
any Windows desktop, can run when double-clicked.
Usually, you will get a warning from your computer not to download it because it can destroy your computer.
If you do not know the source/origin of the executable file, do not download it.
But in this case, we shall develop the program so we know it is safe.
When we develop the program, we need to follow these steps to locate the executable file.
Double-click: Application folder $\rightarrow$ bin $\rightarrow$ Debug
$\rightarrow$ net5.0windows $\rightarrow$ Application.exe
That Application.exe file is the executable file.
You can download it (no worries, it is safe), save it on your desktop, and run it on your desktop whenever
you want to.
Student: If I copy it to another desktop, will it run?
Teacher: Yes, it will run on any Windows desktop. That is the nice thing about it.
Student: Just that file?
It will run with all the functionality?
Without copying the entire folder?
Teacher: That is correct.
Click the PROJECTS tab of this website.
You will see some desktop applications done by my previous students.
You can go ahead and test them.
Student: Pretty cool.
Did you say it will also run on a Mac?
Teacher: It will run on a Mac.
However, you will need to install some software on a Mac to run it.
(3.) Assume you are working in a developing country (in Nigeria for example), you have a computer but no
internet service, and you really need to develop applications for the projects you are working on;
developing desktop applications is highly recommended in such cases because you do not need the Web/Internet
to run them. All you need is a laptop or desktop.
Student: But, I'm not working in Nigeria.
Neither do I intend to work there.
Teacher: What if you work for a multinational company and your company transfers you to work there?
What if you decide to join your church or organization on a charity mission trip?
(4.) Have you heard that the only thing that is not safe is anything on the Web?
Well-developed desktop applications minimizes your use of web and mobile applications, thereby minimizing cyber crimes.
There are limitations with desktop applications.
But, there are advantages too.
At least they are much better than console applications.
Usually, you may need to download some programs to run console applications.
If you review the PROJECTS (console applications) done by my C++ students, it may require some program downloads to run on
your machine (laptop/desktop).
But the VB desktop applications and the
C# desktop applications will run without any additional download.
One of the big advantages of VB is the developement of Desktop aplications.
Let me welcome you, my dearest students with a desktop application. 😊
As is the case for development of desktop applications, the three basic things to do are:
(1.) Create the user interface
(2.) Set the properties.
(3.) Write the program code.
Form
In the Properties window:
(1.) Change the Text property of the form to Welcome to our Visual Basic Class
Change the Name property of the form to IntroductionForm
(2.) Change the background color of the form to Cornsilk
Click the BackColor property
Click the Web tab and select Cornsilk color
(3.) Change the FormBorderStyle property to Fixed3D
(4.) Adjust the size as you see fit.
(5.) Change the Font property by clicking the ellipsis (three dots)
Font: Times New Roman
Font style: Regular
Font Size: 14
Click the OK button
(6.) Change the ForeColor property to Black
Repeat the same process as you did for the BackColor property.
Picture Box
(7.) Add a PictureBox from the Toolbox Common Controls
(8.) Change the Name property to MyPictureBox
(9.) Click the ellipsis (three dots) in the Property window
(10.) Import a picture and click Ok
(11.) Resize and position as you wish.
Label (You may use a RichTextBox if you wish)
(12.) Add a label from the Toolbox Common Controls
(13.) In the Properties window, change the AutoSize property to False
(14.) Expand as you wish.
(15.) Change the BorderStyle property to Fixed3D
(16.) Change the Name property to MessageLabel
Buttons
(17.) Add three buttons from the Toolbox Common Controls
(18.) Change the Text properties to Welcome Message, Clear, and Exit
(19.) Change the ForeColor properties of the buttons to Black
(20.) Change the BackColor properties of the button to White
Repeat the same process as you did for the BackColor property of the form.
(21.) Change the Name property to MessageButton, ClearButton and ExitButton
Please review the screenshots, and study the comments and the codes.
Teacher: What do you think we should do next?
Student: Excuse me. I'm not sure.
Teacher: Imagine you did a program like this for your little child.
You do not want your child to run the program on your computer so that he/she does not mess up your computer.
What should you do if you want him/her to see it?
Student: Take a picture of it and show it to him/her.
Teacher: What other option?
Student: Print it and paste it on the wall in the bedroom.
Teacher: Yes...Print the application.
(1.) Download and install the Visual Basic PowerPacks
(2.) Open the solution file, Application.sln named Visual Studio Solution by double-clicking it.
It is recommended that you always open the solution file whenever you open already-developed VB programs.
(3.) You can view the Code window, Toolbox, and Properties window by clicking the View menu and selecting
whatever window you would like to view.
Open the Toolbox and do the following tasks.
Based on the last screenshot, the PrintForm control has been successfully added, but has not been enabled.
No worries, we shall use it in a minute. Read on.
(4.) Let us print the Program code and the GUI
Print the source code (to study it)
Give it a file name and specify a location for the printed page
The printed page should look like like this:
Print the Design Form/User Interface (to give to your child)
Run the program
Use the Snipping Tool on your computer and take the screenshot of the program (just as I did)
Then, print the user interface.
After creating your VB desktop application, please follow these steps if you want to make changes to it.
(1.) Open the solution file, Application.sln named Visual Studio Solution by double-clicking it.
It is recommended that you always open the solution file whenever you open already-developed VB
programs.
(2.) Double-click the Form1.vb to open the Design window
(3.) Make any changes you want to make.
You can view the Code window, Toolbox, and Properties window by clicking the View menu and selecting
whatever window you would like to view.
(4.) Also, it is highly recommended you Build Solution first before you Run the solution.
Student: Mr. C, I tried to run the executable file you sent.
I downloaded it on my computer and double-clicked it but it did not work.
Teacher: Did it open?
Student: No Sir.
Teacher: Did you download the .NET Framework and the PowerPacks as we did earlier?
Student: I did.
Teacher: This is what I recommend.
This should work.
However, if it does not, then try this.
Double-click the executable file.
The application should work.
Student: Okay, I tried to do what you explained.
I still cannot get the executable file to run outside the program folder.
Am I doing something wrong?
Teacher: Let us try this approach.
Actually, this is what we should have done first.
(1.) Click the Build menu.
(2.) Click the Rebuid Solution command and make sure the Build succeeded.
(3.) Click the Clean Solution command.
(4.) Click the Clean IntroductionDesktopApp command.
Please review the steps in the screenshots.
Student: I have another question.
Why did you not choose the Portable Target runtime?
Teacher: Good question.
The portable version has other files published with it.
It will not run independently. It has to run with all those files published with it.
Student: Else, it will not run?
Teacher: That is correct.
This is the executable file:
Mr. C's Introduction (Desktop App)
It should work. It should run by itself.
(1.) Discuss a brief history of VB.
(2.) Discuss the versions of VB including any significant change made for each version.
(3.) Discuss any console application developed with VB.
(4.) Discuss any desktop application developed with VB.
(5.) Discuss any web application developed with VB.
(6.) Discuss any mobile application developed with VB.
(7.) Discuss any IDE for VB including the advantages and disadvantages.
(8.) Explain using appropriate examples, any three new terms learned this week.
(9.) Compare any three features of VB with any similar object-oriented language.
(10.) Contrast any three features of VB with any similar object-oriented language.
(1.) Include any "missing gaps" in the history of VB.
(2.) Include any "missing gaps" in the versions of VB.
(3.) Discuss an additional console application developed with VB.
(4.) Discuss an additional desktop application developed with VB.
(5.) Discuss an additional web application developed with VB.
(6.) Discuss any mobile application developed with VB.
(7.) Discuss any IDE for VB. Include the advantages and disadvantages.
(8.) Add to the post of the student who explained any three new terms learned this week.
(9.) Add to the post of the student who compared three features of VB with another
object-oriented langauge.
(10.) Add to the post of the student who contrasted three features of VB with another
object-oriented langauge.
(11.) Provide any of these if it is lacking in any DB post that solved any question in the
Assess tab of this module: Well-written comments; another approach/method to solving the
question; any additional relevant details; etc.
(12.) Write two different sentences on two different lines.
Insert a blank line between the first line and the second line.
Do NOT use the "vbNewLine" command.
(1.) Develop a desktop application titled: Introduction
The application should include three buttons: the About button, the Clear button, and the
Exit button.
When a user opens the application, it should display a blank page and the three buttons.
When the user clicks the About button, these information should be displayed:
(a.) Your picture
(b.) A brief summary of you. Write at least three sentences about yourself.
(c.) One sentence about the course and your major/program.
(d.) One sentence about the course expectations/accomplishments. What is your expectation about the course? What
do you intend to accomplish at the end of the course?
(e.) Any other thing you would like us to know about you.
When a user clicks the Clear button, the page should be blank.
When a user clicks the Exit button, the application should close.
I am more interested in the functionality.
However, I am also interested in the design/graphics/aesthetics.
Make a good design.
vary, variable, identifier, data type, data value, value, parameter, container, ASCII (American Standard Code for Information Exchange), static variables, instance variables, array elements, value parameters, reference parameters, output parameters, local variables, definite assignment, assignment operator, initially assigned variables, initially unassigned variables, constant, keyword, reserved keyword, contextual keyword, access keys, tab index property, type conversion, implicit conversion, explicit conversion, widening conversion, narrowing conversion, string conversion, object conversion, array conversion, local variable, member variable, shared variable, instance variable, procedure, Hungarian notation, inline function, function call, CType function, casting,
Students will:
(1.) Discuss the meaning of variables in VB.NET
(2.) Discuss the data types in VB.NET
(3.) Discuss the rules for using identifiers in VB.NET
(4.) Write VB.NET programs involving the use of variables and data types.
(1.) Textbook Chapter
(2.) Visual Basic Tutorials by Microsoft - Part 1: Variables in Visual Basic
(3.) Visual Basic Tutorials by Microsoft - Part 2: From Data Types to Type Conversions
(4.) Visual Basic Tutorials by Tutlane: VB Data Types and VB Variables
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(5.) Type Visual Basic Variables and/or Visual Basic Data Types in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(6.) Type Visual Basic Variables and/or Visual Basic Data Types in the search bar and view the results.
A Variable is a portion of computer memory for storing a data value.
Because a variable stores a data value, it is important to identify the type of data value it stores.
This implies that any variable is associated with a data type.
The data type describes the type of data value stored by the variable.
What type of data is being stored? Are they numeric (numbers), non-numeric
(letters/characters/words), etc.?
As noted with the word: variable, any value stored by it can vary (can change).
A variable is created/declared in VB by specifying the data type associated with it and
assigning it to a value.
A variable has a name (the word used to refer to the value that the variable contains) and a data type
(which determines the kind of data stored in the variable)
Generally, we declare a variable in Visual Basic this way:
Dim variableName As dataType
OR
Dim variableName As dataType = value
The Dim statement is known as the Dimension statement.
The As clause allows us to define the data type or the object type of the variable.
The equal sign is the assignment statement.
In other words, we assign something in VB using the equal sign.
NOTE: It is possible to declare a variable without specifying the data type.
This approach is known as Local Type Inference.
It is only used for local variables.
A local variable is a variable that is declared within a procedure.
A procedure is a block of Visual Basic statements enclosed by a declaration statement (Function, Sub, Operator, Get, Set)
and a matching End declaration.
All executable statements in Visual Basic must be within some procedure.
We do have other types of variables. We shall discuss them at the end of this module.
For now, let us focus on local variables.
The Visual Basic compiler uses type inference ti determine the data types of local variables declared
without the AS clause.
Based on the initial vaue of the expression, the compiler infers the type of the the variable.
To use the declare variables using the local type inference, the Option Infer must be set to On
By default, the Option Infer is set to On
Be it as it may, you are expected not to declare variables in this course without the As clause.
In other words, you should not use the local type inference declaration.
A data type is used to define the variable.
It tells what kind of variable is being declared.
When we declare a variable or constant in a program, we must specify the datay type
Sometimes, we may not be sure of the data type, or we may not want to associate the variable with a specific
data type.
In that case, we can use the Object data type.
This is because any data type can be stored in a variable of type Object
Let us review the data types in VB.
Data Type | Declaration | Size | Description |
---|---|---|---|
(1.) Signed Byte | SByte | $1$ byte ($8$ bits) | Integers from $-128$ to $127$ are stored |
(2.) Byte (Unsigned) | Byte | $1$ byte ($8$ bits) | Integers from $0$ to $255$ are stored |
(3.) Short (Signed Short Integer) | Short | $2$ bytes ($16$ bits) | Int16: Integers from $-32,768$ to $32,767$ are stored |
(4.) UShort (Unsigned Short Integer) | UShort | $2$ bytes ($16$ bits) | UInt16: Integers from $0$ to $65,535$ are stored |
(5.) Integer (Signed Integer) | Integer | $4$ bytes ($32$ bits) | Int32: Integers from $-2,147,483,648$ to $2,147,483,647$ are stored |
(6.) Unsigned Integer | UInteger | $4$ bytes ($32$ bits) | UInt32: Integers from $0$ to $4,294,967,295$ are stored |
(7.) Long (Signed Long Integer) | Long | $8$ bytes ($64$ bits) | Int64: Integers from $-9,223,372,036,854,775,808$ to $9,223,372,036,854,775,807$ are stored |
(8.) ULong (Unsigned Long Integer) | Long | $8$ bytes ($64$ bits) | UInt64: Integers from $0$ to $18,446,744,073,709,551,615$ are stored |
(9.) Single (Single-precision floating point) | Single | $4$ bytes ($32$ bits) |
$-3.4028235E+38$ through $-1.401298E-45$ for negative values This means $-3.4028235 * 10^{38}$ through $-1.401298 * 10^{-45}$ for negative values $1.401298E-45$ through $3.4028235E+38$ for positive values $1.401298 * 10^{-45}$ through $3.4028235 * 10^{38}$ for positive values |
(10.) Double (Double-precision floating point) | Double | $8$ bytes ($64$ bits) |
$-1.79769313486231570E+308$ through $-4.94065645841246544E-324$ for negative values This means: $-1.79769313486231570 * 10^{308}$ through $-4.94065645841246544 * 10^{-324}$ for negative values $4.94065645841246544E-324$ through $1.79769313486231570E+308$ for positive values This means: $4.94065645841246544 * 10^{-324}$ through $1.79769313486231570 * 10^{308}$ for positive values |
(11.) Decimal | Decimal | $16$ bytes ($128$ bits) |
$0$ through $\pm 79,228,162,514,264,337,593,543,950,335$ with no decimal point $0$ through $\pm 7.9228162514264337593543950335$ with $28$ places to the right of the decimal |
(12.) Boolean | Boolean |
Storage depends on the implementing platform $0$ = False, $1$ = True Make the connection with electronic devices. $0$ = Off; $1$ = On |
True or False |
(13.) Character (Single Character) | Char | $2$ bytes ($16$ bits) |
Integers from $0$ to $65535$ (unsigned) are stored. Only a single character/letter is stored. Must be enclosed in double quotes. (unlike in C#, Java, C++ where it is enclosed in single quotes) |
(14.) String (variable-length) | String | Storage depends on the implementing platform |
$0$ to $\approx 2 * 10^{9}$ Unicode characters Must be enclosed in double quotes. |
(15.) Date | DateTime | $8$ bytes | 0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM on December 31, 9999 |
(16.) Object | Object (class) |
$4$ bytes on $32-bit$ platform $8$ bytes on $64-bit$ platform |
Any data type can be stored in a variable of type Object |
(17.) User-Defined (structure) | inherits from ValueType | Storage depends on the implementing platform |
Each member of the structure has a range that is determined by its data type. The range is independent of the ranges of the other members. |
VB variables are identified with unique names known as idenfiers.
It is important to use identifiers that are meaningful and descriptive.
Anyone reviewing your program should not have to guess the meaning of your variable.
As you can see (based on the image below: Variables, Data Types, Values:)
The variables I used in that example are meaningful and descriptive
Those variables are:
state to denote the State of Ohio, OH
numState to denote the number of the State of Ohio in an alphabetical listing of the
state names
povertyRate to denote the poverty rate of Ohions according to the $2000$ census data
landArea to denote the land area of the Ohio according to the $2000$ census data
motto to denote the motto and seal of the Great State of Ohio
isMottoTrue to denote the Boolean data type if the motto is true
Even without the comments, you already have an idea of the meaning of my variables.
I should not have to guess the meaning of your variables.
Variable names:
(1.) Can be single letters (please avoid unless if used in loops)
(2.) Can contain a combination of letters, digits, and underscores but must not begin
with a number.
It may begin with a letter or an underscore.
If it begins with an underscore, it must contain at least one letter or digit.
Be it as it may:
(a.) Please avoid underscores
Avoid underscores even if the variable name does not begin with an underscore.
(b.) Use a combination of letters and digits such as:
num1 to represent the first number
variable1 to represent the first number
(3.) Can contain only letters but must not be any of the keywords.
They consist of: reserved keywords and unreserved keywords
Reserved keywords have special meanings in all VB programs.
Unreserved keywords are not reserved. This implies that you can be use them. However, please do not use them.
It is highly recommended to avoid using any keywords as an identifier in any VB program.
The reserved keywords are:
AddHandler, AddressOf, Alias, And, AndAlso, As, Boolean, ByRef, Byte, ByVal, Call, Case, Catch, CBool, CByte, CChar, CDate,
CDbl, CDec, Char, CInt, Class Constraint, Class Statement, CLng, CObj, Const, Continue, CSByte, CShort, CSng, CStr, CType,
CUInt, CULng, CUShort, Date, Decimal, Declare, Default, Delegate, Dim, DirectCast, Do, Double, Each, Else, ElseIf,
End Statement, End <keyword>, EndIf, Enum, Erase, Error, Event, Exit, False, Finally, For (in For...Next),
For Each...Next, Friend, Function, Get, GetType, GetXMLNamespace, Global, GoSub, GoTo, Handles, If, If(), Implements,
Implements Statement, Imports (.NET Namespace and Type), Imports (XML Namespace), In, In (Generic Modifier), Inherits,
Integer, Interface, Is, IsNot, Let, Lib, Like, Long, Loop, Me, Mod, Module, Module Statement, MustInherit, MustOverride,
MyBase, MyClass, NameOf, Namspace, Narrowing, New Constraint, New Operator, Next, Next (in Resume), Not, Nothing,
NotInheritable, NotOverridable, Object, Of, On, Operator, Option, Optional, Or, OrElse, Out (Generic Modifier), Overloads,
Overridable, Overrides, ParamArray, Partial, Private, Property, Protected, Public, RaiseEvent, ReadOnly, ReDim, REM,
RemoveHandler, Resume, Return, SByte, Select, Set, Shadows, Shared, Short, Single, Static, Step, Stop, String,
Structure Constraint, Structure Statement, Sub, SyncLock, Then, Throw, To, True, Try, TryCast, TypeOf…Is, UInteger, ULong,
UShort, Using, Variant, Wend, When, While, Widening, With, WithEvents, WriteOnly, Xor, #Const, #Else, #ElseIf, #End, #If,
=, &, &=, *, *=, /, /=, \, \=, ^, ^=, +, +=, -, -=, >> Operator, >>= Operator, <<,
<<=
EndIf, GoSub, Variant, Wend are no longer used in Visual Basic.
However, they are still retained as reserved keywords.
The unreserved keywords are:
Aggregate, Ansi, Assembly, Async, Auto, Await, Binary, Compare, Custom, Distinct, Equals, Explicit,
From, Group By, Group, Join, Into, IsFalse, IsTrue, Iterator, Join, Key, Mid, Off, Order By, Preserve,
Skip, Skip While, Strict, Take, Take While, Text, Unicode, Until, Where, Yield, #ExternalSource,
#Region
(a.) The letters can be Camel case (similar to the hump of a camel) such as:
firstVariable...the V is the hump
In Camel casing letters: two letters are merged as one; the first letter of the second word is
an uppercase letter while all other letters are lower case letters.
In firstVariable, V is uppercase; all other letters are lower case
(b.) The letters can be Pascal case such as FirstVariable
In Pascal casing, two letters are merged as one; the first letter of the first word and the
first letter of the second word are uppercase letters while all other letters are lower case letters.
In FirstVariable, F and V are uppercase; all other letters are lowercase.
(c.) uppercase letters (please avoid...it denotes someone who is yelling)
(d.) lowercase letters (okay, but try to avoid)
Student: What if you have three words?
How do you write it in Camel case? Pascal case?
Teacher: Say we want to write the variable, first arithmetic sequence
Camel case: firstArithmeticSequence...A and S are the only uppercase
Pascal case: FirstArithmeticSequence...F, A, S are the only uppercase
In this course, for all applicable variables; please use:
(i.) A combination of letters and digits such as num1 OR
(ii.) Camel case letters such as firstNumber OR
(iii.) Pascal case letters such as FirstNumber
***We shall use single characters when we write conditions for Iteration statements/Loops
because it is easier to use single characters in such cases. We shall see examples when we discuss loops.
However, feel free not to use it if you wish.***
(4.) Cannot be more than $1023$ characters long.
This length requirement also applies to the entire string of a full name such as:
outerNamespace.middleNamespace.innerNamespace.thisClass.thisElement
(5.) Cannot contain whitespaces.
A whitespace is a horizontal or vertical space.
For example: myNum has no whitespace; but my Num has a whitespace.
Variable names cannot contain whitespaces.
Hence: myNum is acceptable, but my Num is not acceptable.
Declaring Read-Only Variables: Use the ReadOnly keyword
As we have learned, a variable vary. The value changes.
However, read-only variables do not change.
Sometimes, we need these kind of variables.
We have to create/declare them using the ReadOnly keyword.
This must be declared at the Module level, not at the Procedure level
For example, if we want to use the approximate value of pi as $3.142$ rather than using the exact value, we can
declare it as:
ReadOnly $piValue$ As Double = $3.14159$
This means that the variable, piValue is a read-only variable
It will not change it's value.
Student: What do you mean that it must be declared at the Module level?
May you please give code examples?
Teacher: Sure.
We shall begin with console applications.
Then, we shall develop desktop applications.
We shall create a new project and name it: Module2
Let us review these two examples.
Let us try to modify the value of the read-only variable and try to run it to see the output.
Please do not run any program that compiles with an error.
As you can see, the variable $piValue1$ cannot be changed because it was declared as a read-only
variable (using the ReadOnly keyword)
Teacher: As you see: for the new value of piValue1, we can modify the value of any variable we create, by specifying another value for that same variable name.
Student: But, why do we need to do this?
Can't we just create another variable with that second value?
Teacher: Good point.
Yes, it is much better to create another variable with the new value.
However, when we work with statements and sorting techniques among others; it may be more efficient to just assign the new value to the same variable; rather than create another variable and assign the new value to it.
For example: if you are sorting through a loop also known as an iteration statement; we can create a variable, and write a conditional statement that when you compare an element in the array with the next element; assign the value of the greater element to the variable.
Rather than create a new variable, assign any greater value to the variable as you compare elements in the array.
There are some terms I just used, that we shall discuss in later modules.
(6.) Are case sensitive.
These are all different variables:
firstresult (lowercase),
firstResult (Camel case),
FirstResult (Pascal case),
Firstresult,
FIRSTRESULT (uppercase),
first_result (snake case)
strFirstResult (Hungarian notation)
Student: Hungarian notation?
Teacher: Hungarian notation is a naming convention that follows the camel case naming but in which
the name is preceded by the data type represented by a three-character ID.
str means string
Similarly, int is for integer; dec is for decimal;
dbl is for double; bln is for Boolean among others.
Variables, Data Types, Values Example: State of Ohio
Why discuss Type Conversions?
Reasons:
(A.) You might declare the result of a calculation as an integer.
You do the calculation and the result is say $32$
However, your professor wants the answer to a double with at least one decimal place.
This means that you have to either declare the result as a double before doing the calculation, or
you have to convert the Integer result to a Double.
And sometimes, you may need to do the latter especially if you need to use the Integer result in another
calculation.
(B.) You might have a Single data type variable that you need to pass as an argument to a method whose parameter is
declared as an Integer data type.
(C.) You might need to convert an Object to another data type.
If you do not understand what I wrote in (B.) and (C.), do not worry.
You will understand (B.) later in this course.
You will understand (C.) in the Advanced Visual Basic course.
These kinds of operations are known as type conversions.
Type Conversions is the conversion of a variable of a data type to
a different data type.
There are several approaches of conversions that can be performed in VB.
They are:
(I.) Implicit and Explicit Conversions
These are the conversions classified by whether Visual Basic perfoms them automatically
(II.) Widening and Narrowing Conversions
These are the conversions classified by whether the destination type can hold the data.
(III.) Conversions Between Strings and Other Types
These are the conversions between strings and other data types such as integers, singles, decimals, doubles,
Boolean, and/or data among others.
(IV.) Array Conversions
This is the conversion between arrays of different data types.
(V.) Conversion of an Object to Another Type
This is the conversion between an object of a data type to an object of another data type.
We shall focus on the first three conversions in this module.
We shall discuss the last conversion in the Advanced Visual Basic course.
(1.) Implicit Conversion: This is the conversion of a variable from a smaller data type to a larger data
type.
This is done automatically.
No special syntax is required. No information is lost.
The conversion always succeeds.
Examples include the conversions from:
SByte to Short Byte to Char Byte to Int Byte to Long Byte to Single Byte to Double Short to Char Short to Int short to Long Short to Single Short to Double Char to Int Char to Long Char to Float Char to Double Int to Long Int to Single Int to Double Long to Single Long to Double Single to Double ...among others(2.) Explicit Conversion (Casting): This is the conversion of a variable from a larger data type to a smaller data type.
Double to Single Double to Long Double to Int Double to Char Double to Short Double to Byte Single to Long Single to Int Single to Char Single to Short Single to Byte Long to Int Long to Char Long to Short Long to Byte Int to Char Int to Short Int to Byte Char to Short Char to Byte Short to Byte ... among othersThere are two approaches to performing explicit conversions.
As usual, we shall develop desktop applications that involves the use of variables and data types.
Let us develop desktop applications for the console application we did for the State of Ohio
We shall use several toolboxes.
Remember that the Midterm Project is a desktop application.
Hence, it is necessary to start getting familiar with GUI programming.
Please review the desktop application we did in Module $1$
We shall give appropriate names for our projects.
Tasks:
User Interface and Properties
Form:
Name Property: Leave as is
Text Property: State of Ohio: RichTextBox and Buttons
BackColor Property: Web: Wheat
Font Property: Font: Times New Roman; Font style: Regular; Size: $16$; Script: Western
Toolbox | Property |
---|---|
Label $1$ (LHS) |
Name: leave as is Text: State |
Label $2$ (RHS) |
Name: StateLabel AutoSize: False Text: Delete it BorderStyle: Fixed3D BackColor: Web: White |
Copy, Paste, Adjust, Align: Label $1$ Label $3$ (LHS) |
Name: leave as is Text: Number |
Copy, Paste, Adjust, Align: Label $2$ Label $4$ (RHS) |
Name: NumberLabel |
Copy, Paste, Adjust, Align: Label $1$ Label $5$ (LHS) |
Name: leave as is Text: Poverty Rate |
Copy, Paste, Adjust, Align: Label $2$ Label $6$ (RHS) |
Name: PovertyRateLabel |
Copy, Paste, Adjust, Align: Label $1$ Label $7$ (LHS) |
Name: leave as is Text: Land Area |
Copy, Paste, Adjust, Align: Label $2$ Label $8$ (RHS) |
Name: LandAreaLabel |
Copy, Paste, Adjust, Align: Label $1$ Label $9$ (LHS) |
Name: leave as is Text: Motto |
Copy, Paste, Adjust, Align: Label $2$ Label $10$ (RHS) |
Name: MottoLabel |
Copy, Paste, Adjust, Align: Label $1$ Label $11$ (LHS) |
Name: leave as is Text: Is Motto true? |
Copy, Paste, Adjust, Align: Label $2$ Label $12$ (RHS) |
Name: BooleanLabel |
Button $1$ (RHS) |
Name: OhioButton Text: State of Ohio BackColor: Web: White |
Copy, Paste, Adjust, Align: Button $1$ Button $2$ (Middle position) |
Name: ClearButton Text: &Clear |
Copy, Paste, Adjust, Align: Button $1$ Button $3$ (RHS) |
Name: ExitButton Text: E&xit |
Select the first label on the left: the State label (Text property); hold the CTRL key on your keyboard and select all the Left
Hand Side (LHS) labels
Aligh all the LHS labels to the left
Click on an empty space in the form to deselect all the RHS labels.
Select the first label on the right: the StateLabel (Name property); hold the CTRL key on your keyboard and
select all the Right Hand Side (RHS) labels
Aligh all the RHS labels to the right
Click on an empty space in the form to deselect all the RHS labels.
Select the three buttons.
Click the Format menu, Make Same Size: Both
Click on an empty space in the form to deselect the three buttons.
Student: Mr. C
I have a question.
Why did you decide to include that symbol besides the "C" in the Clear button and the "x" in the Exit button?
Teacher: Very good question.
That symbol is known as the ampersand symbol
The underlined word is known as an Access Key
Student: What is an Access Key?
(1.) An Access Key is a key assigned to an object (toolbox control objects) by including the ampersand symbol, &
before a letter or number in the Text Property of the object.
(2.) Any user can access the application by using a combination of the Alt key and the Access key
to select the specific object.
For example in our program: when we run the application; a combination of Alt + C clears the entries in the application.
Similarly, Alt + X combination selects the Exit button and exits the application.
(3.) Access keys are useful for those who cannot work with a mouse, or who do not want to work with a mouse.
(4.) It is important for programmers to assign access keys to objects that accept user input such as textboxes and to
objects that perfom actions such as buttons.
It is part of Accessibility Design for people with disabilities.
The use of access keys in the Midterm Project is required.
It is important to use meaningful access keys.
(5.) Pressing the Alt key temporarily shows the accessing keys.
(6.) Access keys are not case sensitive.
(7.) Toolbox controls that cannot receive focus cannot have access keys.
(1.) Go to the Design View of the form and double click the State of Ohio button
(2.) Declare the variables
(3.) Write the code.
(4.) Alternatively, you can go to the View menu, and view Code
Then, select the OhioButton in the Code View under the Form1() dropdown list.
(5.) In the same manner, code the Clear button and the Exit button
(6.) Build Solution
(7.) Run the program.
Please view the screenshots. Study the comments and the code.
Here, we shall use the RichTextBox and the Buttons. No labels.
Tasks:
User Interface and Properties
Form:
Name Property: Leave as is
Text Property: State of Ohio: RichTextBox and Buttons
BackColor Property: Web: Cornsilk
Font Property: Font: Times New Roman; Font style: Regular; Size: $16$; Script: Western
Toolbox | Property |
---|---|
RichTextBox |
Name: OhioRichTextBox Text: Nothing |
Button $1$ (RHS) |
Name: OhioButton Text: State of Ohio BackColor: Web: White |
Copy, Paste, Adjust, Align: Button $1$ Button $2$ (Middle position) |
Name: ClearButton Text: &Clear |
Copy, Paste, Adjust, Align: Button $1$ Button $3$ (RHS) |
Name: ExitButton Text: E&xit |
Select the three buttons.
Click the Format menu, Make Same Size: Both (as we did in the first flashcard)
(1.) Double click the State of Ohio button
(2.) Declare the variables
(3.) Write the code.
(4.) Code the Clear button and the Exit button
(5.) Build Solution
(6.) Run the program.
Please view the screenshots. Study the comments and the code.
We shall explore more toolbox controls in subsequent modules.
(1.) Using at least five complete sentences and at least five different variables and data types,
write a program of the summary of what you learned in this module.
(2.) Write a program of a short story, a poem, or drama using at least five sentences and at least five different variables and data types.
(3.) Write a program that demonstrates at least ten examples of Implicit Type Conversions
Use the data types listed in this Module.
(4.) Write a program that demonstrates at least ten examples of Explicit Type Conversions
Use the data types listed in this Module.
(5.) Write a program of a short story, a poem, or drama using at least five sentences, the same variable,
and at least three different data types.
(6.) To be done by only one student on a first-come first-served basis
Assume you have three initials.
Write a program that declares variables to hold your three initials.
Display the three initials with a period following each one, for example: $S.D.C$
(1.) Provide any of these details if they are lacking in any DB post:
Well-written comments; another approach/method to solving the question; any additional relevant details; etc.
(2.) Other substantive responses.
(1.) Develop a Graphical User Interface (GUI) of a short story, a poem, or drama using at least five sentences and
at least five different variables and data types.
At least three buttons: the button that displays the information, the Clear button and the
Exit button should be included.
Include access keys for the three buttons.
(2.) Develop a Graphical User Interface of a short story, a poem, or drama using at least five sentences,
the same variable, and at least three different data types.
At least three buttons: the button that displays the information, the Clear button and the
Exit button should be included.
Include access keys for the three buttons.
(3.) Develop a GUI flashcard of all the data types.
A brief definition of each data type should be displayed when the user performs an event
(such as pointing the mouse or clicking) on each data type.
Use whatever toolbox controls you prefer.
number, variable, constant, literal, value element, operand, operator, operation, expression, arithmetic operators, comparison operators, concatenation operators, logical operators, bitwise operators, plus, addition, ampersand, assignment operator, compound assignment operators, standard input stream, null-conditional operators, bit shift operators, New operator, DirectCase operator, TryCast operator, NameOf operator, operator precedence and associativity, arithmetic overflow, division by zero, round-off errors, floating-point division, operator overloading, access keys, TabIndex property, ComboBox, MessageBox, calculator,
Students will:
(1.) Discuss the operators in Visual Basic
(2.) Perform operations on variables/values
(3.) Write VB programs involving the use of operators.
(1.) Textbook Chapter
(2.) Operators and Expressions by Microsoft
(3.) Operators by Microsoft
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type Visual Basic Numbers and/or Visual Basic Operators in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type Visual Basic Numbers and/or Visual Basic Operators in the search bar and view the results.
These references will be useful as we progress through the course:
(6.) List of Visual Basic Math Functions
(7.) Format Types in .NET
.NET means that the format types are applicable to VB and C#
(8.) Standard Numeric Format Strings
Operators are special symbols that perform specific operations on one or more operands,
and returns an output.
An Operand is the variable/value on which an operation is done.
Based on the definitions by Microsoft:
An operator is a code element that performs an operation on one or more code elements that hold values.
Value elements include variables, constants, literals, properties, returns from Function, and Operator procedures, and
expressions.
An expression is a series of value elements combined with operators, which yields a new value.
The operators act on the value elements by performing calculations, comparison, or other operations.
The types of operators in Visual Basic.NET are:
(1.) Concatenation Operators
(2.) Arithmetic Operators
(3.) Assignment Operators
(4.) Comparison Operators
(5.) Null-conditional Operators
(6.) Logical/Bitwise Operators
(7.) Bit Shift Operators
(8.) New Operator
(9.) DirectCase Operator
(10.) TryCast Operator
(11.) NameOf Operator
The operators listed on Number (8.) through (11.) shall be discussed in the Advanced Visual Basic course.
Let us discuss some of these operators.
Concatenation Operators join multiple strings into a single string.
The two concatenation operators in VB are: $+$ (plus symbol) and the & (ampersand symbol)
Both operators are used to join strings and string data type.
However, the plus sign, $+$ joins numeric data types, string data types, and other data types.
In Modules $1$ and $2$, we used the plus sign: $+$ to join strings.
But the ampersand sign, & is recommended for string concatenation because it is exclusively defined for strings and reduces
the chances of generating an unintended conversion.
Feel free to use any or both of them.
However, going forward; we shall use the ampersand sign for only string data types.
Let us review some code examples with the use of both opeartors.
Arithmetic Operators are used to perform arithmetic operations on numeric values represented by literals, variables,
constants, other expressions, and function and property calls.
They are the:
Addition (+), Subtraction (-), Multiplication (*), Division (/), Integer Division (\), Exponentiation (^), and the
Modulus (Mod)
Did you notice the difference between the Division operator (forward slash, /) and the
Integer Division operator (backward slash, \)?
The Division operation gives the quotient and the remainder.
The Integer Division gives only the integer quotient of the division.
The Modulus operator gives only the integer remainder of the division.
Let us demonstrate some examples of Arithmetic operators.
Let us solve more examples.
Please visit my website on Numbers
(www.numbersandnotations.appspot.com/numbers.html)
Let us solve Questions $10$, $6$, $7$, and $23$ on that website
We shall use only Arithmetic Operators to solve Question $10$
We shall cover Functions (Methods) in Module $6$. However, it is important to introduce you to Visual Basic Math Functions in
this module because we are dealing with Numbers in this module.
We shall use Arithmetic Operators and Visual Basic Math Functions to solve Questions $6$, $7$, and $23$
This is the List of Visual Basic Math Functions
Please review the screenshots and the comments.
Teacher: You know one of the things I like about VB?
Student: What?
See how we declared the answers as double data type
But if the answer is an integer, VB displayed the answer as an integer rather than as a double
Java would have "messed" this up...displaying it as a double, then we have to convert that double back to an
integer
With VB, when we declare the answer as a double; if the answer is an integer, it will display it as an integer.
If the answer is a double, it will display it as a double.
Student: I like that too
Teacher: Yep...
But we need to declare it as a double because a double is a larger data type.
If we declare it as an integer and the answer is a double, then it will be rounded...that is not what we want.
Student: Look at Question (7.)
The answer on your website is not "exactly" the same as the answer displayed by the program
$84.7$ is not really $84.69999999999999$
Teacher: Good observation
The double data type has a double-precision floating point.
Hence, sometimes, it does not give the perfect accurate exact answer.
Assignment Operators are used to assign a value to a variable or property.
The equal sign is the assignment operator for programming languages (not just for VB)
Compound Assignment Operators are used to perform an operation on the value of a variable before assigning an
updated value to the variable.
They are:
$=$ operator (assignment operator)
$+=$ operator (compound assignment: add before assignment)
$-=$ operator (compound assignment: subtract before assignment)
$*=$ operator (compound assignment: multiply before assignment)
/= operator (compound assignment: divide before assignment)
\= operator (compound assignment: integer division before assignment)
^= operator (compound assignment: raise to an exponent before assignment)
≪ $=$ operator (compound assignment: arithmetic left shift before assignment)
≫ $=$ operator (compound assignment: arithmetic right shift before assignment)
&$=$ operator (compound assignment: concatenate a string expression to a string variable before assignment)
We use compound assignment operators if we want to do two things in one.
Rather than perform two tasks using two steps, perform those two tasks using one step.
Some people like it. Some people do not.
However, I prefer you learn it because you will most likely find it useful when we cover Statements in Module $5$
Let us demonstrate what I mean.
Please visit my website on Percent Applications
(www.fractions-decimals-percents.appspot.com/percentApplications.html)
Let us solve Question $1$ on that website
We covered Read-Only variables in Module $2$
However, we do have the Const keyword for declaring constants.
Like a Read-only variable, a constant cannot be modified or assigned a new value once it is declared.
The use of any of them (read-only variable or constant) depends on the program.
We shall use constants primarily in object-oriented programming (Advanced VB course)
However, let us illustrate it's use in this example...in the case of the sales tax
We could also declare the sales tax as a read-only variable if we want to.
But let us look at the use of constants.
So, what's the difference between the two?
First Difference: A read-only variable must be declared at the Module level while a constant is declared at the Procedure
(Method) level.
Because this calculation deals with currency (money), we shall use the currency format specifier
The advantage of using the currency format specifier is that it rounds the value to two decimal places
(money/currency is rounded to two decimal places) and it also includes the currency.
These are the Format Types in .NET
These are the Standard Numeric Format Strings
Let us format the result display in the console.
Please review the screenshots and the comments.
One of the nice features of the Visual Basic.NET langauge is the Input/Output feature.
This feature is interactive.
You use this input/output feature in several applications.
A common application is an application that verifies one's identity by inputting the first name, last name, date of
birth, etc.
To use the Input/Output feature, the Console.ReadLine() method is used.
Remember we discussed the Console.ReadLine() method in Module $1$. Please review Module $1$
Console.ReadLine() method reads the next line of characters from the standard input stream.
It reads strings.
We also have:
Console.Read() method: This method reads the next character from the standard input stream.
Console.ReadKey() method: This method obtains the next character or function key pressed by the user.
We shall cover Methods in Module $5$. For now, let us just stick with the Console.ReadLine() method.
Let us demonstrate the input/output feature with numbers so we see how it works.
Please review the screenshots and the comments.
Input/Output Feature: Example $1$
Let us solve Question $12$ on the Numbers
website.
Input/Output Feature: Example $2$
Let us do a real-world application for this example.
Onto the ...
Please review the BMI information on these two government websites [from the Center for Disease Control and Prevention (CDC) and the National Heart, Lung, and Blood Institute of the National Institutes of Health (NIH)]
About Adult BMI | Healthy Weight, Nutrition, and Physical Activity | CDC and
Calculate Your BMI - Standard BMI Calculator
As at today, the 3rd day of September, 2020; the BMI information on both websites are:
NIH website
Calculate Your BMI - Standard BMI Calculator
CDC website
About Adult BMI | Healthy Weight, Nutrition, and Physical Activity | CDC
$ BMI = \left(\dfrac{weight}{height * height}\right) * 703 \\[5ex] weight\:\:is\:\:in\:\:pounds (lb) \\[3ex] height\:\:is\:\:in\:\:inches (in) $
$ BMI = \left(\dfrac{weight}{height * height}\right) \\[5ex] weight\:\:is\:\:in\:\:kilograms (kg) \\[3ex] height\:\:is\:\:in\:\:meters (m) \\[3ex] $ If you need help with conversion of units, please review the Tables and Examples in Measurements and Units
Teacher: What do you notice in both websites?
Student: They both have the information on the BMI.
In addition, the CDC website has information for both Adult BMI and Child & Teen BMI among others.
The NIH website has recommendations among others.
Teacher: That is correct. What else?
Student: They have the BMI calculator.
Teacher: Did you notice any difference in the calculator on both websites?
Student: The NIH website has BMI calculator for both Standard and Metric versions.
The CDC website has the BMI calculator for only the Metric version.
Teacher: Did you notice any issue/concern about the BMI information?
Student: Not really. Why?
Teacher: So, this is what we are going to do.
We are going to develop the BMI calculator.
That calculator will calculate the BMI.
Then, we shall interpret that BMI, and make a recommendation.
.
The CDC website gave us the formula for calculating the BMI. So, we shall use it.
As you can see, our calculator would have to use conditional statements for the interpretation and recommendation.
But, here is the issue.
Student: Wait, I think I see the issue.
The issue is with the domains.
Teacher: Correct!
Anyone having a BMI between $18.5$ and $24.9$ both endpoints included has a Normal weight.
This is: Normal weight: [18.5, 24.9]. It is a closed interval (relate with Mathematics).
So, the Overweight range for the BMI should be the weight greater than $24.9$, (rather than beginning from $25$) and ending at $29.9$
For the Overweight range, the first endpoint is not included, but the second endpoint is included.
This is: Overweight: (24.9, 29.9]. It is a half-open half-closed interval (relate with Mathematics)
Teacher: Do you know why this would be a problem if the programmer does not fix these issues before developing the calculator?
Student: Yes. Because there would not be any interpretation for anyone whose BMI is between $24.9$ and $25$
But, I do see that the BMI information is for values rounded to one decimal place.
Teacher: That is correct.
And we shall develop our calculator to round to one decimal place.
But, it is important we fix the issues.
What if we do not want to round?
Look at the two examples on the CDC website. The BMI values were rounded to two decimal places.
If we developed our calculator to round to two decimal places with the information on those websites "as is"; then we would not have the interpretation and recommendation for those two examples ($24.98$ and $24.96$) because those values are greater than $24.9$ but less than $25$.
Student: That makes sense.
So, the last one: Obese should be BMI greater than $29.9$, rather than greater than $30$?
Teacher: That is correct.
We are going to apply what we learned so far.
We shall develop a console application and a desktop application for the Body Mass Index (BMI) calculator.
I do the console application.
You do the desktop application.
We are yet to cover Statements (covered in Module $5$). However, do not worry.
I explained my comments very well. You will understand the comments.
Please ask questions if you do not understand any of the comments.
We shall use part of Module $5$ (Decision-making statements) in the program.
Please review the screenshots and the comments.
(1.) The program should accept user inputs of:
(I.) First name
(II.) Last name
(III.) Weight
(IV. Height
(2.) The program should output the:
(A.) BMI value
(B.) Interpretation
(C.) Recommendation
(3.) The program should address user-input errors of non-positive numbers for the weight and the height.
Inform the user.
Then, exit the program. Do not allow the program to continue.
To exit the program, we use the command: Environment.Exit(0)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Student: I have several questions, Mr. C
Teacher: Please go ahead
Student: First Question: Why did you initialize those variables?
The interpretBMI and the adviceBMI...you initialized them to String.Empty
Teacher: Good question.
Assume we did not initialize them
We only defined them within the block of code: the If-Then Statement
Then, we want to print them/output them outside the block of code
The program "will not be happy"
Compare it to this scenario.
A student registered to attend a school.
We did not register the front office registration desk.
But we sent the student to a classroom and the classroom teacher registered that student.
The parents come, looking for their child.
Where will the parent go first?
Student: At the front desk of course
Teacher: Good.
The front desk will first keep a record of the student before sending the student to the class.
We have to first assign the string to something before we send it to the blocks of code, and then output it.
We cannot just declare it without an assignment, then send it to a block of code to be used within that block of
code only, and then want to output it outside the block of code.
Does it make sense?
Student: Yes, it does.
But what if we do not want to print the value outside the block of code?
What if we want to print the value inside each block of code where it is used?
Teacher: I am impressed by your questions.
Yes, we can do that.
But you know what that means...right?
Student: We have to write it each time for each of the conditional statement.
Teacher: That is correct.
Student: Second Question: Why did you underline the 0 on the console window?
....process exited with 0?
Teacher: Unless defined in the program otherwise; anytime you run a program and the program exited with 0,
it means that the program successfully exited.
0 basically lets you know that the program ended successfully.
Student: Third Question: how did you color the heading in the Console window?
Teacher: We can format (set foreground and background colors for) our results in the console window.
This is the List of the Console Log Formatting Commands
Console.ForegroundColor = ConsoleColor.Yellow command sets the foreground color of the text in the console to yellow.
Console.ResetColor() command resets it (ends the color).
It is important to reset it, else it will underline the entire text in the console.
We have done several console applications.
Now onto desktop applications.
Before we begin, let us make a note of an important concept: Property Names of the Toolbox Controls
Notice the three dots in this screenshot image (indicated by the arrow):
Whenever you notice something like that anywhere in your code, it is important to point your mouse at it and click the
Show potential fixes link:
Notice the issue was a naming rule violation. It is not a "big" issue hence those three dots.
It is not a warning. It is not an error. But it is a violation.
You do want to ensure your project is free of all violations (not just warnings and errors).
So, let us address that naming rule violation.
Going forward, we shall name each property of any toolbox control using Pascal casing.
Let us apply the knowledge we acquired in this module to develop a desktop application.
Which application comes to mind right away...a desktop application that deals with Numbers and Operators?
It's the Standard Calculator. Let's develop it. 😊
Please review the desktop applications we developed in previous modules beginning from Module $1$
Let us begin with the desktop calculator on your Windows PC/Laptop
Please see the screenshots
Let us develop the function buttons as seen in the red rectangle.
We are yet to cover Statements (covered in Module $5$). However, do not worry.
I explained the comments very well. You will understand the comments.
Please ask questions if you do not understand any of the comments.
We shall use part of Module $5$ (Conditional statements) in the program.
Form1.vb: Adjust and Align
(Name) property: Leave as is. Do not change
Text property: Standard Calculator © 2021 SamDom4Peace Designs (Sample)
BackColor property: Web: Purple
ForeColor property: Web: White
Font: property: Font: Times New Roman; Font Style: Regular; Size: 24
FormBorderStyle property: Fixed3D
MaximizeBox property: False
The MaximizeBox property is set to False if we do not want the user to maximize the application.
The reason is because we want the interface to have a consistent look.
Toolbox Controls | Property |
---|---|
Label: Adjust and Align |
AutoSize: False (do this first) BorderStyle: Fixed3D Text: Delete Label1 Adjust and Align again TextAlign: MiddleRight (Name): CalculatorLabel |
TextBox: Adjust and Align |
Text: $0$ (because we want $0$ to be the default) TextAlign: Right (because we want to align the $0$ to the right) (Name): CalculatorTextBox |
Button: Adjust and Align |
Text: $1/x$ ForeColor: Web: Black BackColor: Web: White (Name): ReciprocalButton |
Copy and Paste Button: Adjust and Align |
Text: $x^2$ (Name): SquareButton |
Copy and Paste Button: Adjust and Align |
Text: $\sqrt{x}$ (Name): SquareRootButton |
Copy and Paste Button: Adjust and Align |
Text: $\div$ (Name): DivideButton |
Copy and Paste all previous four Buttons: Adjust and Align Then, begin to work on each button. |
Text: $7$ (Name): SevenButton |
Button: Adjust and Align |
Text: $8$ (Name): EightButton |
Button: Adjust and Align |
Text: $9$ (Name): NineButton |
Button: Adjust and Align |
Text: $\times$ (Name): MultiplyButton |
Copy and Paste all previous four Buttons: Adjust and Align Then, begin to work on each button. |
Text: $4$ (Name): FourButton |
Button: Adjust and Align |
Text: $5$ (Name): FiveButton |
Button: Adjust and Align |
Text: $6$ (Name): SixButton |
Button: Adjust and Align |
Text: $-$ (Name): MinusButton |
Copy and Paste all previous four Buttons: Adjust and Align Then, begin to work on each button. |
Text: $1$ (Name): OneButton |
Button: Adjust and Align |
Text: $2$ (Name): TwoButton |
Button: Adjust and Align |
Text: $3$ (Name): ThreeButton |
Button: Adjust and Align |
Text: $+$ (Name): PlusButton |
Copy and Paste all previous four Buttons: Adjust and Align Then, begin to work on each button. |
Text: $+/-$ (Name): PlusMinusButton |
Button: Adjust and Align |
Text: $0$ (Name): ZeroButton |
Button: Adjust and Align |
Text: $.$ (Name): DecimalButton |
Button: Adjust and Align |
Text: $=$ (Name): EqualButton |
Copy and Paste Button: Adjust and Align |
Text: &Clear (Access key: C) (Name): ClearButton |
Copy and Paste Button: Adjust and Align |
Text: E&xit (Access key: x) (Name): ExitButton |
(1.) Double-click the $1/x$ button in the Design window.
This leads to the Code window
Scroll a little bit to the top, write the comments, and begin to...
(2.) Write the code.
Let us use a top-down approach.
Double-click each button in the Design window to open the Code window.
Then write the code for the event: what should happen when the user clicks the button?
Please review the screenshots.
Review the comments.
Design Area
Access keys: C for the Clear and x for the Exit button
Program Code
Run the Program
$\infty$ means Infinity
NaN means Not a Number
It is not a real number.
But it is an imaginary number.
It is covered under Complex Numbers in Algebra)
This calculator deals with only with real numbers.
$-\infty$ means Negative Infinity
Functionalities of the Calculator
(1.) For operation involving two numbers: the calculator works for any positive numbers.
(2.) For operation involving two numbers: the calculator works if the first number is negative.
(3.) For operation involving one number: the calculator works for any number.
(4.) For any operation: the user sees what he/she did.
(5.) Division of a number by zero is handled. The square root of a negative number is handled.
Limitations of the Calculator
(1.) For operation involving two numbers: the calculator does not work for two negative numbers.
(2.) The calculator computes one operation at a time. It does not perform multiple operations simultaneously.
Let us design another calcuator using more toolbox controls.
For this calculator:
(1.) We want two textboxes for user-input.
The two textboxes will receive user-input for two numbers (the operands).
Remember that textboxes accept only strings.
But we want them to accept numbers.
We shall define those numbers using the double data type (to accomodate decimals).
Then, we shall convert those numbers as strings so that the textboxes will accept them.
(2.) We want a ComboBox.
The ComboBox will contain a dropdown list of items: the operations.
We shall expand our list of operations. So, this calculator will be more of a scientific calculator.
I shall do some functions.
You do the rest of the functions (just as we did for the Standard Calculator).
We shall use an access key with the ComboBox.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
(3.) We want four buttons: the Calculate, Clear Some, Clear All, and Exit buttons.
We shall use access keys with these buttons.
(4.) When we run our program, we want the cursor to be focused on the first textbox.
Then, we want the user to be able to use the Tab key on the keyboard to perform any operation without using a mouse.
This is an important software design concept to accommodate users with disabilities.
Access keys is one of the ways to work only with the keyboard keys.
Another way is the TabIndex Property.
Once the user enters the first number in the first textbox; move to the ComboBox and select an operation from the
dropdown list and press the Tab key; use the Tab to move to the second textbox (as applicable), enter the second number and
press the Tab key (as applicable); move to the Calculate button and hit the Enter key to get the result.
The TabIndex property controls that ability for the Tab to move in that order.
We shall set the TabIndex property of each toolbox control accordingly.
For operations that involve two numbers such as calculating the sum, difference and the like: we want it to be:
$first\;\;number \rightarrow operation \rightarrow second\;\;number \rightarrow calculate$
For operations that involve only one number such as calculating the reciprocal, square root and the like: we want to
disable the second textbox so that the user would not enter a second number.
The TabIndex property contains a number that represents that order in which the toolbox controls are added to the form.
It determines the order in each toolbox control receives focus when the user presses the Tab key or uses an Access key
while an application is running.
The TabIndex property is zero-indexed. This means that the first one begins with a 0, the next one is a 1, the next is a 2
among others.
The TabIndex can be changed by:
(1.) Click the form: $\rightarrow View\;\;menu \rightarrow the\;\;Tab\;\;Order$ or
(2.) Click each control and change the TabIndex property from the Properties menu.
It is important to note that some toolbox controls do not have a TabIndex property.
The user may decide to use the access key to do the calculation.
However, we want the user to be able to use only the Tab key and perform operations because the some users may not
remember access keys. Besides, any two programmers may decide to use different access keys for the same button.
If the user does ALT + C, it leads to the Calculate button and the calculation is done.
Alternatively, the user can decide to move the Tab key to the Calculate button and then press the ENTER key when the focus
is on the button. The calculation will also be done.
Either way is fine. However, the use of only the Tab key has the priority.
It is necessary to accommodate users by allowing users to perform operations with Tab keys especially when they
do not know the access keys.
Hence, the TabIndex property is important.
As we insert the toolboc controls in the form, we want to check the TabIndex property and ensure that they are in order.
To do so, it is imporant to arrange the toolbox controls in order.
Even if you do not arrange them in order initially, it is important to set the TabIndex property in the order you want the
tab to move for the user to run the application.
Recap:
Assume the user is working with only the keyboard (software design to accommodate users who cannot use the mouse)
(1.) When the user runs the application, the cursor focus should be in the first textbox waiting for user input.
The user enters a number and presses the tab key
(2.) The next focus should be the ComboBox waiting for the user to make a selection.
The user selects an operation.
If the operation involves only one number, the second textbox is disabled so the focus moves to the Calculate
button.
The command used to disable the textbox is: TextBox.Enabled = False
As you can see, to disable a TextBox; the Enabled property of the Textbox is set to the Boolean value: false
If the operation involves two numbers, the cursor focus moves to the second textbox waiting for the user to enter the
second number. The user enters the second number and presses the tab key.
The next focus would be the Calculate button.
The user presses the ENTER key and the calculation is done. The result is displayed in the label: ResultLabel.
(3.) The user presses the tab key and the focus should be the Clear Some button.
The user presses the ENTER key and the entries in the textboxes and the label are cleared.
(4.) The user presses the tab key and the focus should be the Clear All button.
The user presses the ENTER key and all entries (all items in the ComboBox) are cleared.
(5.) The user presses the tab key and the focus is the EXit button.
The user presses the ENTER key and the application is closed.
Form1.vb: Adjust and Align
(Name) property: Leave as is. Do not change
Text property: Scientific Calculator © 2021 SamDom4Peace Designs (Sample)
BackColor property: Web: Green
ForeColor property: Web: White
Font: property: Font: Times New Roman; Font Style: Regular; Size: 18
FormBorderStyle property: Fixed3D
MaximizeBox property: False
We set the MaximizeBox property to False because we do not want the user to maximize the application.
We want the interface to have a consistent look.
Toolbox Controls | Property |
---|---|
Label: Adjust and Align |
Text: First Number: |
TextBox: Adjust and Align |
Text: TextAlign: Right (because we want to align the number to the right) (Name): FirstNumberTextBox TabIndex: 1 |
Copy the previous label: Adjust and Align Label: |
Text: Operation: |
ComboBox: Adjust and Align Please see the screenshots on how to insert the ComboBox |
Text: (Name): OperationComboBox TabIndex: 3 |
The items in the ComboBox are written that way for teaching purposes.
Reviewing those items, it is easy for you to see the operations that involve one number (first number only) and the
operations that involve two numbers (the first number and the second number)
Select the first label (click) and textbox (CTRL) Copy (CTRL + C) and Paste (CTRL + V) Label: Adjust and Align |
Text: Second Number: |
Select the first label (click) and textbox (CTRL) Copy (CTRL + C) and Paste (CTRL + V) TextBox: Adjust and Align |
(Name): SecondNumberTextBox TabIndex: 5 |
Select the first label (click) and textbox (CTRL) Copy (CTRL + C) and Paste (CTRL + V) Label: Adjust and Align |
Text: Result: |
Label: Adjust and Align |
AutoSize: False (do this first) Text: Delete label5 (Name): ResultLabel BackColor: Web: White BorderStyle: Fixed3D ForeColor: Web: Black |
Button: Adjust and Align |
Text: &Calculate (Access key: C) (Name): CalculateButton BackColor: Web: White ForeColor: Web: Black TabIndex: 8 |
Copy and Paste Button: Adjust and Align |
Text: Clear &Some (Access key: S) (Name): ClearSomeButton TabIndex: 9 |
Copy and Paste Button: Adjust and Align |
Text: Clear &All (Access key: A) (Name): ClearAllButton TabIndex: 10 |
Copy and Paste Button: Adjust and Align |
Text: E&xit (Access key: x) (Name): ExitButton TabIndex: 11 |
Select the four buttons and Format: Make Same Size: Both ![]() |
A ComboBox
is a combination of a TextBox and a ListBox.
(https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.combobox?view=net-5.0)
It enables the user to select items from the a list or enter a new value.
It is an object of the ComboBox class.
There are several properties of the ComboBox.
We shall discuss only one property in this module: the SelectedIndex
property.
The SelectedIndex property gets or sets the index of a selected item.
The ComboBox items are zero-indexed just like arrays.
This means that the first item has index: $0$, the second item has index $1$, and the third item has index $2$ among others.
The command used to specify a selected item in the ComboBox is: ComboBox.SelectedIndex == Index
Based on the items in the ComboBox in our program:
ComboBox Items | Index |
---|---|
Addition (+) [2 numbers] | $0$ |
Subtraction (-) [2 numbers] | $1$ |
Multiplication (*) [2 numbers] | $2$ |
Division (÷) [2 numbers] | $3$ |
Modulo (mod) [2 numbers] | $4$ |
Exponent (xⁿ) [2 numbers: x is the base; n is the exponent] | $5$ |
$Log_{x}n$ [2 numbers: x is the base; n is the number] | $6$ |
nth Root of x [2 numbers: x is the radicand; n is the index] | $7$ |
Reciprocal (1/x) [1 number] | $8$ |
Percent (%) [1 number] | $9$ |
Absolute Value (|x|) [1 number] | $10$ |
n! [1 number] | $11$ |
Tangent in DEG (tan) [1 number] | $12$ |
Sine in RAD (sin) [1 number] | $13$ |
Cosine in GRAD (cos) [1 number] | $14$ |
(1.) Double-click the Calculate button in the Design window.
This leads to the Code window
Scroll a little bit to the top, write the comments, and begin to...
(2.) Write the code.
What should happen when the user clicks the Calculate button?
Please review the screenshots.
Review the comments.
Design Area
Access keys: C for the Calculate, A for the Clear All, S for the Clear Some and
x for the Exit buttons
Program Code
Another approach to clearing texts in the Textbox is to use the Clear() method. For example: Textbox.Clear()
To clear all the items in a ComboBox besides the selected item, we also use the Clear() method.
For example: ComboBox.Items.Clear()
To clear the selected item in a ComboBox, we use the command: ComboBox.ResetText()
Student: Mr. C, you used the same name variable: result for different events.
Is that allowed?
Teacher: Very good observation.
Yes, we can do that.
Here is the reason: we used it within each event (each conditional statement).
We defined it as a class member variable. But remember we did not specify any value for it.
Hence, we are free to use it as local variables.
But you are very welcome to use different variables for the different events if you choose.
Notice that we did not have issues with the variables we defined in the class such as firstNumber
We can use those variables anywhere within the class.
Student: Another question.
You did not convert the variable: result back to a string. It is a double...right?
I thought we were supposed to convert it back to a string to display it in the label because the label accepts only
strings just like the textbox. Is that correct?
Teacher: That is correct.
We are supposed to convert it back to a string in order to display it in the label.
However, the String Interpolation takes care of that.
That is one of the several benefits of using String Interpolation in the formatting of the output.
Notice I have been using it since we discussed it in Module 1
Student: I guess those whitespaces are to format the display of the result?
Teacher: That is correct.
Run the Program
(1.) Visit my website on Numbers
(www.numbersandnotations.appspot.com/numbers.html)
Choose any applicable question and write a VB program to solve it.
Please make sure that the output of your program gives the same result as the solution of the
question on my website.
You may use Arithmetic Operators, Math Functions, or both.
(2.) Visit my website on Percent Applications
(www.fractions-decimals-percents.appspot.com/percentApplications.html)
Choose any applicable question and write a VB program to solve it.
Please make sure that the output of your program gives the same result as the solution of the
question on my website.
You may use Arithmetic Operators, Math Functions, or both.
(3.) Program to determine your age
***Because your age is a PII (Personal Identifiable Information), you may use a fictitious age.
However, you need to test it (privately) with your actual age to make sure it works.***
Develop a VB program to determine your age based on these instructions.
ONLY one variable must be used.
(Hint: If only one variable must be used, this implies that you need to use Compound
Assignment operators)
The user wants you to note that these instructions would only work for ages determined this
year, and wants you
to specify it in the program.
(a.) Pick an integer between $0$ and $10$ ($0$ and $10$ exclusive).
(b.) Multiply the integer by two.
(c.) Add five to the result.
(d.) Multiply the result by fifty.
(e.) If you already had your birthday this year, add the result to one thousand, seven hundred
and seventy one.
If you have not had your birthday this year, add the result to one thousand, seven hundred
and seventy.
(f.) Subtract your four digit birth year from the result.
Run the code and display the output.
Explain your result.
(4.) A client wants you to develop a program to calculate the age of his child.
The instructions for the previous question still applies to this question.
However, in this case; the program will give the instructions to the child, and the child will
respond.
This program is an Input/Output program.
Develop a VB program for this child.
(5.) Program to determine your date of birth.
***Because your date of birth is a PII (Personal Identifiable Information), you may use a
fictitious age. However, you need to test it (privately) with your actual age to make sure it
works.
Develop a VB program to determine your date of birth based on these instructions.***
ONLY one variable must be used.
(Hint: If only one variable must be used, this implies that you need to use Compound
Assignment operators).
(a.) Pick the integer that is your month of birth.
(b.) Multiply the integer by two hundred.
(c.) Add three hundred and eighty two to the result.
(d.) Divide the result by two.
(e.) Add your day of birth to the result.
(f.) Multiply the result by 100.
(g.) Add thirteen thousand, eight hundred and forty to the result.
(h.) Add the last two digits of your year of birth to the result.
(i.) Subtract thirty two thousand, nine hundred and forty from the result.
Run the code and display the output.
Explain your result.
(6.) A client wants you to develop a program to calculate the date of birth of her child.
The instructions for the previous question still applies to this question.
However, in this case; the program will give the instructions to the child, and the child will
respond.
This program is an Input/Output program.
Develop a VB program for this child.
(7.) Develop a Body Mass Index (BMI) desktop application using the United States System.
Test each condition just like we did in our example for the United States System.
Address user-input errors.
(8.) Develop a Body Mass Index (BMI) console application using the International System.
The formula is on the screenshot.
Test each condition just like we did in our example for the United States System.
Address user-input errors.
(9.) Develop a Body Mass Index (BMI) desktop application using the International System.
The formula is on the screenshot.
Test each condition just like we did for the United States System.
Address user-input errors.
Questions (10.) and (11.) are meant to prepare you for the Midterm Project.
For Questions (10.) and (11.)
Develop a VB program that meets these requirements.
(I.) Consider any concept/scenario that uses conditional statements.
It will be great if you find a real-world application. However, you can make up your own.
If you decide to make up your own, please explain the scenario and the conditions well.
If you use a real-world application, please cite your source(s) accordingly. Explain the scenario and the conditions well.
Use at least two (two or more) different conditions.
The BMI Calculator has four different conditions.
But, please use any application that has at least two different conditions.
(II.) Accept user input(s).
(III.) Address user input errors.
(IV.) Test your program and display the result/output for each condition.
(V.) Test your program for user-input errors.
(VI.) Submit all the screenshots accordingly.
(10.) Develop a console application for your concept.
(11.) Develop a desktop application for your concept.
For those who do not mind messing around with several languages at the same time
Student: Excuse me, Mr. C
This course is only for VB.NET
What do you mean?
Teacher: You are correct.
But, these subsequent questions are not for everyone.
That is the reason I am putting them at the end.
I have a question for you.
Have you ever seen any IT/Computer Science position that requires the knowledge of only one programming language?
Student: I have not checked, Sir.
Teacher: If you intend to be in the IT/Programming field for the long run, at least four (four or more)
languages are required.
If you look for IT positions at Indeed.com or other career/job websites, you will realize what I mean.
Search for visual basic programmer, you might be surprised that even for entry level positions
for a Visual Basic Programmer; they require you to have a working knowledge of several other programming languages.
Mr. C is preparing you for that...if you intend to work in the programming field for a long time.
Besides, this is a critical thinking approach.
I am required to develop and promote critical thinking questions for my students.
A programmer is basically a problem-solver irrespective of the programming language used to solve the problem.
Yes, we are working with Visual Basic.
However, if you find out that C# would be better in solving a particular problem in your workplace,
then you need to use C# unless your employer says otherwise.
The knowledge of several languages is a good asset. It makes you highly valuable.
Further, anyone who attempts any of the subsequent questions will still have to write the program in VB and get the same
result.
The questions and solutions are in another language.
But the student will have to write the program in VB and come up with the same solution. So, we are still on track.
It is critical thinking...multiple approaches to solving a question.
Be it as it may, these subsequent questions are not required.
It is okay even if you do not look at them. 😊
C# Programming Exercises, Practice, Solution by W3Resource
Please review:
(A.) C# Basic Declarations and Expressions : Exercises, Practice, Solution
(B.) C# Basic Algorithm: Exercises, Practice, Solution
(C.) C# Data Types : Exercises, Practice, Solution
You are provided with the Questions and the Solutions.
No more than one student may do any specific question.
(12.) Please focus only on Questions that deals with Numbers and Operators.
Write the Question as a comment in your program. Include the Title and the Question Number.
Write the program in VB
Run the program. Please make sure your program output is the same solution
Submit clear screenshots.
Java Programming Exercises, Practice, Solution by W3Resource
Please review:
(A.) Java Math: Exercises, Practice, Solution
(B.) Java Basic Programming - Part 1: Exercises, Practice, Solution
(C.) Java Basic Programming - Part 2: Exercises, Practice, Solution
(D.) Java Data Types: Exercises, Practice, Solution
You are provided with the Questions and the Solutions.
No more than one student may do any specific question.
(13.) Please focus only on Questions that deals with Numbers and Operators.
Write the Question as a comment in your program. Include the Title and the Question Number.
Write the program in VB
Run the program. Please make sure your program output is the same solution
Submit clear screenshots.
C++ Programming Exercises, Practice, Solution by W3Resource
Please review:
(A.) C++ Basic: Exercises, Practice, Solution
(B.) C++ Basic Algorithm: Exercises, Practice, Solution
(C.) C++ Math: Exercises, Practice, Solution
(D.) C++ Numbers: Exercises, Practice, Solution
You are provided with the Questions and the Solutions.
No more than one student may do any specific question.
(14.) Please focus only on Questions that deals with Numbers and Operators.
Write the Question as a comment in your program. Include the Title and the Question Number.
Write the program in VB
Run the program. Please make sure your program output is the same solution
Submit clear screenshots.
(1.) Provide any of these if it is lacking in any DB post that solved any question in the
Assess tab of this module: Well-written comments; another approach/method to solving the
question; any additional relevant details; etc.
For Questions $(3.)$ and $(4.)$ in the Substantive Posts
Student: Mr. C, the instructions in Questions (3.) and (4.) are incorrect.
The result is not my age.
How can you ask us to write a program that does not work?
(2.) Explain the result to the Student. (Answer this question only if any of your colleagues made a similar statement in the initial post.)
(3.) The Student wants only his/her age to be the result.
Without modifying any of the instructions (but using all of them) and one more instruction, extend the
program to display only the Student's age.
What is the extra instruction that you would include to work for all ages?
Write it. Run it. Submit clear screenshot(s).
For Questions $(5.)$ and $(6.)$ in the Substantive Posts
Student: Mr. C, I want the date of birth to display properly.
Teacher: Use a delimiter.
Student: What is a delimiter?
Teacher: A delimiter is a sequence of chararcters that specifies limits/boundaries of
characters in a text, expression, word, etc.
A good example is the forward slash that you can use to separate that DOB in the form of: mm/dd/yyyy.
The forward slash is a delimiter.
Another example is the pipe delimiter: mm | dd | yyyy.
Another example is the hyphen delimiter: mm-dd-yyyy.
Student: Okay, how do I display the result in that format?
(4.) Explain how you would display the result for the Student.
Write the code. Run it. Submit clear screenshot(s).
(5.) Other substantive responses.
This is the desktop application of the Standard Calculator
(1.) Please review the Functionalities of the Calculator and the Limitations of the Calculator as explained in
the Learn tab.
Maintain all the functionalities of the calculator.
Address any or all the limitations.
Submit some clear screenshots that maintains the functionalities.
Submit clear screenshots that addressed the limitations.
You may use my code if you wish (in this case because you are extending the functionlities of my program) and/or your code.
(2.) The first standard calculator we programmed did not contain all the functions.
This is what we did.
This is what you should do.
Develop a calculator that contains all the functions enclosed with a red border besides the plus-minus button: $+/-$
In other words, the plus-minus button is not required.
However, all other functions enclosed within the red border are required.
Please note:
The C function is the Clear function. It deletes everything.
It clears the first number, operation, and the second number.
The CE function is the Clear Entries function. It deletes "some" things.
It clears only the second number. You can replace the second number and continue with the calculation.
It does not clear everything.
This is used when the entire calculation does not need to be deleted.
The BS (backspace) function (you may use alt+174 key if you prefer) is the backspace function.
It deletes part of the first number or the second number.
This is also used when the entire calculation does not need to be deleted.
Let us look at an example. You may test it.
$
\underline{Example} \\[3ex]
25 + 32 \\[3ex]
\color{red}{C} \;\; deletes\;\;everything \\[3ex]
\color{red}{CE} \;\; deletes\;\;only\;\;32 \\[3ex]
\color{red}{BS} \;\; deletes\;\;only\;\;2 \\[3ex]
$
This is the desktop application of the Scientific Calculator
(3.) We developed the scientific calculator.
However, it does not contain all the functions.
Develop the scientific calculator GUI that contains all the functions.
You may extend my application by adding the missing functions if you wish, or you may develop your own with all the functions.
You may use my code if you wish (in this case because you are extending the functionlities of my program) and/or your code.
(4.) Develop a console application for an extension of the Body Mass Index (BMI) application example.
We did the application for the United States System (Customary System).
Extend the application by developing the calculator for the International System (Metric System).
The formula is on the screenshot.
Ask the user which system he/she wants to use to calculate the BMI.
Based on the user's selection, display the appropriate units for the weight and the height, as well as the output.
Test all the conditions for both systems.
(5.) Develop a desktop application for an extension of the Body Mass Index (BMI) application example.
We did the application for the United States System (Customary System).
Extend the application by developing the calculator for the International System (Metric System).
The formula is on the screenshot.
Ask the user which system he/she wants to use to calculate the BMI.
Your desktop application should have the dropdown list for both systems, but should be null be default.
Based on the user's selection, display the appropriate units for the weight and the height, as well as the output.
Test all the conditions for both systems.
Question (6.) is meant to prepare you for the Midterm Project.
Develop a VB program that meets these requirements.
(I.) Consider any concept/scenario that uses conditional statements.
A real-world application is required. You may not make up your own.
Please cite your source(s) accordingly. Explain the scenario and the conditions well.
Use at least two (two or more) different conditions.
The BMI Calculator has four different conditions.
But, please use any application that has at least two different conditions.
(II.) Accept user input(s).
(III.) Address user input errors.
(IV.) Test your program and display the result/output for each condition.
(V.) Test your program for user-input errors.
(VI.) Submit all the screenshots accordingly.
(6.) Develop a console application and a desktop application for your concept.
Textbook Questions: Desktop Applications
(7.) Question $10$ on Page $166$
(8.) Question $6$ on Page $177$
(9.) Question $8$ on Page $178$
(10.) Question $10$ on Page $178$
Students will:
(1.) Discuss the VB string data type.
(2.) Discuss the VB Boolean data type.
(3.) Discuss Date and Time in VB.
(4.) Write programs that involves the String data type.
(5.) Write programs that involves the Boolean data type.
(6.) Write programs that involves Date and Time.
(1.) Textbook Chapter
(2.)
(3.)
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type Visual Basic Strings and/or Visual Basic Booleans and/or Visual Basic Date and Time in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type Visual Basic Strings and/or Visual Basic Booleans and/or Visual Basic Date and Time in the search bar and view the results.
You may use strings not written in English language. However, if you use any language other than English language,
it is important you translate it. Your colleagues and I need to understand your code.
Insensitive words, or any words deemed inappropriate to any race, gender, religion are unacceptable. Any violation
will not yield any point.
If you are not sure of the words/string to use, please contact me first.
For those who do not mind messing around with several languages at the same time
Student: Excuse me, Mr. C
This course is only for VB.NET
What do you mean?
Teacher: You are correct.
But, these subsequent questions are not for everyone.
That is the reason I am putting them at the end.
I have a question for you.
Have you ever seen any IT/Computer Science position that requires the knowledge of only one programming language?
Student: I have not checked, Sir.
Teacher: If you intend to be in the IT/Programming field for the long run, at least four (four or more)
languages are required.
If you look for IT positions at Indeed.com or other career/job websites, you will realize what I mean.
Search for visual basic programmer, you might be surprised that even for entry level positions
for a Visual Basic Programmer; they require you to have a working knowledge of several other programming languages.
Mr. C is preparing you for that...if you intend to work in the programming field for a long time.
Besides, this is a critical thinking approach.
I am required to develop and promote critical thinking questions for my students.
A programmer is basically a problem-solver irrespective of the programming language used to solve the problem.
Yes, we are working with Visual Basic.
However, if you find out that C# would be better in solving a particular problem in your workplace,
then you need to use C# unless your employer says otherwise.
The knowledge of several languages is a good asset. It makes you highly valuable.
Further, anyone who attempts any of the subsequent questions will still have to write the program in VB and get the same
result.
The questions and solutions are in another language.
But the student will have to write the program in VB and come up with the same solution. So, we are still on track.
It is critical thinking...multiple approaches to solving a question.
Be it as it may, these subsequent questions are not required.
It is okay even if you do not look at them. 😊
C# Programming Exercises, Practice, Solution by W3Resource
Please review:
(A.) C# Strings : Exercises, Practice, Solution
(B.) C# Date and Time: Exercises, Practice, Solution
You are provided with the Questions and the Solutions.
No more than one student may do any specific question.
(12.) Write the Question as a comment in your program. Include the Title and the Question Number.
Write the program in VB
Run the program. Please make sure your program output is the same solution
Submit clear screenshots.
Java Programming Exercises, Practice, Solution by W3Resource
Please review:
(A.) Java Strings: Exercises, Practice, Solution
(B.) Java Date and Time: Exercises, Practice, Solution
You are provided with the Questions and the Solutions.
No more than one student may do any specific question.
(13.) Write the Question as a comment in your program. Include the Title and the Question Number.
Write the program in VB
Run the program. Please make sure your program output is the same solution
Submit clear screenshots.
C++ Programming Exercises, Practice, Solution by W3Resource
Please review:
(A.) C++ Strings: Exercises, Practice, Solution
You are provided with the Questions and the Solutions.
No more than one student may do any specific question.
(14.) Write the Question as a comment in your program. Include the Title and the Question Number.
Write the program in VB
Run the program. Please make sure your program output is the same solution
Submit clear screenshots.
Review the post of your colleague.
Use a different string method to work on the same string used by your colleague.
You may use strings not written in English language. However, if you use any language other than English language,
it is important you translate it. Your colleagues and I need to understand your code.
Insensitive words, or any words deemed inappropriate to any race, gender, religion are unacceptable. Any violation
will not yield any point.
If you are not sure of the words/string to use, please contact me first.
(1.) We are yet to do Statements (in the next Module), but you can give this question a try.
A string palindrome is a word, phrase, clause or sequence of characters that is
spelled and read the same way backward and forward.
In other words, when one reads it as is, reverses it and reads it again; the pronunciation is the same.
Examples include the:
Words: HANNAH, BOB, madam, level, civic, racecar, rotor
Phrase: never odd or even
Clause: nurses run
Sentence: Was it a car or a cat I saw?
Write a VB program that asks for user input.
Determine if the user input is a string.
If the user input is not a string, ask the user to enter only a string.
If the user input is a string, determine if it is a string palindrome.
Inform the user whether it a string palindrome or not.
Test all conditions.
Submit clear screenshots of the code and the results.
(1.) Textbook Chapter
(2.)
(3.)
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type Visual Basic Statements and/or Visual Basic Conditional Statements in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type Visual Basic Statements and/or Visual Basic Conditional Statements in the search bar and view the results.
The midterm project is designed to assess your knowledge of Statements in solving real-world problems.
It is a Piecewise Function application.
Any other application will not considered.
Please:
(1.) Visit my website on: Piecewise Functions
(2.) Read the Story to understand the idea of Piecewise functions.
(3.) Read the Overview of Piecewise Functions for more understanding of Piecewise
functions.
(4.) Study the Applications of Piecewise Functions
(5.) Review the Project Examples. Ensure you follow all the instructions and directions.
(6.) Complete the Midterm Project for your course.
(7.) Ask questions. I can advise.
(8.) Upload your draft project (clear screenshots of all your Math work and the .exe file) in the Midterm Project Drafts forum of the course on Blackboard.
I shall review and provide feedback.
You may also submit your draft to me via email. I shall review and provide feedback.
(9.) Upload your actual completed entire project (clear screenshots of all your Math work and the project with all the files) in the
Midterm Project course area of the course.
Please submit all these information as a zip file in the Midterm Project folder of the Blackboard course.
NOTE: Any actual project submitted to me via email will not be graded.
If you wish to save some time for research:
Please review the Piecewise Function projects done by my previous students.
The direct link of the verifiable websites are included.
(I.) VB.NET Projects
(II.) C# Projects
(III.) C++ Projects
(IV.) Java Projects
You may not do any same application done by any of my previous students for VB.NET
You may do any Piecewise Function application not done by any of my previous students for VB.NET
If you are not sure what project you may or may not do, please contact me via the school email.
(1.) Textbook Chapter
(2.)
(3.)
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type Visual Basic Methods in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type Visual Basic Methods in the search bar and view the results.
(1.)
(1.) Textbook Chapter
(2.)
(3.)
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type Visual Basic Array in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type Visual Basic Array in the search bar and view the results.
(1.)
Students will:
(1.)
(2.)
(1.) Textbook Chapter
(2.)
(3.)
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type Visual Basic Multidimensional Array in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type Visual Basic Multidimensional Array in the search bar and view the results.
(1.)
(1.)
There are two options for your Final Exam.
Please choose only one option.
Desktop Applications and/or Console Applications are required.
This exam is designed to assess your understanding of the Visual Basic language.
You have reviewed several topics and several concepts in each topic for eight modules.
Pick at least $1$ concept in at least $1$ topic in each of the $8$ modules.
That gives at least $8$ concepts in $8$ different topics in $8$ modules.
Find two more concepts in any topic in any module.
That gives $10$ concepts.
For each concept:
(1.) Write at least three sentences about that concept.
(2.) Develop a program about that concept.
In other words, write at least one code example about the concept.
Run the code.
Display the output.
Submit clear screenshots of your program (code and output)
Deliverables:
(1.) $10$ concepts in $10$ different topics for $8$ modules
Please write the: Module number, the Topic, and the Concept
(2.) Three sentences for each concept.
(3.) Code for each concept.
(4.) Output for each concept.
Please submit all these information as a zip file in the Final Exam folder of the Blackboard course.
You may include (1.) and (2.) as comments in your program.
This exam is designed to assess your understanding of the Visual Basic language.
There are two options for your Final Project.
Please choose only one option.
It is important you communicate with me for approval prior to doing this project.
The final project is designed to assess problem-solving skills using the knowledge you have acquired in the
course.
In that regard, solving at least a real-world problem using the knowledge gained in the course is expected.
(1.) Think about any of these companies: our Institution: Kent State University; your local campus; your work place; public and
private schools (excluding home schools); organizations, firms, and businesses
(excluding controversial firms and the like).
Any company you choose should have a verifiable website.
The direct link of the company's website is required.
(2.) Identify a problem on the website that you want to solve.
The problem must be solved by programming using the knowledge acquired from any of the course
topics/concepts/description/learning objectives.
Think about your Midterm Project. You solved a problem: calculating bills, federal taxes, etc.
(3.) Develop the computer program to solve the problem.
Test the program to ensure that it works.
Write detailed comments as applicable.
(4.) Prepare a Documentation Manual/Reflection for the project.
Please cite your sources accordingly.
What is the company?
What is their website?
What problem did you identify?
Did you solve the entire problem or part of the problem?
What course topics/concepts/description/learning objectives did you apply in solving the problem?
How did you solve the problem?
Did you encounter any issues while trying to solve the problem?
Are there any limitations to the project?
Are there any recommendations to the company?
Deliverables:
(1.) Program (all files)
(2.) Clear screenshots of your program (code and output)
(3.) Project Reflection/Documentation Manual
Please submit all these information as a zip file in the Final Project folder of the Blackboard course.
The final project is designed to assess your understanding and analysis of data using the knowledge you have
acquired in the course.
Please:
(1.) Visit my website on: Descriptive Statistics
(2.) Review the information for a good understanding of Descriptive Statistics.
It is highly likely that you have a prior knowledge of this topic. Is that right?
(3.) Click the Project link.
(4.) Review the Project Examples. Ensure you follow all the instructions and directions.
(5.) Complete the Final Project for your course.
(6.) Ask questions. I can advise.
(7.) Upload your draft project (clear screenshots of all your Math work and the .exe file)
in the Midterm Project Drafts forum of the course on Blackboard.
I shall review and provide feedback.
You may also submit your draft to me via email. I shall review and provide feedback.
(8.) Upload your actual completed entire project (clear screenshots of all your Math work
and the project with all the files) in the Midterm Project course area of the course.
Please submit all these information as a zip file in the Final Project folder of the Blackboard course.
NOTE: Any actual project submitted to me via email will not be graded.
Advanced concepts of Visual Basic: Classes and Objects, Inheritance, Polymorphism, Arrays, Exception Handling, Files and Streams, DLLs. Prerequisite: IT 11002 or CS 13001 or EMAT 15310 or CIS 24065.
By the end of this course, you should be able to do the following:
(1.) Develop multiuser LAN-based Windows applications.
(2.) Create and handle events.
(3.) Create and use class modules and assemblies.
(4.) Design, creation, instantiation, and use of components.
(5.) Deploy an application.
Students will:
(1.) Textbook Chapter
(2.)
(3.)
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type Object-oriented Programming in Visual Basic and/or OOP in VB in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type Object-oriented Programming in Visual Basic and/or OOP in VB in the search bar and view the results.
(1.) Textbook Chapter
(2.)
(3.)
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type to be given later or type the topic in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type to be given later or type the topic in the search bar and view the results.
(1.) Textbook Chapter
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type to be given later or type the topic in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type to be given later or type the topic in the search bar and view the results.
The midterm project is designed to assess your knowledge of Object-oriented Programming in solving real-world problems.
It is a Piecewise Function application.
Any other application will not considered.
Please:
(1.) Visit my website on: Piecewise Functions
(2.) Read the Story to understand the idea of Piecewise functions.
(3.) Read the Overview of Piecewise Functions for more understanding of Piecewise
functions.
(4.) Study the Applications of Piecewise Functions
(5.) Review the Project Examples. Ensure you follow all the instructions and directions.
(6.) Complete the Midterm Project for your course.
(7.) Ask questions. I can advise.
(8.) Upload your draft project (clear screenshots of all your Math work and the .exe file) in the Midterm Project Drafts forum of the course on Blackboard.
I shall review and provide feedback.
You may also submit your draft to me via email. I shall review and provide feedback.
(9.) Upload your actual completed entire project (clear screenshots of all your Math work and the project with all the files) in the
Midterm Project course area of the course.
NOTE: Any actual project submitted to me via email will not be graded.
If you wish to save some time for research:
Please review the Piecewise Function projects done by my previous students.
The direct link of the verifiable websites are included.
(I.) VB.NET Projects
(II.) C# Projects
(III.) C++ Projects
(IV.) Java Projects
You may not do any same application done by any of my previous students for VB.NET
You may do any Piecewise Function application not done by any of my previous students for VB.NET
If you are not sure what project you may or may not do, please contact me via the school email.
Students will:
(1.) Textbook Chapter
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type to be given later or type the topic> in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type to be given later or type the topic> in the search bar and view the results.
Each question in this tab is to be done by only one student.
You do not need to respond to the initial post of another student.
(1.)
Students will:
(1.) Textbook Chapter
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type to be given later or type the topic> in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type to be given later or type the topic> in the search bar and view the results.
Each question in this tab is to be done by only one student.
You do not need to respond to the initial post of another student.
(1.)
Students will:
(1.) Textbook Chapter
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type to be given later or type the topic> in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type to be given later or type the topic> in the search bar and view the results.
Each question in this tab is to be done by only one student.
You do not need to respond to the initial post of another student.
(1.)
Students will:
(1.) Textbook Chapter
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type to be given later or type the topic> in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type to be given later or type the topic> in the search bar and view the results.
Each question in this tab is to be done by only one student.
You do not need to respond to the initial post of another student.
(1.)
Students will:
(1.) Textbook Chapter
Videos:
Please click the RESOURCES tab of this website
Click the LinkedIn Learning (Kent State University) link
Follow the directions to access the website.
(4.) Type to be given later or type the topic> in the search bar and view the results.
Videos and Textbooks:
Please click the RESOURCES tab of this website
Click the Safari Books Online link
Follow the directions to access the website.
(5.) Type to be given later or type the topic> in the search bar and view the results.
Each question in this tab is to be done by only one student.
You do not need to respond to the initial post of another student.
(1.)
There are two options for your Final Exam.
Please choose only one option.
This exam is designed to assess your understanding of the Visual Basic language.
You have reviewed several topics and several concepts in each topic for eight modules.
Pick at least $1$ concept in at least $1$ topic in each of the $8$ modules.
That gives at least $8$ concepts in $8$ different topics in $8$ modules.
Find two more concepts in any topic in any module.
That gives $10$ concepts.
For each concept:
(1.) Write at least three sentences about that concept.
(2.) Develop a program about that concept.
In other words, write at least one code example about the concept.
Run the code.
Display the output.
Submit clear screenshots of your program (code and output)
Deliverables:
(1.) $10$ concepts in $10$ different topics for $8$ modules
Please write the: Module number, the Topic, and the Concept
(2.) Three sentences for each concept.
(3.) Code for each concept.
(4.) Output for each concept.
Please submit all these information as a zip file in the Final Exam folder of the Blackboard course.
This exam is designed to assess your understanding of the Visual Basic language.
Please review all the questions and answers of the
Advanced Placement (AP) Computer Science Exams
Student: Mr. C, you are giving us a final exam with the answers?
How nice of you?
Teacher: Yes of course, I am nice. 😊
But, please read on.
First-come, first-served basis
A particular question may NOT be done by more than one student.
In other words, no two or more students are permitted to do the same question.
Please:
(1.) Pick any five questions from any of the years.
(2.) Go to the Final Exam Questions forum of the Blackboard course.
(3.) Write the year and the question numbers in that forum only if it has not been written by any other student.
In other words, you need to review any year and questions posted by your colleagues and make sure that you do not attempt
the same question.
For each question:
(4.) Write it or take clear screenshots.
(5.) Develop the Visual Basic program for the solution.
The answers are already provided for you.
However, please write detailed comments in your program that explains the solution.
(6.) Run the program.
Submit clear screenshots of the code and results.
(7.) Submit clear screenshots of the: numbered questions, the Visual Basic program (including comments) of the solutions,
and the results of the five questions in the Final Exam folder of the Blackboard course.
(8.) Make your work easy for me to grade.
In other words, write detailed clear specific explanations.
Do not give me any avenue to deduct points.
For example:
First Task: Notify your colleagues of the questions you intend to do.
In the Final Exam Questions forum of the Blackboard course: you may write:
Hey guys, I am doing $2006$ Question ($2$.), $2010$ Question ($3$.), ... etc.
Second Task: Do the questions.
(1.) $2006$ Question (2.)
Write the question or take screenshots of the question.
Develop the Visual Basic program. Write detailed comments.
Run the program.
Submit clear screenshots of the code and results.
(2.) $2010$ Question (3.)
Write the question or take screenshots of the question.
Develop the Visual Basic program. Write detailed comments.
Run the program.
Submit clear screenshots of the code and results.
Third Task: Submit all deliverables.
Submit clear screenshots of the: numbered questions, the Visual Basic program (including comments) of the solutions,
and the results of the five questions in the Final Exam folder of the Blackboard course.
Should you have any questions, please let me know.
Thank you.
You are not allowed to do any of the questions in these Samples.
Please find your own set of questions.
(1.) Option $2$: Sample 1
There are two options for your Final Project.
Please choose only one option.
It is important you communicate with me for approval prior to doing this project.
The final project is designed to assess problem-solving skills using the knowledge you have acquired in the
course.
In that regard, solving at least a real-world problem using the knowledge gained in the course is expected.
(1.) Think about any of these companies: our Institution: Kent State University; your local campus; your work place; public and
private schools (excluding home schools); organizations, firms, and businesses
(excluding controversial firms and the like).
Any company you choose should have a verifiable website.
The direct link of the company's website is required.
(2.) Identify a problem on the website that you want to solve.
The problem must be solved by programming using the knowledge acquired from any of the course
topics/concepts/description/learning objectives.
Think about your Midterm Project. You solved a problem: calculating bills, federal taxes, etc.
(3.) Develop the computer program to solve the problem.
Test the program to ensure that it works.
Write detailed comments as applicable.
(4.) Prepare a Documentation Manual/Reflection for the project.
Please cite your sources accordingly.
What is the company?
What is their website?
What problem did you identify?
Did you solve the entire problem or part of the problem?
What course topics/concepts/description/learning objectives did you apply in solving the problem?
How did you solve the problem?
Did you encounter any issues while trying to solve the problem?
Are there any limitations to the project?
Are there any recommendations to the company?
Deliverables:
(1.) Program (all files)
(2.) Clear screenshots of your program (code and output)
(3.) Project Reflection/Documentation Manual
Please submit all these information as a zip file in the Final Project folder of the Blackboard course.
The final project is designed to assess your understanding and analysis of data using the knowledge you have
acquired in the course.
Please:
(1.) Visit my website on: Descriptive Statistics
(2.) Review the information for a good understanding of Descriptive Statistics.
It is highly likely that you have a prior knowledge of this topic. Is that right?
(3.) Click the Project link.
(4.) Review the Project Examples. Ensure you follow all the instructions and directions.
(5.) Complete the Final Project for your course.
(6.) Ask questions. I can advise.
(7.) Upload your draft project (clear screenshots of all your Math work and the .exe file)
in the Midterm Project Drafts forum of the course on Blackboard.
I shall review and provide feedback.
You may also submit your draft to me via email. I shall review and provide feedback.
(8.) Upload your actual completed entire project (clear screenshots of all your Math work
and the project with all the files) in the Midterm Project course area of the course.
Please submit all these information as a zip file in the Final Project folder of the Blackboard course.
NOTE: Any actual project submitted to me via email will not be graded.
Dear Students,
Greetings to you.
As you evaluate me and my teaching style on the Blackboard course, I ask that you consider these questions
in addition to the survey questions.
Thank you for giving me the opportunity to teach the course.
It was nice working with you.
I wish you the best in your academic profession.
Thank you!
Samuel Dominic Chukwuemeka (SamDom For Peace)
B.Eng., A.A.T, M.Ed., M.S
Working together for success
Grading Method: Grading Method
Classroom/Learning Environment: Blackboard course management system.
Course Assessments: Discussion Board (DB) assignments, Midterm Project, Final Project and the Final Exam
Direct forms of communication: live office hours/tutoring sessions, emails, comments to your DB posts and responses and
phone calls.
Indirect forms of communication: course announcements, websites (notes, videos, etc).
Course Contents
Please review the Course Description and Student Learning Outcomes
It is the first link in your course.
Those are the basic topics that KSU require that I teach.
(1.) Did I cover those topics?
(2.) Did I cover other necessary topics that is relevant for you to succeed in your profession?
(3.) Did the assessments demonstrate the application of the topics?
(4.) Did the assessments demonstrate the application of the topics required for your profession?
(5.) Did the contents and assessments demonstrate important skills such as critical thinking, use of technology,
creativity, and organization among others?
Teaching and Learning
(6.) Did you acquire any knowledge from me?
(7.) Did you acquire sufficient knowledge, or more than sufficient knowledge from me?
(8.) Did you acquire any knowledge from any of your colleagues because of how the course was set up?
(9.) Did you acquire sufficient knowledge, or more than sufficient knowledge from any of your colleagues because of
how the course was set up?
(10.) Did I provide effective feedback for any of your assessments?
(11.) Did you acquire any knowledge based on that feedback?
(12.) Did the feedback help you improve in any way?
(13.) Did you have enough support to ensure the successful completion of the course?
Were your questions answered?
Did you have enough resources/learning aids?
(14.) Did I provide a safe and conducive environment for learning?
(15.) Was the Grading Method fair?
Pacing Guide
(16.) Were you given enough time to learn the contents?
(17.) Were you given enough time to complete the assessments?
Professionalism
(18.) In all our communication (both direct and indirect), did I act professionally?
(19.) In all our communication (both direct and indirect), did I use a respectful tone?
(20.) What do you like or dislike about our communication?
Personality
(21.) Based on your experience with me (taking the course with me and communicating with me among others), how
would you describe my person?
Do I give a lot of work?
Do I give a lot of explanations?
Do I have a lot of expectations for my students?
Do I really want you to learn?
Do I really want you to succeed?
Do I ask a lot of questions?
Do I answer questions with questions sometimes?
In those times, please note that it is a teaching technique.
It is never meant to disrespect you. I do not disrespect my students. I respect them.
It is a technique to guide you to review directions/concepts, and explain what you do not understand.
Would you take another course with me? Why or why not?
Did your views/perception about me affect you in completing this course successfully or unsuccessfully?
Need a programmer for personal/professional/commercial projects?
Look no further. Any of my available students (not just the ones listed here) can help.
Just head on to the Division of Student Affairs, Kent State University
or contact me here or via my school email address.
These are nice projects (Console Applications) done by my students.
Some of them are Midterm Projects while some are Final Projects.
Because of FERPA (Federal Educational Rights and Privacy Act) laws, only the first names of my students are
written.
(1.)
(1.)
Visual Basic Tutorials by Microsoft (Free)
Visual Basic Documentation
Visual Basic Developer Community
American Standard Code for Information Exchange (ASCII) Characters
Sorting Techniques and Algorithms
LinkedIn Learning (Kent State University)
Safari Books Online
For Kent State University students, Select your Institution > Choose “Not Listed?
Click here.”
Enter your Kent State University email address and click Let’s Go
Visual Basic Notes for Professionals: Stack Overflow Documentation (Free)
Wikibooks: Visual Basic (Free)
Stack Overflow: Question and Answer Forum for Computer Science
Lynda.com/LinkedIn Learning (Start for Free. Then, not free)
Chukwuemeka, S.D (2016, April 30). Samuel Chukwuemeka Tutorials - Math, Science, and Technology.
Retrieved from https://www.samuelchukwuemeka.com
Free Visual Basic .NET Book. (n.d.). Books.Goalkicker.com. Retrieved January 16, 2021, from https://books.goalkicker.com/VisualBasic_NETBook/
KathleenDollard. (2018, March 28). Visual Basic. Microsoft.com. https://docs.microsoft.com/en-us/dotnet/visual-basic/
Zak, D. (2016). Programming with Microsoft Visual Basic 2015. Cengage Learning.