Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Write a function to calculate the exchange rate of pounds to dollars
Answer
Td = 2xTp The parameter passed over is the number of pounds and returned the value in dollars
float convert (float x ) { float y ; /*A function which converts pounds measure X to a dollars measure*/ /*The parameter x is real and a real value y is returned*/ y = 2.0 * x; return (y); } The program which calls the function would be include include include include include void main() { char prompt; float a, b; printf("please enter in your value in pounds \n\r"); scanf("%f",&a); b= convert(a); printf("The value in dollars is %5.3f \n\r",b); b= convert(3.0); printf("The value in dollars of 3 pounds is %5.3f \n\r",b); printf("Press any key to exit \n\r"); scanf("\n%c",&prompt); }
Here the program requests the value of a in pounds, then executes function 'Convert'. This causes the program to go to the function statement, pass the variable a, to it and the output is passed back to the program. The output is then assigned to variable b and printed out. It is possible to pass a value over instead of a variable. The only amendment we have to make is to add the prototype to the program i.e.
float convert (float); This describes the type of variables passed to and from the function. Therefore the complete program and function is shown below include include include include include float convert (float); void main() { char prompt; float a, b; printf("please enter in your in pounds \n\r"); scanf("%f",&a); b= convert(a); printf("The value in dollars is %5.3f \n\r",b); b= convert(3.0); printf("The value in dollars of 3 pounds is %5.3f \n\r",b); printf("Press any key to exit \n\r"); scanf("\n%c",&prompt); } float convert (float x ) { float y ; /*A function which converts pounds measure X to a dollars measure*/ /*The parameter x is real and a real value y is returned*/ y = 2.0 * x; return (y); }
Problem: a) Give and Illustrate with the help of diagrams, four topologies for the Network Information System (NIS). b) Give methods for creating user accounts and groups.
Webcam Driver static library or DLL required for Windows I want a .dll or .lib file using which i will take a snapshot from the webcam and it can't turn on the webcam LED while
Readers Writers with Processes and Threads Write two programs implementing ``reader pritority readers-writers synchronization'''' on files. One program will use processes, created
what do you mean by control word
Specifying a Class: As discussed a class is defined to develop an algorithm and bind it together in a core shell. A class is an abstract data type (ADT). The binding of dat
Insertion sort - C program: Write a program in c to define a insertion sort. void main() { clrscr(); int a[100],ch,n; cout cin>>n; for (int i=0
How can one make it so keys pressed through users are not echoed on the screen? A: It is not a standard C++ feature. C++ doesn't even need your system to have a keyboard or a sc
Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula Momentum is m=mass*velocity. Your
basic salary of an employe.the allowence are House rent 20% of basic salary Medical allowence is 10% of basic salary conveyence allowence is 10% calculate anrd display gross salar
how we write decision tables, flowcharts,pseudocode,and algorithm in result management system
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd