Homework - Chapter 9 Electricity. Open the Electricity Solution.sln file contained in the Chapo9\Electricity Solution fo

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Homework - Chapter 9 Electricity. Open the Electricity Solution.sln file contained in the Chapo9\Electricity Solution fo

Post by answerhappygod »

Homework Chapter 9 Electricity Open The Electricity Solution Sln File Contained In The Chapo9 Electricity Solution Fo 1
Homework Chapter 9 Electricity Open The Electricity Solution Sln File Contained In The Chapo9 Electricity Solution Fo 1 (30.61 KiB) Viewed 32 times
Imports System.IO
Public Class Form1
Private Sub btn_Calc_Click(sender As Object, e AsEventArgs) Handles btn_Calc.Click) Dim allLines =File.ReadAllLines("D://monthlyBills.txt") Dim up = allLines.GetUpperBound(0)
Dim bills(up) As Double Dim i As Integer Dim sum As Double = 0 Dim avg As Double
For i = 0 To up bills(i) =Convert.ToDouble(allLines(i)) Next
For i = 0 To up sum = sum + bills(i)
Next
avg = sum / (up + 1)
txtAverage.Text = "$" &Math.Round(avg, 2).ToString
End Sub
Private Sub btn_clear_Click(sender As Object, e AsEventArgs) Handles btn_clear.Click txtAverage.Clear()
End Sub
End Class
Errors;
Homework Chapter 9 Electricity Open The Electricity Solution Sln File Contained In The Chapo9 Electricity Solution Fo 2
Homework Chapter 9 Electricity Open The Electricity Solution Sln File Contained In The Chapo9 Electricity Solution Fo 2 (16.58 KiB) Viewed 32 times
Homework - Chapter 9 Electricity. Open the Electricity Solution.sln file contained in the Chapo9\Electricity Solution folder. Open the monthlyBills.txt file. Each of the 12 numbers in the file represents the cost of electricity for a month. Close the monthlyBills.txt window. The btnCalc_Click procedure should display the average monthly cost for electricity. Display the average with a dollar sign and two decimal places. Code the procedure. Save the solution and then start and test the application. (The average is $119.81. If you need to recreate the file, the project's bin\Debug folder contains a copy of the original file.) Upload your zipped folder to Blackboard.
BC30205 End of statement expected. > BC30506 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. > BC30506 Handles clause requires a With Events variable defined in the containing type or one of its base types. > BC30451 'txtAverage' is not declared. It may be inaccessible due to its protection level. > BC30451 'txtAverage' is not declared. It may be inaccessible due to its protection level. rror Lift Output Electricity Project Main Form.vb Electricity Project Main Form.vb Electricity Project Main Form.vb Electricity Project Main Form.vb Electricity Project Main Form.vb 10 Active 10 Active 35 31 36 Active Active Active
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply