close
標題:

F.4 CIT!!!Pascal Programme,,,plz help~

發問:

aa.jpg

 

此文章來自奇摩知識+如有不便請留言告知

Write all programs in 2 versions,. i.e.(a) IF...THEN...Statements(b)IF...THEN...ELSE StatementWrite a MONEY_CHANGER program to ask the user for the sum of money.Output the minimum number of $5 cions,$2 coins and $1 cins the sum changes to.Enter a sum of money please:48(Press Enter button)There are 9 $5... 顯示更多 Write all programs in 2 versions,. i.e. (a) IF...THEN...Statements (b)IF...THEN...ELSE Statement Write a MONEY_CHANGER program to ask the user for the sum of money.Output the minimum number of $5 cions,$2 coins and $1 cins the sum changes to. Enter a sum of money please: 48(Press Enter button) There are 9 $5 coins. There are 1 $2 coins There is 1 $1coin

最佳解答:

Write all programs in 2 versions,. i.e. (a) IF...THEN...Statemen ts (b)IF...THEN...ELSE Statement Write a MONEY_CHANGER program to ask the user for the sum of money.Output the minimum number of $5 cions,$2 coins and $1 coins the sum changes to. Enter a sum of money please: 48(Press Enter button) There are 9 $5 coins. There are 1 $2 coins There is 1 $1coin 你這程式應不必用IF...THEN...ELSE a) program money_changer; var five,two,money:integer; begin writeln('Enter a sum of money please:'); readln(money); writeln('(Press Enter button)'); five := money div 5; money := money mod 5; if five <> 0 then writeln('There are ',five,' $5 coins.'); two := money div 2; money := money mod 2; if two <> 0 then writeln('There are ',two,' $2 coins.'); if money <> 0 then writeln('There are ',money,' $1 coins.'); end.

其他解答:
arrow
arrow

    ppi93gk88d 發表在 痞客邦 留言(0) 人氣()