Create a Visual Basic form like the one below that allows the user to press buttons to change the background and foreground colors of the textbox. Your form should have 4 buttons, 2 labels, and 1 textbox.
1. Name the form frmAssignment_1 and put Assignment #1 in its title bar.
2. Name the buttons btnBlue, btnYellow, btnRed, and btnGreen. The captions on the labels should be Blue, Yellow, Red, and Green, respectively. The tab order of the buttons should be Blue, Yellow, Red, and Green. Create access keys for the buttons with the “B” underlined on the Blue button, the “Y” underlined on the Yellow button, the “R” underlined on the Red button, and the “G” underlined on the Green button.
3. Name the textbox txtVerse and enter into it the Bible verse from John 3:16 as depicted below. The form should open with this textbox having the focus. The font of the textbox should be Script MT Bold, size 12, style Bold.
4. Name the labels lblBackground and lblForeground. The text of the labels should be Background and Foreground, respectively. The font of the labels should be Times New Roman, size 12, Bold.
5. When the user clicks the Blue button, the background of the textbox should become blue (use Color.Blue).
6. When the user clicks the Yellow button, the background of the textbox should become yellow (use Color.Yellow).
7. When the user clicks the Red button, the text within the textbox should become red (use Color.Red).
8. When the user clicks the Green button, the text within the textbox should become green (use Color.Green).
Create a Visual Basic program that creates a bill for an automobile repair shop.The shop bills customers at the rate of $35 per hour for labor.Parts and supplies are subject to a 5% sales tax.The customer’s name, the number of hours of labor, and the cost of parts and supplies should be entered into the program via textboxes.When the Display Bill button is clicked, the customer’s name and the 3costs should be displayed in a list box as shown below.
Create a Visual Basic program to analyze a mortgage.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 is reasonable.If bad data have been supplied, the user should be so advised.Otherwise, the monthly payment and the total amount of interest paid should be displayed.The formula for the monthly payment is:
Payment = p * r / (1 – (1 + r) ^ (-n)),
Where p is the amount of the loan, r is the monthly interest rate (annual rate divided by 12) given as a number between 0 ( for 0 percent) and 1(for 100 percent), and n is the duration of the loan in months.The formula for the total interest paid is:
total interest = n * payment – p.
A furniture manufacturer makes two types of furniture—chairs and sofas. The cost per chair is $350, the cost per sofa is $925, and the sales tax rate is 5%.
Write a Visual Basic program to create an invoice form for an order (see the diagram below). After the data on the left side of the form are 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 can 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 in the invoice in the proper order. The generation of the invoice number and the reordering of the first and last names should be carried out by Function procedures.
Depreciation using Sum of the Years’ Digits Method:
Depreciation is the systematic and rational allocation of cost over a period of time.
The study of accounting teaches us that several different methods are used to allocate the cost of an asset over time. Some methods are based upon the amount of time that an asset is expected to be useful (e.g. straight line, double-declining balance, sum-of-the-years’ digits methods), while others are based upon the amount of activity an asset incurs over its useful life (i.e. units of production method). In this assignment, you will write a Visual Basic program that calculates depreciation of an asset using the sum-of-the-years’ digits method. Your program should perform the following tasks:
a. Request a description of the item, the year of the purchase, the cost of the item, the salvage value of the item, and the number of years to be depreciated (estimated life) using textboxes.
b. A single button should appear on the form that, when clicked, calculates the results of the depreciation and displays the results in a listbox as shown below.
c. Using the formula below, calculate the amount of depreciation per year given the values entered by the user. You may assume a January 1 date of purchase for the year entered. Display a year-by-year description of the depreciation. See the diagram below.
Sum-of-the-years’ digits formula:
Step 1: Calculate the sum of the year’s digits: Add up the number of years that the asset will be in use. (i.e. if an asset has a useful life of 5 years, add the numbers 5+4+3+2+1 = 15.) This is your denominator in the formula.
Step 2: Express each year as a ratio of the year number divided by the result calculated in Step 1. (Round to the nearest whole number.)
Asset cost: 10,000
Salvage value: 2,000
Useful life: 5 years
Year 1 multiplier: 5/15
Year 2 multiplier: 4/15
Year 3 multiplier: 3/15
Year 4 multiplier: 2/15
Year 5 multiplier: 1/15
Step 3: Multiply the cost of the asset (less its salvage value) by each year’s multiplier to compute each year’s depreciation.
Depreciation Carrying amount of asset Total depreciation to-date
At End of Year (Accumulated Depreciation)
Year 1: 5/15 * (10,000 – 2,000) = $2,667 10,000 - 2,667 = 7,333 2,667
Year 2: 4/15 * (10,000 – 2,000) = $2,133 7,333 – 2,133 = 5,200 2,667 + 2,133 = 4,800
Year 3: 3/15 * (10,000 – 2,000) = $1,600 5,200 – 1,600 = 3,600 4,800 + 1,600 = 6,400
Year 4: 2/15 * (10,000 – 2,000) = $1, 067 3,600 – 1,067 = 2,533 6,400 + 1,067 = 7,467
Year 5: 1/15 * (10,000 – 2,000) = $ 533 2,533 – 533 = 2,000 7,467 + 533 = 8,000
(2,000 is the salvage value.
So, this is correct.)
Adding all of the years of depreciation yields $8,000 (2,667 + ,133 + 1,600 + 1,067 + 533), which is equal to the cost – salvage value of the asset.
[Note that you cannot depreciate an asset below its salvage value.
d. Note that in your output, you must indicate the remaining balance of the item at the beginning of the year, followed by the amount of depreciation to be taken during the year, followed by the total
amount of accumulated depreciation on the asset since its purchase, and finally followed by the net book value (original value of the asset being depreciated less the total depreciation taken to-date) at the end of the year.
e. Make sure you use good software design principles, such as clearing the listbox after a user clicks a button but before new results are displayed. Make sure you also check for valid inputs (i.e. no textboxes left blank, no negative numbers, no alphabetic characters where numbers are expected, etc.)
Search Functionality using LINQ
The file, “Countries.txt” contains a list of countries from around the world. Place this file in your bin/debug directory.
In this assignment, you will create a Visual Basic program that reads the values from the Countries text file, displays those countries in a listbox, and allows the user to enter characters in a textbox to search for one or more countries in the listbox and display the results in another listbox. The number of countries returned from the search is displayed in a textbox below the results. The program also allows the user to sort the countries listbox in ascending or descending order. Finally, a clear button clears the results in the listbox, the search textbox, and the number of countries returned from the search textbox. A quit button is provided, which exits the application.
The figures below show the output of the Visual Basic program that performs the functionality described above.
1. Write a Visual Basic program that displays the information below and performs the functionality described above.
2. Using the IO.File.ReadAllLines method, read the contents of the countries.txt file into an array.
3. When the form loads, display the contents of the array in the Coutnries listbox.
4. When the user enters something in the Search Country textbox and presses the “Go” button, the program should search the array upon which the countries listbox is displayed. Use a LINQ query to do this. Note that the user may type in a full country name as illustrated in Figure 1 below, or he may enter only part of the name (even one letter), and the listbox should be populated with all countries that start with the same letter(s) as those entered by the user. Figure 2 below illustrates the search for all countries that begin with the letter “D”.
a. Be sure to make your search NON-case sensitive. That is, if the user enters “UnItEd sTateS” in the textbox, it should still retrieve the country “United States”. [Hint: If you convert the value that the user enters into uppercase and search for values that are converted to uppercase, this allows for a match to be found.]
b. Using LINQ queries, write the code such that when the user clicks the Sort Ascending button, the countries displayed in the Countries listbox is sorted from A-Z. Conversely, when the user clicks the Sort Descending button, the listbox should be sorted from Z-A. Although this feature can be accomplished using the properties of the listbox, your code should be written using LINQ queries to perform these functions.
[Hint: Before you set the datasource property of your listbox to the results of your LINQ query, you must first remove the datasource linkage to the original array by setting .datasource = nothing.]
5. Using a certain property of listboxes, determine the number of search results displayed in the Results listbox and display that number in the textbox shown below the listbox. Note: Do NOT use a LINQ query for this task.
6. Use appropriate software development guidelines, such as clearing the results listbox before populating it with new data when the Go button is clicked and including a title on the form.
In this assignment, you are to design an inventory management program for a car dealership that specializes in one-of-a-kind automobiles. All of the automobiles currently in stock are listed in the text file, “AutosInStock.txt”. When an automobile is sold, your program should move it from the “AutosInStock” textfile into another textfile “AutosSold” textfile. If the AutosSold textfile doesn’t not already exist (and it doesn’t the first time your application is run), your program should create it. Further, when a customer fails to make payments on an automobile that they have purchased from the dealership, the automobile is repossessed and re-entered into stock. Therefore, your program should move any repossessed automobile from the AutosSold text file back into the AutosInStock text file. The contents of the two text files should be displayed in listboxes when the application starts. Clicking a “Sell Auto” button removes the car from the AutosInStock listbox AND text file into the AutosSold listbox AND text file. After each “move”, the listboxes should be refreshed. A quit button should be included to exit the application.
Design your form as depicted in the diagram below.
1. The text files needed for this assignment should be placed in the bin\debug folder of the project. Note that you will not have a text file for AutosInStock. Your program should create it when it doesn’t already exist.
2. When the form opens, populate the Autos in stock listbox with the names of the cars listed in the AutosInStock text file and populate the Autos Sold listbox with the cars listed in the AutosSold text file.
3. Do NOT use arrays to populate the listboxes, but instead, use LINQ queries that read directly from the text files.
4. Use the StreamWriter in conjunction with IO.File.AppendText and IO.File.CreateText to append new directories and create new text files. (Note: You will need to use the WriteLine method to write the name of the new file to each text file.)
5. To display the contents of the directories file, use a LINQ query. Loop over all of the items in the query using a For each statement to populate the listbox.
6. Before displaying the contents of the AutosInStock and AutosSold files, make sure the files exist first. You will need to use the IO.File.Exists method in your checks.
7. Use good programming practices by clearing the listboxes before refreshing them when a change is made that affects their contents.
8. Remember to close the files after accessing them.
9. To remove a listing from a directory, you may find this code helpful as it selects only those records in the file that are not the one the user wants to remove. The code should then write the results of this query back to the file:
Private Sub RemoveFromFile(ByVal filename As String, ByVal item As String)
Dim query = From auto In IO.File.ReadAllLines(filename)
Where auto <> item
10. Include appropriate error checking (i.e. check to make sure something has been selected in one of the listboxes before trying to move it to the other listbox.)
11. Use appropriate naming conventions for all controls and variables. Make sure the form has a title. Include appropriate internal documentation (i.e. comments in your code).
Write a menu-driven Visual Basic program for a bookstore to show the book inventory that is saved in a text file. Each record of the text file consists of five fields – title, author, category, wholesale price, and number in stock. (The two categories are fiction and non-fiction, represented by “F” and “N” in the file.) When the application opens, the program should display all of this data in a datagridview control. The user should have the option of sorting the data in ascending order or descending order by title. The menu item File contains the second-level menu item Exit, which exits the application. The menu item Sort contains the two second-level menu items Ascending and Descending. The menu item Filter contains the three second-level menu items All Books, Fiction Books and Non-Fiction Books.
[Note: You should make the first column containing the book title large enough to display the entire title of each book. To do this, set the AutoSizeColumnsMode property to “All Cells”.
1. The text file, Books.txt is included in your Instructions folder and should be stored in your project’s bin\debug folder.
2. Read the values of the text file into an array called bookarray.
3. Use LINQ queries to separate the lines of the text file into their own fields called Title, Author, Category, Stock, and Price and display these values in a datagridview control. You will find it useful to set the datasource property of the datagridview control to the results of your LINQ query.
4. When the user clicks on the Sort menu, use LINQ queries to sort the array in ascending or descending order by Title and re-display your results in the same datagridview control. Make sure that only one option under the Sort menu appears checked at any given time.
5. When the user clicks on the Filter menu, use LINQ queries to filter the array by fiction, non-fiction, or all books. Note that you will need to use the letters “F” or “N” to filter the books based on the category listed in the text file. Make sure that only one option under the Filter menu appears checked at any given time.
6. Preserve the selections from the Sort and Filter menus in your results. That is, if the user has selected to Filter the list to Non-fiction books and then clicks Sort | Descending, the datagridview control should display the list of non-fiction books, sorted in descending order.
7. The form should open with the Sort | Ascending and Filter | All Books options set. The datagridview control should display these results as well.
8. Ensure that the full title can be seen for every row.
9. Include shortcuts and access keys for each menu item (such as Ctrl-X for Exit, Ctrl-A for Ascending, etc.)
As in all of your assignments, make sure that you have used appropriate programming techniques (i.e. naming of controls and variables, form has a title, internal documentation/comments are clear, formatting of any currency fields, etc.)
The database Microland.accdb is maintained by the Microland Computer Warehouse, a mail-order computer-supply company. The illustrations below show data in the Customers table in the database. The table identifies each customer by an ID number and gives, in addition to the name and address, the total amount of purchases during the current year.
Write a Visual Basic program that will:
As in all of your assignments, make sure that you have used appropriate programming techniques (i.e. naming of controls and variables, form has a title, tab order of controls is appropriate, textboxes used for display purposes are not writeable, internal documentation/comments are clear, formatting of any currency fields, etc.)
Design your form based on the diagram below.
The database that contains the table for this assignment is contained within your Instructions folder and should be placed in your project’s bin\debug folder.
Below are the data that are contained in the table in the database.
(Note: You do not have to display this table in your Visual Basic program. You should only create the screen shown above using the data in this table.)
Write a Visual Basic program to implement the cash register in the diagram below. The program should have a class called CashRegister that keeps track of the balance and allows deposits and withdrawals. The class should not permit a negative balance. If the user tries to subtract a number that would result in a negative balance, the system should produce a messagebox indicating that the transaction would result in a negative balance, which is not permitted.
Course Project -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
General Background Information:
CMS Systems, Inc. is a company that provides information systems consulting services to companies in the telecom industry in the United States and the United Kingdom.Due to its success, CMS is hoping to expand its operations into other parts of Europe.Despite its large size, CMS currently uses a manual/spreadsheet-based process for maintaining employee and client data.Management has now decided to implement a company-wide application that will keep track of all of its employees’ hours, calculate employee payroll, and produce invoices for clients based on hours worked by employees.
CMS currently employs 1,500 individuals (900 in the US and 600 in the UK) who serve as systems analysts, developers, managers, testers, maintenance engineers, accountants, lawyers, and sales representatives.
The company also has more than 200 clients in the US and UK.Clients can have one or more contracts with CMS to provide a variety of consulting services.For example, a single client might have 1contract for maintenance of an existing system and also have another contract (sometimes called a work order by the sales force) for the development of a new system.
All CMS employees must keep a record of the time they spend working for each client on a weekly basis.Because employees can work for more than one client and perform different functions for each client, CMS utilizes “project management” to keep track of employee assignments to client contracts.Employees can be assigned to work on more than one project at a given time.In fact, it is not unusual for an employee to spend time on two or more different projects within the same day.
Just as a client can have more than one contract with CMS, a contract can consist of more than one project.For example, a contract for the development of a new system could be fulfilled in multiple phases.Phase I could include implementation at one client site using a group of consultants in close proximity to that site.Phase II could include implementation at a different site with a potentially different set of consultants.Both of these phases are considered separate projects, even though they are governed by the same contract.
The number of hours worked for each employee on each project must be recorded on a weekly basis.Employees currently log their time using an Excel worksheet.An example of this worksheet is presented below.Notice that the employee’s supervisor is listed on the worksheet.A supervisoris currently required to approve his/her employees’ timesheets by placing his/her initials beside his/her name.
For this project, you are required to create the GUI for a timekeeping/payroll system for CMS.
The system should first allow an employee to enter his/her name and record the time he worked on each project for a given week.Using the spreadsheet above as a guideline, the system must allow the user to enter his/her name and the name of his/her supervisor.Next, the user must enter the number of the week for which he is entering time.Assume a maximum of 52 weeks in a year.Make sure the employee enters only a valid week number.
To record an employee’s hours, the user must enter the name of a client, a client’s contract and a project.For each of the 7days in a week, the user must enter hours worked or check a box that indicates the day is a weekend, a holiday, or a vacation day.If the employee fails to enter any hours for a day and fails to check the weekend/holiday/vacation box for that day, the system should warn the user that the given day is missing information.The system should also ensure that if any work hours are entered for a day, the checkbox for that day should NOT be checked.Finally, the system should ensure that a user cannot enter more than 24 hours in a single day.Once the hours are entered, the user should be able to “Submit” his/her hours by clicking a button that will calculate his/her payroll information for the week and display it on the same screen.
This assignment is due by 11:59 p.m. (ET) on Monday of Module/Week 7.
Payroll information is calculated as follows:
All employees are paid for hours worked at a rate of $15 US per hour.If the number of hours worked in the week exceeds 40, the employee is paid time and a half for his/herovertime hours.For example, assume an employee works 50 hours during a week, he will receive (40 X $15) + (10 overtime hours X (1.5 X $15)) = $825.00.If an employee works less than 40 hours in a week, the system should make note of this fact in a label beside the supervisor’s name.
Here is compelete solution for BMIS 208 course and Course Project Final BMIS208 - Visual Basic Programming
My solution contain Visual Basic projects for All weeks, All assignments and Course Project Final.
Please using Visual Studio to open this project.
If you have more question or need help, please contact me via email firstname.lastname@example.org. I will help you any time.