Learning Perl: 2.12. Exercises
来源:互联网 发布:淘宝直邮美国 编辑:程序博客网 时间:2024/06/16 02:19
2.12. Exercises
See Appendix A for answers to the following exercises:
[5] Write a program that computes the circumference of a circle with a radius of 12.5. Circumference is 2p times the radius (approximately 2 times 3.141592654). The answer you get should be about 78.5.
[4] Modify the program from the previous exercise to prompt for and accept a radius from the person running the program. So, if users enter 12.5 for the radius, they should get the same number as in the previous exercise.
[4] Modify the program from the previous exercise so, if the user enters a number less than zero, the reported circumference will be zero, rather than negative.
[8] Write a program that prompts for and reads two numbers (on separate lines of input) and prints out the product of the two numbers multiplied together.
[8] Write a program that prompts for and reads a string and a number (on separate lines of input) and prints out the string the number of times indicated by the number on separate lines. (Hint: Use the "x" operator.) If the user enters "fred" and "3," the output should be three lines, each saying "fred". If the user enters "fred" and "299792," there may be a lot of output.
- Learning Perl: 2.12. Exercises
- Learning Perl: 1.6. Exercises
- Machine Learning All the exercises
- Learning Perl
- Learning Perl
- Learning Perl
- Learning Perl:
- Learning Perl
- Learning perl
- Machine Learning- Coursera - Stanford - Programming Exercises
- Learning Reinforcement Learning (with Code, Exercises and Solutions)
- Learning Reinforcement Learning (with Code, Exercises and Solutions)
- Exercises
- Learning Perl: 2.1. Numbers
- Learning Perl: 2.2. Strings
- Learning Perl: 4.4. Arguments
- Learning Perl: 5.6. Filehandles
- Perl Learning: 8.3. Anchors
- Perl Learning: 2.9. The while Control Structure
- Perl Learning: 2.10. The undef Value
- Learning Perl: 2.11. The defined Function
- A
- CSS控制排版(转载)
- Learning Perl: 2.12. Exercises
- LINUX上安装memcached
- Java异常框架中finally执行、及其他相关问题
- Struts2开发知识点
- Ubuntu下交叉编译tslib-1.4记录
- Learning Perl: 3.1. Accessing Elements of an Array
- hdu 3460 Ancient Printer
- 智能卡3G COS软件的设计与实现
- Learning Perl: 3.2. Special Array Indices