/    Sign up×
Community /Pin to ProfileBookmark

Anyone doing M150 course ? If so , i’m really stuck and wondered if you could lend a hand.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@jalarieFeb 20.2007 — What are you trying to do? What have you tried so far? What is wrong with it?
Copy linkTweet thisAlerts:
@shooter4000authorFeb 20.2007 — Ive attempted part (i) and (ii) of question 1 , Question 1(iii) wants you to incorporate and extend the program to execpt another 2 types of currencies usings arrays and algarithms. Ive read all the material in book 8 and completed all the exercises but still dont know where to start i'm useless at this.


heres my code:

<HTML>

<HEAD>M 150 TMAO3 Question 1

<TITLE>Enter a currency</TITLE>

</HEAD>

<BODY>

<SCRIPT LANGUAGE="JavaScript">

var currencyType

currencyType = 0;

var amountEntered;

amountEntered = 0;

var amountConverted;

amountConverted = 0;

currencyType = window.prompt('Please enter the currency 0) Dollar 1) Euro 2)gbp 3)yen','');

currencyType = parseFloat(currencyType);

while (currencyType > 1 || currencyType < 0)

{

currencyType = window.prompt('Please re-enter currency should be 0 or 1','');

currencyType = parseFloat(currencyType);

}

amountEntered = window.prompt('Please enter the amount to be converted','');

amountEntered = parseFloat(amountEntered);

if (currencyType >= 1)
{
document.write('<BR>' + amountEntered + ' EUROS = ' + amountEntered * 1.27 + ' Dollars ')

}
if (currencyType < 1)

{
document.write('<BR>' + amountEntered + ' DOLLARS = ' + amountEntered / 1.27 + ' EUROS ')
}
</SCRIPT>

</BODY>

</HTML>




regards

mat
×

Success!

Help @shooter4000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...