Programming Visual Basic 2010
Please post correct answer. Some of the questions I asked answered wrong before.
Number Analysis: Create an application that reads the numbers
from the file named NumberSet.txt .Your application should perform
the following:
1) Display the total of the numbers
2) Display the average of the numbers
3) Display the highest number in the file.
4) Display the lowest number in the file.
Attachment: NumberSet.txt http://s000.tinyupload.com/?file_id=00184765431250246674
I need full programming code with all the comments and naming conventions.
plz check it let me know your comments
Module Module1
Sub Main()
' declear veriables
Dim totalNumbers As Double = 0, avgNumbers As Double
' How to: Write to a Text File. You can change the path and
' file name to substitute text files of your own.
' Read each line of the file into a string array. Each element
' of the array is one line of the file.
Dim Numbers As String() = System.IO.File.ReadAllLines("C:\Users\KWV\Documents\visual studio 2012\Projects\ConsoleApplication6\ConsoleApplication6\NumberSet.txt")
' convert string array to double array
Dim doubleAryNumbers As Double() = Array.ConvertAll(Numbers, New Converter(Of String, Double)(AddressOf DoubleConverter))
'Dim cNumbers As Double() = Array.ConvertAll(Numbers, [Double].Parse)
' add numbers the file contents by using a foreach loop.
For Each Number As String In Numbers
totalNumbers = totalNumbers + Convert.ToDouble(Number)
Next
'calculate average total numbers
avgNumbers = totalNumbers / Numbers.Count()
'dispaly total of the numbers
System.Console.WriteLine("the total of the numbers: " & totalNumbers)
'dispaly average of the numbers
System.Console.WriteLine("the average of the numbers: " & avgNumbers)
'dispaly highest number in the file
System.Console.WriteLine("the highest number in the file: " & doubleAryNumbers.Max())
'dispaly lowest number in the file
System.Console.WriteLine("the lowest number in the file: " & doubleAryNumbers.Min())
System.Console.ReadKey()
End Sub
'convert string to double function
Private Function DoubleConverter(ByVal text As String) As Double
Dim value As Double = 0
Double.TryParse(text, value)
Return value
End Function
End Module
Programming Visual Basic 2010 Please post correct answer. Some of the questions I asked answered wrong...
please help me finish this, it is for Visual Basic . net in Visual studio 2010 (show pictures of code and of the form please) Lab #5 - Banking Account with Methods Submit Assignment Download Work file Download Runtime Be sure to include comments at the top of each procedure and at the top of the file. Be sure to use meaningful names for all buttons and labels. In this lab you will create a simple banking application that will...
I am in C++ programming, I need help with this assignments. The answer in this assignments when I look for it it doesn't work in my visual studios. Can you please help me? I hardly have C in the class, if I fail I will fail the whole class and repeat this class again. The file named Random.txt contains a long list of random numbers. Download the file to your system, then write a program that opens the file, reads...
Hello, I need assistance with my assignment please in Visual Basic. Starting Out With Visual Basic Seventh Edition Chapter 5 Programming Challenge #1. Sum Of Numbers... page 370 Create an application that displays a form similar to the one shown in Figure 5-44. When the Enter Numbers button is clicked, the application should display the input box shown in Figure 5-45. The input box asks the user to enter a positive integer value. Notice that the default input value is...
Microsoft Excel VBA (Visual Basic for Applications) Programming
Language
Objectives: Create an array and redim it to a size equal to an
assigned value of a variable, populate the array with a series of
random numbers, output the array to a message box and to a
worksheet.
Instructions:
- Review the variables already declared. You won't need
others.
- See comments in the code that will act as your guide. Add new
code directly after each comment.
- Assign a...
I need help regarding my Visual Basic code
ISC/ITE 285 Homework Due: Monday, January 28 by 11:55 pm Create a text file named "Grades.txt" which will contain a list of numeric grades. Save the file in the projects Bin/Debug folder. A sample of the file contents is shown below: 80 96 95 86 54 97 Create a string array that will be populated from the file "Grades.txt" when the array is created (Class-level array). Also create a numeric array that...
hello i was given an assignment on object orientated programming
and we were asked to use Microsoft word, Comments for significant
parts should be coloured green. And can you recommend some videos
too so i can understand it better with your help.
i
have some questions about this assignment given and was told to
create in Microsoft word
Name your file with your full name, e.g.. Jessica_Jones.docx or (arth). • Programs/codes must be properly indented and free of compile-time errors....
I'm falling behind on my hw and I can really use a
hand with using structures in C,++
C++ Object Oriented Programming Programming Assignment #4 Structures Create a structure representing a student. The member variables should include student name, student ID, and four test grades for the student (an array of four grades as a member variable). Prompt the user to enter the name, ID and the four test results. Store all the data in the structure. Calculate the average...
Visual Basic Programming
Step 1-2 not important, it's just file naming.
3. Form contains nine Labels, one TextBox, and three Button controls. You use labels to let user know what to enter and what will be displayed; TextBoxes to input a number between 1 and 99. Buttons to Calculate change. Clear Input and Exit program. See below Form Layout with Controls for more details 4. Declare variables to store the entered value in TextBox, and what will be displayed in...
I need help writing these 2 programs please include all the indents :) In this programming challenge you are to create two Python programs: randomwrite.py andrandomread.py. One program, randomwrite.py, is to write a set of random numbers to a file. The second program, randomread.py, is to read a set of random numbers from a file, counts how many were read, displays the random numbers, and displays the total count of random numbers. Random Number File Writer (randomwrite.py) Create a program...
Visual Basic Programming
Step 1-2 not important, it's just file naming.
3. Form contains nine Labels, one TextBox, and three Button controls. You use labels to let user know what to enter and what will be displayed; TextBoxes to input a number between 1 and 99. Buttons to Calculate change. Clear Input and Exit program. See below Form Layout with Controls for more details 4. Declare variables to store the entered value in TextBox, and what will be displayed in...