VISUAL BASIC-
create a program for managing a "To Do" list. The program will need to read and update a text file named ToDoList.txt. The record structure of the file must be: 1) sort order, 2) task name and 3) desired completion date.
When the program starts, it should read the contents file into a structure. The information should then be displayed in a data grid view. The data should be initially sorted by the sort order value. Afterwards, the user should be able to click on a column name to sort the data by that specific column.
The user should be able to add, update and delete tasks. The methods to implement these features are up to you. Please note that each value (sort order, task name and desired completion date) should be saved as a string value.
The program must use StreamReader and StreamWriter objects. The program must also contain exception handling for a missing input file. If the input file is not found, the user should be informed and still be allowed to use the program (i.e. do not automatically close the program).
Please read the visual basic code with comments for more explanation and do let me know in the comment box below if you face any errors, I will try my best to explain. Here clicking on update button will write the data to file. Add button will add a blank row to the data grid view for new entry (duble click on the cell to edit the details). Delete button will remove the selected row and then click on update button to save the changes before exiting the application.
Output:

Text File: (comma separated for better readability)

Visual Basic Code:
Imports System.IO 'import for file reading operations
Public Class Form
Private Sub Form_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
Using fileReader As StreamReader = New
StreamReader("D:\ToDoList.txt") 'provide correct file path
here
Dim fileLine As String = ""
Dim index As Integer = 0
Dim temp(3) As String 'A temp array to store each row at a time (3
columns)
fileLine = fileReader.ReadLine()
While (fileLine <> Nothing) 'read file until the end of the
file
temp = fileLine.Split(CChar(",")) 'split the file line with ','
delimeter
'temp(0) contains Sorting Order, temp(1) contains Task Name,
temp(2) contains Desired Date
DataGridView.Rows.Add(temp(0), temp(1), temp(2))
fileLine = fileReader.ReadLine()
End While
End Using
Catch err As Exception
'let the user know if any error/exception occurs
MessageBox.Show("Error: " + err.Message)
End Try
End Sub
Private Sub saveList()
Try
Using fileWriter As StreamWriter = New
StreamWriter("D:\ToDoList.txt") 'provide correct file path
here
For i As Integer = 0 To DataGridView.Rows.Count - 1 Step +1
For j As Integer = 0 To DataGridView.Columns.Count - 1 Step
+1
fileWriter.Write(DataGridView.Rows(i).Cells(j).Value.ToString +
",")
Next
fileWriter.WriteLine()
Next
fileWriter.Close()
End Using
Catch err As Exception
'let the user know if any error/exception occurs
MessageBox.Show("Error: " + err.Message)
End Try
End Sub
Private Sub addButton_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles addButton.Click
DataGridView.Rows.Add("", "", "")
End Sub
Private Sub deleteButton_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles deleteButton.Click
Dim RowIndex As Integer
For i As Integer = 0 To DataGridView.SelectedCells.Count - 1
RowIndex = DataGridView.SelectedCells.Item(i).RowIndex
Next
If RowIndex < 0 Then 'if row selected then alert the
user
MsgBox("Please select any row to delete !")
Else
DataGridView.Rows.RemoveAt(RowIndex)
MsgBox("Selected row has been deleted !")
End If
End Sub
Private Sub updateButton_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles updateButton.Click
'save the rows to file if update button is clicked
saveList()
MsgBox("Data saved to file successfully.")
End Sub
End Class
VISUAL BASIC- create a program for managing a "To Do" list. The program will need to...
Visual C#
Homework 2
You are to write a program which will create a class called
Student
Each student has a name age height and weight. These variables
should be declared as private.
Create the correct constructors and functions.
In the main, you will create 5 students.
Input the data for the 5 students from a file which already
has information in it. Name the file “Information.txt”.
After setting up all the data, it is time to sort based on...
Write a menu based program implementing the following functions: (0) Write a function called displayMenu that does not take any parameters, but returns an integer representing your user's menu choice. Your program's main function should only comprise of the following: a do/while loop with the displayMenu function call inside the loop body switch/case, or if/else if/ ... for handling the calls of the functions based on the menu choice selected in displayMenu. the do/while loop should always continue as long...
Using c++ Write a program that reads in a list of up to 25 first names from an input file nameData.txt and allows the user to display the name data, sort it in ascending or descending order, count the number of occurrences of a given name, or exit the program. The input file consists of a single names per line with each line terminated with an end of line (i.e. using Enter key to end the line). Your program should...
Please Read it all and carefully In visual basic(vba)do the following program Summary INGE Industry, Inc. needs a program in which the date and temperature in Celsius degrees of an industry laboratory are recorded and stored in a sequential file. In addition, you can see the recorded data and convert the temperatures in the following units: Fahrenheit, Kelvin and Rankine. In addition, they want to see a linear graph that reflects how the temperature has fluctuated day by day, for...
The name of the C++ file must be search.cpp Write a program that will read data from a file. The program will allow the user to specify the filename. Use a loop that will check if the file is opened correctly, otherwise display an error message and allow the user to re-enter a filename until successful. Read the values from the file and store into an integer array. The program should then prompt the user for an integer which will...
Program in C++! Thank you in advance! Write a menu based program implementing the following functions: (1) Write a function that prompts the user for the name of a file to output as a text file that will hold a two dimensional array of the long double data type. Have the user specify the number of rows and the number of columns for the two dimensional array. Have the user enter the values for each row and column element in...
QUESTION 1 Match the following: an SQL command that retrieves data A. Communicate B. RETRIEVE C. exception D. ReadFile E. STORE F. array G. try - catch block H. Connection I. Disconnect0) J. StreamReader K. Respond L. SQL M. Fork N. Query O. BlowUp P. SELECT Q. Close0 R. StreamWriter S. WriteFile T. UPDATE an SQL command that changes data ., class that can be used to read data from a file , establishing communication with a database a method...
Using c++ write a program using a class that has data members ID#,NAME, SALARY, YEAR_HIRED. This program must 1) write 10 blank records to a random access file. You must enter data for 4 of these records. 2) allow the user to output the name, salary, hire_date for a selected record 3) allow the user to change the name, salary, or hire_date for a selected record. 4) allow the user to input a complete record to replace one of the...
C++ Visual Studios - Program - Vector - Simple Create a program that utilizes VECTOR for the following topic. Topic: Carl's Cab Stand needs a program to keep track of their daily clients. Your program shall allow the user to enter 10 names. You will then retrieve the names, one by one, from the data structure (using the appropriate method of retrieval for each data structure) and present them on-screen so that Carl knows who to service next. Include a...
Usage Usage: sna inputFile userName outputFile Requirements Summary Create a program that will read in the text file containing graph specification of Twitter account followers and write to the output a list of all users within a depth of 3 of the specified root user (the user specified from the userName command line argument), that are not already being followed by that user. The program should be able to create the directed graph from the input file and output the...