Radford University Programming Currency Converter Program Code

Currency Converter ProgramPURPOSE:





Practice the basics of programming IPO
Declare and use variables
Use mathematical calculations in a program
Create and apply decision logic
Use the IF/ELSE structure
In Notepad, write pseudo-code only for a currency conversion program that converts
euros-to-dollars and dollars-to-euros. Remember to use the pseudo-code guide when
you are writing your code.



Ask the user if they want to convert
o 1. Euros-to-Dollars OR
o 2. Dollars-to-Euros
Based on the user’s answer (1 or 2) use an IF statement to process the conversion
The output should include
o
o
o
o
o
o
Some literal text ( write this in ” “s)
The type of conversion they selected ( Euro-Dollar, or Dollar-Euro)
The amount they want to convert
The resulting converted amount
The current date (current_month, current_day, current_year)
Any other message you would like (ie. Thank you)
o
o
Add an output that reads, “Programmed By : ” to every program you submit.
Comment you code. I will explain what this means in class.
NOTES:


Be sure that you include each step
Lookup and use the actual exchange rate
Pseudocode Guide
Variables
Output
Input
Set
Counter
Page 1 of 4
Follow the rules for naming variables: (1) must be one word, no spaces or special
characters, (2) can use _ to separate words, (3) name cannot start with a number and (4)
Names must be meaningful
“Constant” is the keyword used to declare constants. Constant names are in all caps
with words separated by _ : Constant Real TAX_RATE = 0.06
“Declare” is the keyword used before naming a variable.
Declare Integer variableName
Data types are: Real for decimal numbers, Integer for whole numbers, String for a series
of characters, Boolean for Boolean values
String values have to be surrounded by double quotes
Set variableName = “value”
Class variables:
Declare ClassName variableName
Set variableName = New ClassName( )
“Output” is the keyword used to print something to the screen
Output “This is how you print something to the screen”.
Output “Here is the average”, average.
“Print” the keyword used to print something on paper
Print “This is how you print something to the screen”.
Print “Here is the average”, average.
“Write” is the keyword used put data into data file.
Write variableName
“Input” is the keyword used to get the user to enter data.
Input variableName
“Get” is the keyword used to accept the data entered by the user.
Get variableName
“Read” is the keyword used get input from a data file.
Read variableName
“Set” is the keyword used before a calculation.
Set sale = price – discount
A counter is a storage location that is incremented or decremented by the same numeric
value.
Example: Count = Count + 1
Example: Count = Count + 2
Accumulator An accumulator is a storage location can is incremented by a different numeric value.
Example: Sum = Sum + Salary
Pseudocode Guide
Assignment
Statement
Selection
Structure
An assignment statement sets or re-sets the value stored in the storage location(s)
denoted by a variable name. Its purpose is saving the result of the expression to the
right of the assignment operation in the variable location to the left of the = sign.
Format: variable = expression
Examples:
Unit = 5
Amount = 100.99
Total = Unit * Amount
The general structure of an if statement is:
If condition Then
Statement
Etc.
End if
The general structure of the else-if statement
is:
If condition_1 Then
Statement
Etc.
Else If condition_2 Then
Statement
Etc.
Else
Statement
Etc.
Endif
Repetitive
Structures
Page 2 of 4
The general structure of an if then else
statement is:
If condition Then
Statement
Etc.
Else
Statement
Etc.
Endif
The general structure of the Case
structure is:
Selection testExpression
Case value_1:
Statement
Etc.
Case value_2:
Statement
Etc.
Default:
Statement
Etc.
End Select
The pseudocode for a For statement
looks as follows:
The general structure of a While loop
statement is:
For counterValue = startingValue to max Value
While condition
Statement
Statement
Etc.
Etc.
End For
End While
The general structure of a Do While/Until loop with a condition-controlled statement is:
Do
Do
Statement
Statement
Etc.
Etc.
While Condition
Until Condition
DoWhile
Statement
Etc.
Enddo
DoUntil
Statement
Etc.
Enddo
Pseudocode Guide
Arrays
Page 3 of 4
Declare an array:
Declare Integer numbers[10]
Declare Integer numbers[SIZE] = 847, 1238, ……
Process an array:
Sum = 0
For index = 1 to 10
Sum = Sum + numbers[index]
End for
Sum = 0
Index = 1
DoWhile Index = Greater than or equal to
Not equal to
Pseudocode Guide
Math
Operators
Class
Listing
Standard are used, such as: + – * / MOD ^
Creating a class:
Class ClassName
End Class
Field declarations:
Private dataType fieldname
Public dataType fieldname
Method declarations:
Public Module ModuleName(Parameter List)
Private Module ModuleName(Parameter List)
Public Function dataType FunctionName(Parameter List)
Private Function dataType FunctionName(Parameter List)
Page 4 of 4

Calculate your order
275 words
Total price: $0.00

Top-quality papers guaranteed

54

100% original papers

We sell only unique pieces of writing completed according to your demands.

54

Confidential service

We use security encryption to keep your personal data protected.

54

Money-back guarantee

We can give your money back if something goes wrong with your order.

Enjoy the free features we offer to everyone

  1. Title page

    Get a free title page formatted according to the specifics of your particular style.

  2. Custom formatting

    Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.

  3. Bibliography page

    Don’t pay extra for a list of references that perfectly fits your academic needs.

  4. 24/7 support assistance

    Ask us a question anytime you need to—we don’t charge extra for supporting you!

Calculate how much your essay costs

Type of paper
Academic level
Deadline
550 words

How to place an order

  • Choose the number of pages, your academic level, and deadline
  • Push the orange button
  • Give instructions for your paper
  • Pay with PayPal or a credit card
  • Track the progress of your order
  • Approve and enjoy your custom paper

Ask experts to write you a cheap essay of excellent quality

Place an order