Program Giving Wrong Answer
May 7, 2009
I'm currently creating a maths game for primary school children and have questions based on addition, subtraction, division and multiplication.I tried it out yesterday and if I type in the correct answer, I get told it's wrong, but if I type in the in the number I'm dividing by, as the answer it comes up as correct. How do I change this so that the correct answer is actually the correct answer?
View 2 Replies
ADVERTISEMENT
Oct 16, 2009
I've got this code to get the decimal and groupseparator settings on a computer:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim NumFormat As New System.Globalization.NumberFormatInfo
[Code]....
The problem is that on my computer NumberDecimalSeparator should return "," and NumberGroupSeparator should return ".", but it's just the other way around when I try to get both separators from my system. What could be going wrong, and even more important, how to get the right strings? I did check my locale setting to make sure I'm not crazy and I also didn't switch the textboxes.
View 2 Replies
Jan 14, 2011
In vb.net i am going to round a number but it is not Giving me correct answer. i.e.
Round (1.5,0) = 2
Round (2.5,0) = 2 which is wrong. the answer should be 3.
(When i use the Round formula in Excel it gives me the correct answer)
View 3 Replies
May 29, 2008
I have a combobox. The data that it binds to should be:
AcctID AcctName
10 Main
11 Old
[code].....
View 3 Replies
Mar 19, 2009
I'm trying to make a quiz application with Visual Basic at the moment. I want to write a routine that asks five questions to which the answer must be either Yes or No. It must add up the number of Nos and if the number of Ns is less than two then print out "pessimist", otherwise print out "optimist". So far this is the design of what I've done. [URL]. However, I have no code which I've produced on my own.
Code:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
I really don't know how I can kind of add up all the results from each individual question, seeing as radio buttons are used.
View 2 Replies
Sep 2, 2011
I am making a program that NEEDS to be password protected, so i made a textbox with a code so that when the user enters the right password it lets you in. But if the user/person enters a wrong password 2X it will kick you out. So is there a way to keep the
View 3 Replies
Sep 3, 2011
developing a program in Visual Basic 2010 to help with my study in school. I would like to develop a program whereby the user is asked to input the correct answer to a question; if the answer is correct the next question comes up if it is incorrect the user must try again until the correct answer is given. I would like to have quite a few questions (around 50).
View 6 Replies
Jan 15, 2010
I'm working on a project where I make a automatic messenger from VBnet. I want to program a simple one that responds to certain words or phrases. However, I only know the rough basics of If...Then commands. I have a lot of problems:
1. How do I make it so the messages typed in the box actually goes up into the script box when I press send?
2. How do I program a slight delay in the computer's answer?
3. How do I set a name to the computer and to me?
4. How do I make the script goes into scrolling when it runs out of space.
5. If possible, when I type an equation in the box, can I program the computer to solve it and display the answer? I'm a beginner so I don't really know the overall organization of this project. However, I would like it to remain as simple as possible.
View 4 Replies
Dec 22, 2011
I am working on bit more advanced calculator, but I cant figure out how I can make my program to calculate textbox1.text and show the answer in textbox2
For example: (textbox1) 5*62+4
(textbox2)314
I'm not sure this question belong in this topic, but I don't know where else it should be?
View 16 Replies
Jul 18, 2009
i have old program which is create in vb.5 i have in my PC vb.6 but when i want run program is give me a lot of error , i understand that i miss some .OCX i have this control or reference in my program 1- function MyScan(FpLibXCapture1 As FpLibXCapture, txtID As Object, LabelMessage As Label, LabelAlarm As Variant, Optional txtName As Object) Dim FpLibXVerify1 As FpLibXVerify Dim result As Boolean
View 2 Replies
Jan 12, 2010
I've got a DataGridview I want to remove columns from as it greatly increases performance when I format the DGV. The first time I remove columns in a loop (using the removeat) property, everythings fine. But when I try to remove more columns in another loop, it appears to remove the wrong columns and displays the wrong data. In other words, it displays the wrong data and headers; and the columns it does show has headers and cells that don't match.
[Code]...
View 2 Replies
Nov 15, 2010
For* Having the audio of a guitar note (A, B, C, D, E, F, and G) randomly generated, and the user must select from there letter names (A, B, C, D, E, F, and G) which note they think it is. They will also be given an option to place it on the musical notation lines.* Having a note randomly generated and displayed on musical notation lines, and the user must select which note they think it is from there letter names (and if they choose so in a time frame)
View 1 Replies
Dec 13, 2010
I'm working on a quadratic formula program and when I enter 1 as A, 2 as B, and 1 as A (X should end up being -1), it returns "NaN" in both text boxes.
Here's the code:
CODE:
View 8 Replies
Jan 15, 2011
I have most of the coding done, but i don't know how to code my hangman program so that when you enter a wrong letter, a picturebox image would appear eachtime. Also i want to put a limit on the amout of guesses you can have. If possible, i would also like a listbox with the letters that you have guessed wrong stored in it.
Here is my code so far:
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[code].....
View 4 Replies
Jun 22, 2010
I have a vb.net project which i have inserted pictures and video. I inserted a video clip using the Windows Media Player control and it does work. The issue i have is that i can't move the program to another computer because the pathname for the video will be wrong. I know i could change the pathname when i move it but this is not practical because i need to present this program. Does anybody know how to make the video accessible no matter what location the program is at?
View 6 Replies
Jul 11, 2011
I wrote my first program today and it works like I want it to Except when the Message box pops up there is a zero there untell you press the OK button then the answer displayes. How do I get rid of the zero or replace it with "Answer"?the program consist of 2 buttons, a labes, and a text box, when you enter a number in the text box then press button 1 the answer displayes in the label. If you press button 2 the answer displayes in a message box.I am new to programing and this is the first program i wrote without following a tutorial or book.[code]
View 14 Replies
Feb 22, 2009
I've googled like crazy and tried MSDN but I can't get a clear answer what to use ToString for.
View 11 Replies
Apr 27, 2011
In the user input of a textbox I would like that the user can input a formula to make it easier for him. So instead of inputing 400 I would like the user to have the possibility to input as 8*50. Is there a command for vb2008 to calculate the answer of this formula inputed by a string ?
View 2 Replies
Jul 2, 2009
[Code]....
As this Loops round, the answer for formula will eventually become the same as what was input, X. How can I get the Loop to stop when it has the same answer twice in a row? The counter will count how many times it has had to Loop before finding the repeated answer.
View 3 Replies
May 29, 2010
I'm new to the server and I'm making a quadratic calculator with my friend. I have my calculator coded, but whenever i click the calculate button the answer comes up as "NaN". Here is the code.
TextBox4.Text = (intVarB * (-1)) + (((intVarB ^ 2 - (4 * (intVarA * intVarC))) ^ 0.5) / (2 * intVarA))
The Variables "IntVarA", IntVarB, and IntVarC are defined as public variables in a code module.
View 4 Replies
Apr 8, 2010
i am going to create one system which is related to test skill and it is in VB.Net and access database it has a question and four answer. both are coming from database,my problem is how do i change answer sequence everytime.whenever user tried for the test, answer sequence should be different.
View 14 Replies
May 2, 2012
Dim energybar As New Rectangle(9, 154, energy, 21)That is my new rectangle, now when I draw it e.Graphics.FillRectangle(Brushes.Blue, energybar)It says there is no width but the integer energy is = to 100...now, how do I fix this? It but be somewhat simple.
View 1 Replies
Jun 3, 2011
I have installed the fax service in windows. I want to write a code in vb.net program that start receiving from a fax call.
View 2 Replies
Mar 3, 2011
I have a working dropdown box that gives the answers yes & no.When "yes" is selected I need to create a message box that displays a simple message and allows the user to click ok, to get back to the survey.I have been working with it, and tried several things but no luck. What would the code look like, and where exactly would I place it to fire at the right time.I am working in VB, with an aspx & aspx.vb page.
View 3 Replies
Apr 1, 2009
I am writing a program for FEMAP API interface in VB 2008 Express. Some API commands open user dialog boxes which requires yes or OKcancel inputs. So much for automation "Sendkeys" do not work, because code execution stalls at the line which opens the dialog boxes. I need stg that runs in parallel, watches for these dialog boxes, and sends the right keystroke at the right time.
View 7 Replies
Jan 24, 2012
I have several buttons in my form and they each need to add, subtract, divide and multiply certain values together but I seem to be having problems with this. I didn't expect anything to go wrong and its probably a rookie mistake, but take my first calculation for example; a user must enter a value in a textbox (txtDays) and and also when one of my various radio buttons are pressed a value shows in a label (lblDailyHireCharge). I now need a way of multiplying these values to give me my answer shown in a label. I have done this by adding a button when which pressed multiplies the txtDays value with the lblDailyHireCharge and then shows it in the label, however it keeps on showing "0" when i click it.
Below is my code, I am basically saying that the value of both of those figures is intDuration and that lblDuration is where I want it to go when the button is clicked.
Private Sub btnDuration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDuration.Click
Dim intdays As Integer
Dim intDailyHireCharge As Integer
Dim intDuration As Integer
[Code] .....
View 10 Replies
Oct 10, 2010
This might be a basic question but I am just starting in VB. How can you change the color of the text of a form if a person selects they are a boy or girl. I want the text to be blue if they select boy and pink if they select girl.
View 2 Replies
Feb 4, 2011
I have 3 ComboBox, I need the selection of the combobox to equal a number, (for example, the first option would = 1, second option would =4 and so on).the numbers will then be added up to show the sum.
View 2 Replies
Mar 22, 2011
In our school theres a programming class and the teachers gone for the week and the sub is starting to get very frustrated, so I offered to help in any way i can. I have never programmed Visual Basic but I have programmed Ms-Dos, Javascript, HTML, *.vbs, *.ahk, *.gml, and a variety of other languages.
The class is going to build a program that calculate how many rabbits are born in a family. So when they click the button it shows in a text box the actual equation and then the answer after the equal sign that where i assume concatenation comes in.Here's the code I've thrown together for when the buttons pressed:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim RabitAmount As Integer
Dim ShowEquation As String
[code]....
I got the equation to answer it self and show in the text box but it won't show the equation?
View 7 Replies
Jun 19, 2009
I store a formula in the database such as the following:GrossIncome+(Overtime/0.5)-Deductions=BasicNetIncome
I am able to substitute the string representations with actually values entered, thus:1000+(150*0.5)-100=BasicNetIncome
Then I remove the '=BasicNetIncome', thus:
1000+(150*0.5)-100
How can evaluate the above equation to return a result:
[Code]...
View 1 Replies