473,569 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Currency Converter program

1 New Member
Hi everyone,

I have written a code in order to produce a currency converter. My program will be designed to convert pounds into euros using visual basic programming. I have two text boxes and one button(convert)
I have written the code, but i have come across alot of errors. Can anyone help me? Here is my code in full:

Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.  
  3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4.         'Converts British Pounds into Euros'
  5.         Dim Pounds As Decimal
  6.         Dim Euro As Decimal
  7.         Dim Exrate As String
  8.         Dim amount, total As Decimal
  9.  
  10.     End Sub
  11.  
  12.     Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles label1.Click, Pounds.Click
  13.         InputData(By Ref Pounds As Decimal
  14.         'Enter amount in British Pounds'
  15.         amount = Pounds(Add.Text)
  16.  
  17.     End Sub
  18.  
  19.     Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
  20.  
  21.     Function Pounds(ByVal As Decimal)As Decimal
  22.         'Convert British Pounds to Euros.
  23.         Return (total = amount * 1 / 1.4)
  24.  
  25.     End Function
  26.  
  27.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  28.         If Text = "Pounds" = txt.Pounds.Text Then
  29.  
  30.             total = amount * 1 / 1.4
  31.  
  32.         Convert button visual = True 
  33.  
  34.         Else
  35.  
  36.             textResult.text = "Incorrect Value Please try again."
  37.  
  38.         End If
  39.     End Sub
  40. End Class
Feb 14 '08 #1
1 9192
jamesd0142
469 Contributor
firstly functions must reside outside other subs etc
Feb 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4427
by: techy techno | last post by:
hii Experts..!! I need someone to tell me where I can get a Currency Converter like http://cconv.textor.com please can someone tell me where I can get it I need it for free + I dont need any link of the co. the code for this is here but when I change it it just says unauthorize
7
4055
by: meenasamy | last post by:
Hi all, i need to create a function that takes three parameters( Original currency, needed currency, amount) i need to convert from the original currency to the needed currency the amount and return the new amount in the needed currency, I need this function to work real time (obtaining real time currency exchange rates), any ideas???
2
1834
by: Rash33d | last post by:
Hi there! could som1 please help me out? i need toknow if there's something wrong with this javascript code. The code is meant to give the american dollar and european equivalent of a price. i.e when i type a price in pounds, it gives me the price in dollars and euros. Thanks in advance function fix(thenumber,noplaces){ // returns the...
10
3864
by: jayender.vs | last post by:
Hello guys, I need to know the Currency conversion code in Javascript Say for example i got 2 textbox .. where i enter a number (singapore doller value) and i provide a button and in the next text box i should get the value in US doller value. Waiting for ur response, Ciao, Jay
2
2810
by: Raj | last post by:
Is there a current converter web service available? Currency rates are to be as per latest exchange rates. Raj.
16
9485
by: xjohnx | last post by:
Hi, I'm hoping someone can help me I am quite new to Javascript and have had to create a programme which converts dollars into euros and vice versa, here is my script which is working var currency; var amountEntered; currency = window.prompt('Please enter 0 to convert from Dollars to euros and 1 to convert form euros to dollars',''); ...
12
3268
AdrianH
by: AdrianH | last post by:
Does anyone know where I can get a PHP currency converter? Adrian
25
5912
by: mereba | last post by:
Hello My country Ghana is changing its currency. I want to write a small programme in C++ that can covert from the old currency into the new one. I would like this programme to run behind a simple calculator- looking interface. I'm quite new to C++, and I would need some help. Please any suggestion is welcome :) The following is what I...
7
3762
by: tararreb | last post by:
#include<stdio.h> /*This line is standard input output, # is directive, include is keyword, and stdio.h is header file*/ #include<stdlib.h> /*This line is standard input output, # is directive, include is keyword, and stdlib.h is standard library defininition*/ #include<math.h> /*This line is standard input output, # is directive, include...
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.