Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Develop a React Native application for currency conversion. The application will have two parts: Part 1 : Convert values from USD and GBP to EUR
Develop a React Native application for currency conversion. The application will have two parts: Part : Convert values from USD and GBP to EUR using fixed exchange rates. Part : Convert values from USD and GBP to EUR using data from the ExchangeRateAPI. Create the React Native App Install Node.js Make sure you have Node.js installed on your machine. npm install g createreactnativeapp npx createreactnativeapp CurrencyConverter cd CurrencyConverter start the emulator with the batch file or from android studio run the app npm start npm run android Change the app npm install reactnativesimpleradiobutton axios axios is only need for the second part Replace the Code in App.js:
Open the App.js file in your project directory and replace its contents with the code provided in the instructions. Add an input field TextInput two radio buttons RadioButton a button Button and a label TextImplement the logic to convert the entered value from USD to EUR and from GBP to EUR. Display the conversion result in the label.
Code: import React, useState from 'react'; import View, Text, TextInput, Button, StyleSheet from 'reactnative'; import RadioForm from 'reactnativesimpleradiobutton'; export default function App const amount setAmount useState; const currency setCurrency useStateUSD; const result setResult useStatenull; const conversionRates USD: GBP: ; const handleConversion const rate conversionRatescurrency; const convertedAmount parseFloatamount ratetoFixed; setResult$convertedAmount EUR; ; const radioprops label: 'USD', value: 'USD' label: GBP value: GBP; return Currency Converter setCurrencyvalue formHorizontaltrue
labelHorizontalfalse buttonSizeresult && result; const styles StyleSheet.create container: flex: justifyContent: 'center', alignItems: 'center', padding: header: fontSize: marginBottom: input: height: borderColor: 'gray', borderWidth: marginBottom: paddingHorizontal: width: result: marginTop: fontSize: ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started