Visual Basic .net is an excellent programming language. Beginners can appreciate it’s English-like syntax, and more advanced programmers can appreciate its vast libraries and flexibility. It’s part of the .Net family of languages, and as such, it allows you to program some truly amazing solutions. So, congratulations on choosing to learn this amazing language. :-)
As it is common among beginner programmers, the enthusiasm to learn often is not enough to make the leap from beginner to intermediate.
The bad news is: code fear is real, and it hinders, or even stops your progress.
The good news is: you can learn to eliminate it! And all it takes is a little practice and determination. And that’s where this course will help you greatly!
The course goes over Visual Basic programming projects from a popular college Visual Basic textbook: "Introduction to Programming Using Visual Basic" by David Schneider. I show you how to put the theory you learned into practice by showing you how to solve each exercise and walking you through all the Why’s and How’s.
You and I will go on a journey to program simple solutions, such as a Calculator, all the way to complex solutions such as Bank Account and Black Jack simulator.
In the process, you will learn the ins and outs of Visual Basic language. You will learn how to translate the project requirements into a working code. You will learn to use many different programming concepts, such as Conditional Statements, Loops, Arrays, Multi-dimensional arrays, LINQ, OOP, databases… and pick the right one for your solution. But above all, you will learn to think like a programmer!
This course is all about practice. Therefore, to benefit from this course, you need to be an active student. It doesn't matter if you are self-taught or attend a programming course. What matters is the time and effort you are willing to put into learning and practicing your skills.
There are no lectures in this course. However, I do my best to explain what I am trying to accomplish with each line of code, and touch on common pitfalls, too.
This is a course for beginner VB .net programmers who need to put the concepts and theory they learned into practice and for people who prefer to learn by doing.
If that's you, then let's start coding!
Write a program that allows the user to specify two numbers and then adds, subtracts, or multiplies them when the user clicks on the appropriate button.
The output should give the type of arithmetic performed and the result.
When one of the numbers in an input text box is changed, the output text box should be cleared.
Suppose automobile repair customers are billed the rate of $35 per hour for labor. Also, suppose costs for parts and supplies are subject to a 5% sales tax.
Write a program to display a simplified bill. The customer's name, the number of hours of labor, and the cost of parts and supplies should be entered into the program via text boxes.
When a button is clicked, the customer's name and the three costs should be displayed in a list box.
Write a program to make change for an amount of money from 0 through 99 cents input by the user. The output of the program should show the number of coins from each denomination used to make change.
Write a program to convert a U.S. Customary System length in miles, feet, and inches to a Metric System length in kilometers, meters, and centimeters.
After the numbers of miles, yards, feet, and inches are read from the text boxes, the length should be converted entirely to inches, and then divided by 39.37 to obtain the value in meters. The Int function should be used to break the total number of meters into a whole number of kilometers and meters. The number of centimeters should be displayed to one decimal place.
If dollars are borrowed at r % interest compounded monthly to purchase a car with monthly payments for n years, then the monthly payment is given by a special financial formula.
Write a program that calculates the monthly payment after the user gives the amount of the loan, interest rate, and number of years.
Write a program that requests the price and weight of an item in pounds and ounces, and then determines the price per ounce.
Write a program that displays rental table in a list box, and an invoice in another list box, when appropriate button is clicked.
The bill should include a $30 deposit.
Write a program that requests the name of the food, number of calories per serving, and the grams of fat per serving as input; and tells whether the food meets the American Heart Association (AHA) recommendation.
NOTE: AHA recommends at most 30% of calories to come from fat
NOTE: 1 gram of fat contains 9 calories
Write a program to analyze a car loan. The user should enter the amount of the loan, the annual percentage rate of interest, and the duration of the loan in months. When the user clicks on the button, the information that was entered should be checked to make sure it’s reasonable. If bad data has been supplied, the user should be advised. Otherwise, monthly payments and total amount of interest paid should be displayed.
Write a program to determine the real roots of the quadratic equation
Before finding the roots, ensure that ‘a’ is a non-zero value
NOTE: the operation has 2, 1, or 0 solutions depending on whether the value of b^2 – 4*a*c is positive, zero, or negative.
Example: a = 1, b = -11, c = 28; Solutions = 7 and 4
Write a program to place an order from the restaurant menu. Group the menu and make each group box invisible, and becomes visible only when its corresponding check box is checked. After the button is clicked, the cost of the meal should be displayed.
NOTE: The checked property of the radio button in each group should be set to True. This guarantees that a selection is made in each visible group box.
The admissions offices of colleges often rely on point system. Write a program that allows an admissions officer to determine whether an applicant should be admitted.
Program should calculate the total score and then admit an applicant with score of 100 or more
Write a program to calculate a student's GPA. The user should enter the grade (A, B, C, D, or F) and the number of credit hours for a course, and then click on the 'Record This Course' button.
The user should then repeat this process for all the student's courses. After all the courses have been recorder, the user should click on the 'Calculate GPA' button. A function procedure should be used to calculate the quality points for a course.
Write a program to compute customer's bill. The vendor sells pizza slices for $1.75, fries for $2.00 and soft drinks for $1.25. The program should request the quantity of each item, ordered in a Sub procedure, calculate the total cost with a Function procedure and use Sub procedure to display an itemized bill.
A furniture manufacturer makes two types of furniture: chairs and sofas. The price per chair is $350 and price per sofa is $925. Sales tax is 5%.
Write a program that creates an invoice for an order. After the data has been entered, the user can display an invoice in a list box by pressing the "Process Order" button. The user can click on the "Clear Order Form" button to clear all text boxes and the list box, and click on the Quit button to exit the program.
The invoice number consists of the capitalized first two letters of the customer's last name, followed by the last four digits of the zip code. The customer name is input with the last name first, followed by a comma, a space, and the first name. However, the name is displayed on the invoice in the proper order (first name, last name). The generation of the invoice number and the reordering of the first and last names should be carried out by Function procedures.
Write a program that presents 7 proverbs, one at a time, and asks the user to evaluate them as true or false. The program should then tell the user how many questions were answered correctly and display one of the following evaluations:
Perfect (all correct)
Excellent (5 or 6 correct) You might consider taking Psychology 101 (less than 5 correct)
Write a program that allows the user to challenge the computer to a game of Pick Up Sticks.
The user chooses the number of matchsticks from 5-50 to place in pile. Then, the computer chooses who will go first.
At each turn, the contestant can remove 1, 2, or 3 matchsticks from the pile. The contestant who removes the last matchstick loses.
The computer should make the user always select from the pile where the number of matchsticks has a remainder of 1 when divided by 4.
For instance, if the user initially chooses a number of matchsticks that has a reminder of 1 when divided by 4, then the computer should have the user go first. Otherwise, the computer should go first and remove the proper number of matchsticks.
NOTE: The remainder when n is divided by 4 is n Mod 4. After writing the program, play a few games and observe that the computer always wins.
Write a program in which user specifies a value to calculate, enters three other values, and clicks on the Calculate button. Before any calculations are made, the program should use a function to validate that radio button is checked and that the values entered into the three text boxes corresponding to unchecked radio buttons are valid
After caffeine is absorbed into the body, 13% is eliminated from the body each hour. Assume a person drinks 8-oz cup of coffee containing 130mg of caffeine, and caffeine is absorbed immediately into the body. Write a program to calculate the following:
1.The number of hours required until 65 mg (one half the original amount) remains in body
2.The amount of caffeine in the body 24 hours after the person drinks the coffee
3.Suppose the person drinks a cup of coffee at 7a.m. and then drinks a cup of coffee at the end of each hour until 7a.m. the next day. How much caffeine will be in the body at the end of the 24 hours?
The rule is used to approximate the time required for prices to double due to inflation. If the inflation rate is r%, then the Rule of 72 estimates that prices will double in 72/r years. For instance, at an inflation of 6%, prices double in about 72/6 or 12 years. Write a program to test the accuracy of this rule. For each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate.
Assume prices increase at the end of each year.
Write a program to provide information on the height of a ball thrown straight up into the air. The program should request as input the initial height in feet, and the initial velocity (feet per second).
1.Determine the maximum height of the ball. NOTE: the ball will reach its maximum height after v/32
2.Determine approximately when the ball will hit the ground. HINT: Calculate the height after every 0.1 second and determine when the height is no longer a positive number
3.Display a table showing the height of the ball every quarter second for 5 seconds or until it hits the ground.
For tax purposes an item may be depreciated over a period of several years. (n). With the straight-line depreciation, each year the item depreciates by 1/nth of its value. With double-declining-balance method of depreciation, each year the item depreciates by 2/n of its value at the beginning of that year. (In its final year, it is depreciated by it’s value at the beginning of the year). Write a program that performs the following:
1.Requests a description of the item, the year of purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation. The method of depreciation should be chosen by clicking on one of the two buttons
Display a year-by-year description of the depreciation
The following words have 3 consecutive letters that are also consecutive letters in the alphabet. THIRSTY, AFGHANISTAN, STUDENT. Write a program that accepts a word as input and determines whether or not it has three consecutive letters that are also consecutive letters in the alphabet. The program should use a
Boolean-valued function named IsTrippleConsecutive that accepts an entire word as input. HINT: Use Asc function.
Write a program that does the following:
1.Asks the user to input a sentence containing parentheses.
2.Display the sentence with the parentheses and their content removed
A palindrome is a word or a phrase that reads the same forward and backward, character for character, disregarding punctuation, case, and spaces. Some examples: “racecar”, “Madam, I’m Adam”, “Was it a cat I saw?”.
Write a program that allows the user to input a word or a phrase and then determines if it’s a palindrome. The program should use a Boolean-valued Function procedure named IsPalindrome that returns True if the word is a palindrome.
NOTE: Remove all spaces and punctuation before analyzing the word or phrase.
Money earned in an ordinary savings account is subject to federal, state, and local taxes. However, a special type of retirement account, called IRA allows these taxes to be deferred until retirement. The purpose of this project is to show the benefits of starting IRA early.
Earl and Larry begin full time jobs in January 2013 and plan to retire in January 2061, after working 48 years. Assume that any money they deposit to IRA earn 4% interest compounded annually. Earl opens a traditional IRA account immediately and deposits $5,000, at the beginning of each year for 15 years. Larry plans to wait 15 years before opening IRA and then deposits $5,000 into the account at the end of each year until he retires.
Write a program that calculates the amounts of money each person has deposited into his account and the amount of money in each account upon retirement
A binary Search looks for a value by first determining in which half of the list it resides. The other half of the list is then ignored, and the retained half is temporarily regarded as entire list. The process is repeated until item is found or entire list has been considered.
The Boolean variable flag keeps track of whether or not the searched value has been found.
Write a program that displays nine different units of measure; request the unit to convert from, the unit to convert to, and the quantity to be converted; and then displays the converted quantity.
Write a program that accepts an 10 digit ISBN type number (including hyphens) as input, calculate the sum, and tell if it is a valid ISBN.
Valid ISBN is divisible by 11, unless the last digit is an ‘X’. If that’s the case, then the ‘X’ is replaced with number 10, and the ISBN needs to be divisible by 11 in order to be considered valid.
Write a program to calculate the mean and standard deviation of the exam scores, assign letter grades to each exam score, Standard Deviation, and Mean.
The test scores are in a text file Scores.txt
Write a program that allows the user to display any one of the 3 tables as an option and to quit as a fourth option. Use file Degrees.txt.
First table is ordered alphabetically by the field of study;
Second one is ordered by decreasing percentages; And last one is ordered by increasing number of degrees
Write a program that requests an English sentence as input and translates it into French and German. Assume that the only punctuation in the English sentence is a period. If the word is not in the dictionary, it should appear as itself in the translations. Use file Dictionary.txt
Each team in a six-team soccer league played each other team once.
Place the team names in an array structures that also holds the number of wins.
Place the data from table into two-dimensional array
Place the number of games won by each team in the array structures
Display a listing of the teams giving each team's name and number of games won.
Sort by decreasing order by the number of wins
A poker hand can be stored in a 2-dimensional array.
Dim hand(3, 12) as Integer - declares an array with 52 elements, where the first subscript ranges over the four suits and the second subscript ranges over the 13 denominations. A poker hand is specified by placing 1’s in the elements corresponding to the cards in the hand (see table).
Write a program that requests the five cards as input from the user, creates the related array, and passes the array to procedures to determine the type of hand: Flush (all cards with the same suit), straight (cards have consecutive denominations – ace can come either before 2, or after King), Straight Flush, Four-of-a-kind, Full House (3 cards of one denomination, 2 cards of another denomination), Three-of-a-kind, Two pairs, One pair, or none of the above.
Write a reservation system for an airline flight. Assume the airplane has 10 rows with 4 seats in each row. Use a two-dimensional array of strings to maintain a seating chart. In addition, create an array to be used as a waiting list in case the plane is full. The waiting list should be "first come, first served". Allow user three options:
A) Add a passenger to the flight or waiting list:
1. Request passenger's name 2. Display a chart of the seats in the airplane in tabular form 3. If seats are available, let the passenger choose a seat. Add the passenger to the seating chart. 4. If no seats are available, place the passenger on the waiting list.
B) Remove a passenger from the flight
1. Request passenger's name 2. Search the seating chart for the passenger's name and delete it 3. If the waiting list is empty, update the array so the seat is available 4. If the waiting list is not empty, remove the first person from the list and give him the newly vacated seat
Write a program that simulates The Game of Life created byJohn Conway. Follow the rules of the game.
Write a program that simulates directory assistance. Suppose the names and phone numbers of all employees are contained in Employees.txt. Each line of the text file has three parts - last name, first and middle name, and phone extension. The user should press a buttons for the first three letters of the person's last name followed by the first letter of the first name.
For example, for the name “Smith, Pavol" the user would press ‘6536'.
NOTE: there can be multiple people with different names for whom the same numbers will work, as each button contains 3-4 letters.
A fuel economy test was carried out for 5 cars. Each car was driven 100 miles, and then the model of the car and the number of gallons used were placed in a line of the file Mileage.txt. Write a program to display the models and their average MPG in decreasing order.
The program should utilize an array of structures with upper bound 4, where each structure has 3 members.
The first member should record the name of each model of car.
The second member should record the number of test vehicles for each model (the file contains multiple models of some cars).
The third member should record the total number of gallons used by that model.
File ALE.txt contains information shown in Table 1.
Write a program that produces a text file (I’ll call it ALE2.txt), which should contain information shown in the Table 2, in which the baseball teams are in descending order by the percentage of games won.
File Senate112.txt contains the members of the 112th Senate, before the 2012 election
File RetiredSen.txt contains members who left senate after 2012 election
File NewSen.txt contains newly elected senators in 2012 election
1. Write a program that uses the 3 files and create new file Senate113.txt that contains records for 113th Senate
2. Write a program that determines the number of senators of each party affiliation (Dem, Rep, Independent)
3. Write a program that determines the number of states whose two senators have the same party affiliation
4. Write a program that asks the user to select a state from a list box and then displays the 2 senators from each state
The file Names.txt contains a list of names in alphabetical order. Write a program that request a name from the user and insert the name into the list in its proper location.
If it is already in the list, the name should not be inserted.
Write a program to create and maintain telephone directories. Each telephone directory should be contained in a separate text file. In addition, a file named Directories.txt should hold the names of the telephone directories. At any time, names of all the directories should be displayed in a list box. After a directory is selected, it becomes the current phone directory
1. Create new phone directory. The filename should be provided by input dialog box
2. Add a listing (as given in text box) to the end of current phone directory
3. Delete a name (as given in text box) from the current phone directory
4. Display the names and phone numbers in the current phone directory
Each item in a store is identified by its UPC which consists of 12 digits. The single digit on the left (d1) identifies the type of product (0 for groceries, 2 for meat etc.). The first set of five digits (d2 - d6) identifies manufacturer. Second five digits (d7 - d11) identifies the product. Last digit (d12) is a check digit.
It is chosen so that (3 x d1 + d2 + 3 x d3 + d4 + 3 x d5 + d6 + 3 x d7 + d8 + 3 x d9 + d10 + 3 x d11 + d12) is a multiple of 10.
Write a program to simulate an automated check out at supermarket. A master file UPC.txt should have a record for each item, and the price of the item. The program should allow the cashier to enter UPCs one at a time and should place the UPCs in a separate text file.
Each UPC should be validated with the sum (*) as soon as it is entered and should be re-entered if the UPC is not a multiple of 10. After all items have been processed, the program should use the two text files to display a receipt in a text box.
The file Baseball.xml contains data about the performance of major league players in 2012 season.
Write a program using the file, that requests team as input from a list box and displays the players from that team whose batting average was above the average of his teammate's batting averages that are listed in the file. The players should be sorted in decreasing order by their batting averages. The output should display each player's name and batting average
Write a menu-driven program to manage a membership list. Assume that the names and phone numbers of all members are stored in alphabetical order (by last name, then first name) in the text file "MemberPhones.txt“. Each record consists of two fields - a name field and a phone number field. The names should appear in a list box when the firm is loaded.
When a name is highlighted, both the name and phone number of the person should appear in the text boxes at the bottom of the form.
To delete a person, highlight his or her name and click on the Delete menu item.
To change either a person's name or phone number, make the corrections in the text boxes and click on the menu item "Modify".
To add a new member, type the person's name and phone number into the text boxes and click on the menu item "Add". When the "Exit" menu item is clicked, the new membership list should be written to the file and the program should terminate.
Write a program that handles an election. When the program is first run, the label at the top of the page should read as follows: "Nominate candidate" to enter a candidate. or "Start Voting" to end nominations and start the voting. The program should add each candidate to a list box as he or she is nominated.
After the nomination process is complete, club members should be able to approach the computer one at a time and double-click on the candidate of their choice. When the Tally Votes button is clicked on, a second list box showing the number of votes received by each candidate, should appear along side the first list box. Also, the name(s) of the candidate(s) with the highest number of votes should be displayed in a message box.
Write a menu-driven multiform inventory program for a book store with data saved in a text file. Each record of the text file should consist of five fields – title, author, category (fiction or non-fiction), wholesale price, and number in stock. At any time, the program should display the titles of the books in stock in a list box. The user should have the option of displaying either all titles or just those in one of the 2 categories. The user should be able to add a new book, delete book, or alter any of the fields of a book in stock. The adding and editing processes use the second form frmDetails. At any time, the user should be able to calculate the total value of all books, or the total value of the books in either category. The menu item File contains the two second-level menu items Save and Exit. The menu items Display and Values each contain the three second-level menu items All, Fiction, and Non-Fiction. Hint: Store the data about the books in an array of structures
An Airplane has 15 rows numbered 1 through 15, with 6 seats labeled A-F in each row. Write a program that keeps track of the seats that have been reserved and the type of meal requested by each passenger. The seating chart should be displayed in a list box with a line for each row. When the ticket agent clicks on the desired row in a list box, the row number and the status of the seats in the row should be displayed in seven read-only text boxes at the bottom of the form. When an agent clicks on one of the text boxes, a second form containing four options labeled Unoccupied, Regular, Low Calorie and Vegetarian should appear. Clicking on the radio button should close the second form and update both text box and the row for that seat in the list box. Unoccupied seats are denoted with a period, and occupied seats are denoted with the first letter of their meal type. At any time, the agent should be able to request the number of seats filled, the number of window seats vacant, and the number of each type of meals ordered.
What is the probability that the underdog will win the World Series in baseball? What is the average number of games for a World Series?
Write an ANIMATED program to answer those questions. For example, suppose the underdog is expected to win 40% of the time (so the probability of winning a game is 40%). The probability of a 40% underdog’s winning a World Series is about 29%, and such a series would last average of 5.7 games.
The program should simulate the playing of 10,000 World Series where the underdog’s probability of winning is entered in a text box. The values of the horizontal scroll bars should extend from 0 to 10,000 and should be calculated after each series so that the scroll boxes steadily move across the bars.
NOTE: In order to save the program from being overwhelmed with changing values too often, just change the values after every 10 series. Also, every time the values are changed, execute a Refresh method for each of these text boxes.
A community of 10,000 individuals is exposed to a flu epidemic in which infected individuals are sick for 2 days and then are immune from the illness. When we first start to observe the epidemic (that is on day 0), 200 people have had the illness for 1 day, and 100 people have had it for 2 days. At any time, the rate at which the epidemic is spreading is proportional to the product of the number currently ill and the number of susceptible. Specifically, each day:
#of individuals in the first day of the illness = Cint(0.0001735 * #sick the previous day * #susceptible the previous day
Write a program that displays successive bar graph illustrating the progress of the epidemic. When the show day 0 button is clicked, the bar graph should show the distribution for day 0. Each time the Advance One Day button is clicked, a bat graph showing the distribution for the next day should appear.
Write a program to print a business travel expenses attachment for an income tax return. The program should request as input the name of the organization visited, the dates and locations of the visit, and the expenses for meals and entertainment, airplane fare, lodging, and taxi.
NOTE: Only 50% of the expenses for meals and entertainment are deductible.
The database Microland.accdb contains 3 tables. The table Customers identifies each customer by an ID number and gives, in addition to name and address, the total amount of purchases during the current year prior to today. The table Inventory identifies each product in stock by an ID number and gives, in addition to the description and price per unit, the quantity in stock at the beginning of the day. The table Orders gives the orders received today. Suppose that it is now the end of the day. Write a program that:
1. Displays in a list box the items that are out of stock and those that must be reordered to satisfy the orders. 2. Displays in a list box bills for all customers who ordered during the day. Each bill should show the customer’s name, address, items ordered (with costs), and total cost of the order.
A teacher maintains a database containing 2 tables – Students and Grades.
At the beginning of the semester, the Students table is filled in completely with a record for each student in a class, and the Grades table has a record for each student that contains only the student’s ID number.
Write a program that allows the instructor to record and process the grades for the semester.
1.Use a navigation toolbar to fill Grades table
2.After all grades are entered, display a DataGridView showing the name of each student and his or her semester average. The semester average should be calculated as
(firstExam + secondExam + (2 * finalExam) ) / 4
Write a program to maintain a person’s savings and checking accounts. The program should keep track of and display the balances in both accounts, and maintain a list of transactions (deposits, withdrawals, fund transfers, and check clearing) separately for each account. The two lists of transactions should be stored in text files.
The program should use 2 classes: Transaction and Account. The class Transaction should have properties for transaction name, amount, date, and whether it is a credit (deposit) or debit (withdrawal/check). The class Account, which will have both checking and savings account as instances, should use an array of Transaction objects. In addition, it should have properties for name (Checking or Savings) and balance. It should have methods to carry out a transaction (if possible) and to load the set of transactions from a text file. The events InsufficientFunds and TransactionCommitted should be raised at appropriate times.
Write a program for a game BlackJack.
I am a professional computer programmer for a national insurance company. I am versed in variety of programming languages, technologies, and frameworks. Currently using mostly SQL and .Net.
I have a Bachelor's Degree from City University of Seattle, majoring in Business Administration.
I first came in contact with programming back in the good 'ol days of Visual Basic 6 and Visual Basic for Applications. Manipulating Access databasea was so much fun!
I moved onto Web development in early 2000's, using HTML and CSS, later added PHP. It was then when I realized I really enjoyed the coding of the back end much more than the design part...and that joy of coding stayed with me ever since.
I LOVE coding, and I LOVE doing exercises and projects in my free time. I am hoping my course(s) help you to better understand the programming principles and give you a good starting point for your further adventure in computer programming,