PROJECT ON CURRENCY CONVERTER
By R.Shreeja(160609737039) L.Deepthi Sree(16060973701 Sree(160609737010) 0) Branch: IT
ABSTRACT
In finance,an exchange rate between two currencies is the rate at which one currency will be exchanged for another.
It is a useful tool which gives us the value of o f certain amount of one currency to be converted in to a different currency.
It is also regarded as the value of one country·s currency in terms of another currency.
In this project we are going to display a web window in which currency options are given and the conversion value is displayed in the next window.
TABLE OF CONTENTS
Introduction
Algorithm
Flowchart
Designing
Coding
Conclusion
INTRODUCTION
Currency converter is a tool used to convert one country·s currency to another.
In this project by the knowledge of usage of currency converter a program is designed in java language.
In this Currency Converter application, it is going to display a web page where u can choose to display the converter or the exchange rate of one currency with all other currencies in the form of table. In the converter u are given a choice to choose two currency names from the list of currency names displayed.
ALGORITHM
Step1: Start
Step2: Enter the amount value
Step3: Select the currency from and to
Step4: Click on the convert button
Step5: The value will be displayed
Step6: Exit
FLOW CHART Start Input given is amount value and currency names are selected from the options Click on convert
+
Output value will be positive
Given amount value is
0 Output will be zero Stop
Output value will be negative
DESIGNING
We are using different concepts like HTML for creating web page SERVLETS for creating dynamic pages and for displaying output JDBC for establishing the connection with the database.
This code is implemented by using TOMCAT server.
CODING Introduction Page
WELCOME TO CURRENCY CONVERTER
If u want to see currency convertion click on CONVERTER or
If u want to see convertion of one currency into different currencies click on TABLES
CONVERTER
TABLES< /a>
TABLES OPTION IS SELECTED
If option tables is selected & for selection of currency name
Select one currency name to see conversion of this in other currencies
American Dollar (USD)
Australian Dollar (AUD)
British Pound (GBP)
Canadian Dollar (CAD)
Chinese Yuan (CNY)
Euro (EUR)
Indian Rupee (INR
Malaysian Ringgit (MYR)
New Zealand Dollar (NZD)
Swiss Franc (CHF)
IF CONVERTER IS SELECTED
CURRENCY CONVERTER
FOR DISPLAYING OF TABLE
| USD | AUD | GBP | CAD | CNY | EUR | INR | MYR | NZD | CHF |
1AUD | 1.02876 | 1.0000 | 0.64047 | 1.04436 | 6.52590 | 0.74745 | 51.4731 | 3.22548 | 1.30789 | 0.92633 |
Inverse | 0.97205 | 1.0000 | 1056135 | 0.95753 | 0.153236 | 1.33789 | 0.01943 | 0.310031 | 0.76459 | 1.0795 |
D ATABASE CONNECTION import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class Test extends HttpServlet { Connection conn; public void init() throws ServletException { try { Class.forName("oracle.jdbc.driver.OracleDriver"); conn=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1: 1521","hr","demo"); }
catch(ClassNotFoundException e) { System.out.println(e); } catch(SQLException e) { System.out.println("Unable to connect"); } } public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException { response.setContentType("text/html"); PrintWriter pw=response.getWriter(); try {
float amt=request.getParameter("t1"); float v1=0,v3; String fc, tc; fc=request.getParameter("fromcurrency"); tc=request.getParameter("tocurrency"); pw.println(""); pw.println(""); pw.println("
"); Statement st=conn.createStatement(); ResultSet rs=st.executeQuery("SELECT VALUE1 FROM TABLE1 WHERE CURRENCY1='"+fc+"'AND CURRENCY2='"+tc+"'"); if(rs.next()) { v1=rs.getFloat(3); v3=v1*amt; pw.println("value is:"+v3+"
"); pw.println("1"+fc+"="+v1+tc+"
"); }
else pw.println("record not found
"); pw.println(""); pw.println(""); pw.println(""); pw.close(); rs.close(); st.close(); conn.close(); } catch(SQLException e) { System.out.println(e); } } }
SCREEN SHOTS
IF USER SELECTS TABLES
FORMAT OF TABLE
IF USER SELECTS CONVERTER
CONCLUSION Therefore , currency converter is developed and is used for knowing the currency·s value. It can be further developed by including more currency options, and by shown currency value tables for the user.