473,388 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Currency Converter program

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 9148
jamesd0142
469 256MB
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
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...
7
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...
2
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...
10
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...
2
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
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...
12
AdrianH
by: AdrianH | last post by:
Does anyone know where I can get a PHP currency converter? Adrian
25
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...
7
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,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.