MATLAB programming, writing a script that ask two user

Nov 15th, 2014
KateS
Category:
Programming
Price: $10 USD

Question description

7.

Write a script in which you save the amounts 10, 15, 180, 92, 144 and 11 € to a vector.

Use the function done in the previous exercise to convert the amounts to dollars, pounds and yens (coefficients of conversion 1.2112, 0.68545 and 139.23 [1]). Print to the command window in the case of each currency a line with the mean of the converted amounts in the first column and the converted sums in the rest of the columns.

8.

Write a script which ask program’s ”user” for the amounts should to convert (these are giving as vector). The program asks also for user to give currency (USA, Great Britain, Japan). The user gives the symbol of the currency (USD, GBP, JPY) and after that program displays to the command window initial amounts, converted amounts and mean value of converted amounts. All vectors have to displays as row vector! Use your functions in previous exercises.

Program have to identify the wrong values that user gives.E.g. currency which is not some of three

above-mentioned causes an error message and closes the program. Output example:

>> ex8

Give the amounts: [10 15 180 144 11] Give the currency (USD, GBP, JPY): USD

Initial amounts:

10 15 180 144 11

Converted amounts:

12.1120 18.1680 218.0160 174.4128 13.3232

Mean of the converted amounts: 87.2064

>> kerta3_teht8

Give the amounts: [10 15 180 144 11]

Give the currency (USD, GBP, JPY): FIM

Wrong currency!


Tutor Answer

(Top Tutor) Daniel C.
(997)
School: Boston College
PREMIUM TUTOR

Studypool has helped 1,244,100 students

8 Reviews


Summary
Quality
Communication
On Time
Value
Five Star Tutor
Dec 6th, 2016
" Outstanding Job!!!! "
SjSurvivor143
Nov 20th, 2016
" Thanks for the help. "
Joemoe
Nov 7th, 2016
" <3 it, thanks for saving me time. "
tinytim47
Oct 29th, 2016
" Wow this is really good.... didn't expect it. Sweet!!!! "
pmallory
Oct 24th, 2016
" Totally impressed with results!! :-) "
mixedballz
Oct 15th, 2016
" excellent work as always thanks for the help "
kiln82
Oct 2nd, 2016
" awesome work thanks "
darnay
Sep 23rd, 2016
" The best tutor out there!!!! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1827 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors