To write a program in C# to perform conversion of dollars to rupees
#1

Aim:
To write a program in C# to perform conversion of dollars to rupees.
Algorithm:
ALGORITHM FOR COMPONENT.
Step 1: Create a namespace as currwithcomp.
Step 2: Create a class called currency as public.
Step 3: Inside the class declare the private variables x of type integer.
Step 4: Define a property variables x.
Step 5: In the property we have the get and set method.
Step 6: Get method is used to get the value form the user and set is used for
setting the user value to the original variables.
Step 7: Define a method called doll() as public.
Step 7.1: Return the value of x * 46.
Step 7.2: End of the method.
Step 8: End of the component.
AGORITHM FOR MAIN.
Step 1: Create a class called curr.
Step 2: Define the main function.
Step 2.1: Create an object ob for currency.
Step 2.2 : Get the value of x using Console.Readline() method.
Step 2.3: Print the converted value using Console.Writeline() method.
Step 2.4: End of the main.
Program:
COMPONENT
Code:
using System;
namespace CompCS
{                    
public class Conv
{
   private int i=0,j=45;
   public int varI
   {
     get{return i;}
     set{i=value;}
   }
   public int sum()
   {
     return i*j;
   }
}
}
MAIN
Code:
using System;
using CompCS;

class ConvertComp
{
  public static void Main()
  {
     Conv obj = new Conv();
     Console.WriteLine("Enter the dollar amount u want to convert:");
     int x = int.Parse(Console.ReadLine());
     obj.varI = x;
     Console.WriteLine("Dollar value : {0}",obj.varI);
     Console.WriteLine("Ruppes value : {0}",obj.sum());
  }
}
Execution Steps:
1.Create a dll file for the component
csc /target:library Convert.cs

2.Create an exe file for the main
csc /reference:Convert.dll ConvertComp.cs
3.Run the exe file
ConvertComp
Output:
Enter the dollar amount u want to convert:30
Dollar value : 30
Ruppes value : 1350
CONVERTING THE CURRENCY VALUES USING COM
CODINGS FOR BUSSINESS LAYER

Code:
Public Class Class1
    Public Function cur1(ByVal c1 As String) As String
        cur1 = c1 * 43.44
        MsgBox(cur1)
    End Function
    Public Function cur2(ByVal c2 As String) As String
        cur2 = c2 * 57.105
        MsgBox(cur2)
    End Function
    Public Function cur3(ByVal c3 As String) As String
        cur3 = c3 * 114.73
        MsgBox(cur3)
    End Function
    Public Function cur4(ByVal c4 As String) As String
        cur4 = c4 * 12.024
        MsgBox(cur4)
    End Function
    Public Function cur5(ByVal c5 As String) As String
        cur5 = c5 * 1.6623
        MsgBox(cur5)
    End Function
End Class
CODINGS FOR PRESENTATION LAYER
Public Class Form1
Code:
Dim obj As New classLibrary1.class1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
        If (ComboBox1.Text = "Usa Doller") Then
            Dim s = Val(TextBox1.Text)
            obj.cur1(s)
        ElseIf (ComboBox1.Text = "Eurro") Then
            Dim s = Val(TextBox1.Text)
            obj.cur2(s)
        ElseIf (ComboBox1.Text = "Oman Rial") Then
            Dim s = Val(TextBox1.Text)
            obj.cur3(s)
        ElseIf (ComboBox1.Text = "Uae Dirham") Then
            Dim s = Val(TextBox1.Text)
            obj.cur4(s)
        ElseIf (ComboBox1.Text = "Russian Rouble") Then
            Dim s = Val(TextBox1.Text)
            obj.cur5(s)
        End If
    End Sub
    
End Class
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: write a program for synchroscope, how to write a program in keil, jalamalinya prabandha write to kannada, best way to write a, project write up on inverter, how to write an mla, nfa to dfa conversion program in java,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  VHDL program for Booth’s Multiplier smart paper boy 2 5,652 20-04-2013, 11:59 AM
Last Post: T
  Program in “LEX” to count number of vowels and consonants seminar class 2 9,623 22-03-2013, 10:20 AM
Last Post: computer topic
  Program in “LEX” to count number of Identifiers and Keywords seminar class 1 4,841 28-01-2013, 03:21 PM
Last Post: Guest
  To perform multiple sequence alignment between the given sequences using Clustalw2 to smart paper boy 0 1,392 10-08-2011, 02:44 PM
Last Post: smart paper boy
  To perform global alignment between the given sequences using EMBOSS tool. smart paper boy 0 1,350 10-08-2011, 02:43 PM
Last Post: smart paper boy
  To perform local alignment between the given sequences using EMBOSS tool. smart paper boy 0 1,285 10-08-2011, 02:41 PM
Last Post: smart paper boy
  PROGRAM TO RECOGNIZE A STRING WITH THREE COSECUTIVE 0’s smart paper boy 0 1,663 10-08-2011, 11:44 AM
Last Post: smart paper boy
  : PROGRAM TO IDENTIFY VOWELS AND CONSONANTS GIVEN AS INPUT smart paper boy 0 2,404 10-08-2011, 11:44 AM
Last Post: smart paper boy
  Program to Encrypt and decrypt a text data using RSA algorithm smart paper boy 0 2,530 10-08-2011, 11:43 AM
Last Post: smart paper boy
  Program the CRC 12 on a data set of characters smart paper boy 0 1,766 10-08-2011, 11:42 AM
Last Post: smart paper boy

Forum Jump: