Jump to content

DouglinhasZN

Member
  • Posts

    18
  • Joined

  • Last visited

Awards

This user doesn't have any awards

DouglinhasZN's Achievements

  1. [code]Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim Mins, Tex, MB As String ' declares mins, trextrs and mb as vaaiubvles with data type string Mins = TextBox1.Text ' inputs datra frrom textgvox into varaible Tex = TextBox1.Text ' up MB = TextBox3.Text ' up If TextBox1.Text = "" Then ' Mins = "0" ' sets the varaibel to 0 End If If TextBox2.Text = "" Then ' Tex = 0 ' End If ' If TextBox3.Text = "" Then ' MB = 0 ' End If ' If Mins < 500 Then Mins = 0 Else Mins -= 500 Mins *= 0.2 End If If Tex < 500 Then Tex = 0 Else Tex -= 500 Tex *= 0.1 End If If MB < 500 Then MB = 0 Else MB -= 500 MB *= 0.5 End If Dim total As Single total = Convert.ToSingle(Mins) + Convert.ToSingle(Tex) + Convert.ToSingle(MB) + 20 * 1.2 TextBox4.Text = total End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim Mins, Tex, MB As String Mins = TextBox1.Text Tex = TextBox1.Text MB = TextBox3.Text If TextBox1.Text = "" Then Mins = "0" End If If TextBox2.Text = "" Then Tex = 0 End If If TextBox3.Text = "" Then MB = 0 End If If Mins < 500 Then Mins = 0 Else Mins -= 500 Mins *= 0.2 End If If Tex < 500 Then Tex = 0 Else Tex -= 500 Tex *= 0.1 End If If MB < 500 Then MB = 0 Else MB -= 500 MB *= 0.5 End If Dim total As Single total = Convert.ToSingle(Mins) + Convert.ToSingle(Tex) + Convert.ToSingle(MB) + 25 * 1.2 TextBox4.Text = total End SubEnd Class[/code] i've re done my code and it did work the first time then after a while it start giving me errors.
  2. correct, well I thank you so much for your help, but ive decided to be happy with an merit and leave the distinction behind, as its being such a pain in the ass .. I greatly appreciate your help my friend, the only one who acc helped. Ive tried today multiple times I just dont know the next step to calculate the input of the user, and I dont see my self learning it till friday as there is still errors to be fixed.
  3. im sorry if i copied ur code, i was trying to get ride of the problem, and somehow I manage to fix it with coding so I though it would be fine to leave it there
  4. Public Class SwampPhones Dim NS As Single Private Customer_Name As String Private House_number As String Private Post_code As String Private Mobile_number As String Private costs_of_phone_calls_made As Decimal Private cost_of_text_sent As Decimal Private cost_of_internet_usage As Decimal Private total_monthly_bill As Decimal Private numbers_of_minutes_used As Single Private number_of_texts_sent As Single Private mbs_of_internet As Single Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btncalculate.Click Dim diff As Decimal Dim temp_cost_of_phone_calls_made As Decimal Customer_Name = txtcust.Text House_number = txthouse.Text Post_code = txtpost.Text Mobile_number = txtmobile.Text txtcost1.Text = costs_of_phone_calls_made txtcost2.Text = cost_of_text_sent txtcost3.Text = cost_of_internet_usage txtcost4.Text = total_monthly_bill If Not Decimal.TryParse(txtcost1.Text, costs_of_phone_calls_made) Then MessageBox.Show("Invalid input", "Error") Exit Sub End If If rbt1.Enabled = True Then End If ' If costs_of_phone_calls_made <= 500 And cost_of_text_sent <= 500 And cost_of_internet_usage <= 500 Then 'End If total_monthly_bill = NS + temp_cost_of_phone_calls_made total_monthly_bill = total_monthly_bill * 1.2 txtcost4.Text = total_monthly_bill txtminutesused.Text = temp_cost_of_phone_calls_made If temp_cost_of_phone_calls_made > 500 Then temp_cost_of_phone_calls_made = 0 Else temp_cost_of_phone_calls_made = -500 temp_cost_of_phone_calls_made = temp_cost_of_phone_calls_made * 0.2 End If txtcost1.Text = temp_cost_of_phone_calls_made If costs_of_phone_calls_made = 500 Then diff = costs_of_phone_calls_made - 500 Dim isEqual As Boolean = (diff = 0.2) temp_cost_of_phone_calls_made = isEqual ' msgbox(temp_costs_phone_calls_made) End If End Sub Private Sub rbt1_CheckedChanged(sender As Object, e As EventArgs) Handles rbt1.CheckedChanged NS = 20 End Sub Private Sub rbt2_CheckedChanged(sender As Object, e As EventArgs) Handles rbt2.CheckedChanged NS = 25 End Sub End Class Ive done the minor changes.. on the cost of phone calls made field when i press to calculate I get -10. I dont know where this is coming from and also everytime I write something on the field numbers of minutes used then click calculate that number resets.
  5. I did do the coding though. I do possess some understanding, its just not as good as your senpai
  6. Im not the best at programming we do different lessons and in those lessons im excellent.. its just the programming im slacking, so dont be too quick to judge
  7. it is an assignment indeed, and i just joined the course, its been 4 months, i have 2 leessons of programming a week, and our teach is not the greatest. so yeah it is a bit hard for me
  8. man you have been of a great help.. I have little to no understanding, the coding that I code was from a friend guiding me. the part where im confused is that I dont know how to make the calculator include 20% VAT on the calculation. also on the last update of the code that I've posted I tried making the 3g and 4g button work, however im not 100% sure if the 4g button work or if any of the calculation work. Although I know it would be too much for u to help me more than u already are, is there any possible website that might help me figure this problem out and even learn the basic of programming ? Thanks again
  9. [code]Public Class SwampPhones Dim NS As Single Dim Customer_Name As String Dim House_number As String Dim Post_code As String Dim Mobile_number As String Dim costs_of_phone_calls_made As Decimal Dim cost_of_text_sent As Decimal Dim cost_of_internet_usage As Decimal Dim total_monthly_bill As Decimal Dim numbers_of_minutes_used As Single Dim number_of_texts_sent As Single Dim mbs_of_internet As Single Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btncalculate.Click Dim diff As Decimal Dim temp_cost_of_phone_calls_made As Decimal Customer_Name = txtcust.Text House_number = txthouse.Text Post_code = txtpost.Text Mobile_number = txtmobile.Text 'costs_of_phone_calls_made = txtcost1.Text txtcost1.Text = costs_of_phone_calls_made 'cost_of_text_sent = txtcost2.Text txtcost2.Text = cost_of_text_sent 'cost_of_internet_usage = txtcost3.Text txtcost3.Text = cost_of_internet_usage 'total_monthly_bill = txtcost4.Text txtcost4.Text = total_monthly_bill ' If rbt1.Enabled = True Then 'If costs_of_phone_calls_made <= 500 And cost_of_text_sent <= 500 And cost_of_internet_usage <= 500 Then 'total_monthly_bill = NS ' txtcost4.Text = total_monthly_bill temp_cost_of_phone_calls_made = txtminutesused.Text If temp_cost_of_phone_calls_made > 500 Then temp_cost_of_phone_calls_made = 0 Else temp_cost_of_phone_calls_made = (-500) * 0.2 End If txtcost1.Text = temp_cost_of_phone_calls_made If costs_of_phone_calls_made = 500 Then diff = costs_of_phone_calls_made - 500 temp_cost_of_phone_calls_made = diff = 0.2 ' msgbox(temp_costs_phone_calls_made) End If 'End If End Sub Private Sub rbt1_CheckedChanged(sender As Object, e As EventArgs) Handles rbt1.CheckedChanged NS = 20 End Sub Private Sub rbt2_CheckedChanged(sender As Object, e As EventArgs) Handles rbt2.CheckedChanged NS = 25 End SubEnd Class[/code] ive changed abit, but its very confusing to me. Any help is welcome
  10. [code]Public Class SwampPhones Dim Customer_Name As String Dim House_number As String Dim Post_code As String Dim Mobile_number As String Dim costs_of_phone_calls_made As Decimal Dim cost_of_text_sent As Decimal Dim cost_of_internet_usage As Decimal Dim total_monthly_bill As Decimal Dim numbers_of_minutes_used As Single Dim number_of_texts_sent As Single Dim mbs_of_internet As Single Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btncalculate.Click Dim diff As Decimal Dim temp_cost_of_phone_calls_made As Decimal Customer_Name = txtcust.Text House_number = txthouse.Text Post_code = txtpost.Text Mobile_number = txtmobile.Text 'costs_of_phone_calls_made = txtcost1.Text txtcost1.Text = costs_of_phone_calls_made 'cost_of_text_sent = txtcost2.Text txtcost2.Text = cost_of_text_sent 'cost_of_internet_usage = txtcost3.Text txtcost3.Text = cost_of_internet_usage 'total_monthly_bill = txtcost4.Text txtcost4.Text = total_monthly_bill If rbt1.Enabled = True Then If costs_of_phone_calls_made <= 500 And cost_of_text_sent <= 500 And cost_of_internet_usage <= 500 Then total_monthly_bill = "£20" txttotalcost.Text = total_monthly_bill End If If costs_of_phone_calls_made = 500 Then diff = costs_of_phone_calls_made - 500 temp_cost_of_phone_calls_made = diff = 0.2 ' msgbox(temp_costs_phone_calls_made) End If End If MsgBox(Customer_Name) MsgBox(House_number) MsgBox(Post_code) MsgBox(Mobile_number) MsgBox(costs_of_phone_calls_made) MsgBox(cost_of_text_sent) MsgBox(cost_of_internet_usage) MsgBox(total_monthly_bill) End SubEnd Class[/code] this is the coding ive done so far
  11. im starting to do some coding ill post here as soon as im done to get some guidance, thanks guys
  12. thanks, idk why people being so mean either.. im new to this Im having trouble with the actual code. Im pretty new to all this and I have no idea where to start from. I just need guidance
  13. I need help on the coding not changing labels lol
  14. iam at home and the visual studio is at college
×