I am supposed to create a pseudocode, I guess I am missing something because I thought that I had. This is what I have so far can someone please help me with finishing this?
Main Module
Declare selection as integer
Declare currency Type as Integer
Declare International Value as real
Declare US Value as real
Do while user wants to continue

Display Menu
Get International Value
Convert Currency
Display Results
End Loop
Print Exit message
End Main Module
Display Menu
Declare continue as Boolean
Set continue = true
Display “Welcome to the International currency conversion program”
Display “Please make a selection”
Display “International Currency Types:”
Display *1; Canadian Dollars’
Display *2; Mexican Pesos’
Display *3; English Pounds’
Display *4; Japanese Yen’
Display *5; French Francs’
Display *6; Quit’
Display “Enter a selection:”
Input currency Type
If currency Type >= 1 and currency Type <=5 then
Set continue = false
Else if currency type = 6
Display Quitting Currency Conversion continue = false
Else
Display ‘Error 4; Invalid menu selection’
End if
End while
End Display Menu

Get International Value
Declare Value as integer
Declare continue as Boolean
Set continue = true
While continue = true
Display ‘Enter a currency value (+ #);’
Input International Value
If International value > 0 and International value < 100000 then continue = false
Else
Display ‘Error 1; Invalid input: - #’ continue = true
End if
End while
End Get International Value

Convert Currency
Declare rate as real
Select Case of currency Type
Case 1:
Set rate = 1.4680
Case 2:
Set rate = 9.5085
Case 3:
Set rate = .6085
Case 4:
Set rate = 104.9
Case 5:
Set rate = 6.2561
Default:
Set rate = 0
End Case
US Value = rate * International Value

End Convert Currency

Display Results

Declare Nation as string
Declare currency as string
Select Case of currency Type
Case CANADIAN:
Nation = ‘Canadian’;
Currency = ‘Dollars’;
Case MEXICAN:
Nation = ‘Mexican’;
Currency = ‘Pesos’;
Case ENGLISH:
Nation = ‘English’;
Currency = ‘Pounds’;
Case JAPANES:
Nation = ‘Japanese’;
Currency = ‘Yen’;
Case FRENCH:
Nation = ‘French’;
Currency = ‘Francs’;
Default:
Nation = ‘No Country’;
Currency = ‘’;
End case
If currency <> then
Display the Value of, International Value, Nation, currency, is, US Value, dollars
Else
Display ‘Error 5: Invalid currency Type’
End if

End Display Results

I also have a flow chart if it is needed.

Recommended Answers

All 7 Replies

Looks perfect to me, what's the question?

I should say, what's the requirement. Because without that, the post is meaningless.
I mean, I could guess this is a currency conversion program (in which case, it's pretty good). But if it's for a game of chess, then it's rubbish.

Consistency perhaps?
Select Case of currency Type
Case 1:

Select Case of currency Type
Case CANADIAN:

I was told that I did not have a pseudocode or test values but is that not what I have done?

I am so sorry I forgot to say thank you and I really appreciate youe help.

What you have IS pseudo code.

But you didn't say what was missing, therefore it's impossible for us to "finish" it.

I too am working on this. I am not to the point you are yet because I keep tripping up on the Main Control module versus the Display Menu module. What is the difference between the two? I thought they were pretty much one in the same.

Help?

Can someone give me example as to how create a test for this pseudocode?

You test it by giving someone else (to read)
- the requirements (which in this case would be your homework assignment)
- your pseudo-code

Bascially, you're looking for
- have you got everything
- does it make logical sense
- is it well structured

If your "code" was machine-readable, it would cease to be "pseudo" at that point.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.