[Shell] Can someone help me with this question...

Source: Internet
Author: User
[Shell] Can someone help me with this question... -- Linux general technology-Linux programming and kernel information. The following is a detailed description. 1. There is now a kind of money in the unit of blork (yuan) and nub (points ). The following is the name and conversion of money

| Trio: 3 blorks
| Mono: 1 blork
| Blot: 49 nubs
| Blat: 47 nubs
| Bleet: 30 nubs
| Blick: 12 nubs
| Bork: 6 nubs
| Nub: 1 nub

Now I want to write a program to calculate coins. Program requirements:
| Confirms that the argument represents a valid amount of money;
| Divides that amount of money into coins, by default using as amount of the largest
Coins as possible before moving on to smaller values; and
| Printing out the result, with a blank line separating different results, but NO
Extra blank line after the last result.
1) The entered number is the value of the total amount of money
2) apply the input number to the face value (from large to small)
3) output the result (see the following section)


If the user inputs-noblorks, all outputs do not have trio and mono outputs. (-noblorks can appear in the program's
Position and appearance of any argument multiple times)

If and only if:
-Only two digits after the decimal point
-Only one decimal point
-At least one decimal point
-No other characters

If the number is greater than 1, s should be added after the printed unit (trio, mono, blot, blat, bleet, blick, bork, nub ).


Example:
$ A3P1 4.59-noblorks 1.28
B4.59 gives you:
1 trio
1 mono
1 blot
1 bork
4 nubs

B1.28 gives you
2 blots
1 bleet

Cannot use bash extensions to do either arithmetic
("$ (...)") Or to call other programs ("$ (...)")


There are also some error reporting functions, for example, when a user inputs a character, It outputs "Please enter a number" and so on.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.