JHTP练习题及课题_第一章_计算机、互联网及Java简介
来源:互联网 发布:ubuntu权限不够怎么办 编辑:程序博客网 时间:2024/06/07 00:36
Exercises
1.4Fill in the blanks in each of the following statements:
a) The logical unit that receives information from outside thecomputer for use by thecomputer is theinput unit.
b) The process of instructing the computer to solve a problem iscalledprogramming.
c)High-level language is a type of computer languagethat uses Englishlike abbreviations for machine-language instructions.
d)Output unit is a logical unit that sends informationwhich has already been processed by the computer to various devices so that itmay be used outside the computer.
e)Memory unit and are logical units of the computer thatretain information.
f)ALU is a logical unit of the computer that performscalculations.
g)CPU is a logical unit of the computer that makeslogical decisions.
h)Machine languages are most convenient to theprogrammer for writing programs quickly and easily.
i) The only language a computer can directly understand is thatcomputer’smachine language.
j)CPU is a logical unit of the computer thatcoordinates the activities of all the other logical units.
1.5Fill in the blanks in each of the following statements:
a) TheJavaprogramming language is now used to developlarge-scale enterprise applications, to enhance the functionality of webservers, to provide applications for consumer devices and for many otherpurposes.
b)C language initially became widely known as thedevelopment language of the UNIX operating system.
c) Therouter ensures that messages, consisting ofsequentially numbered pieces calledbytes, were properly routed from sender to receiver, arrivedintact and were assembledin the correct order.
d) TheC++ programming language was developed by BjarneStroustrup in the early 1980s at Bell Laboratories.
1.6Fill in the blanks in each of the following statements:
a) Java programs normally go through five phases—edit, compile, load, verifyand execution.
b) A(n)IDE provides many tools that support the softwaredevelopment process,such as editors for writing and editing programs, debuggers forlocating logic errors inprograms, and many other features.
c) The commandjavainvokes theJVM,which executes Java programs.
d) A(n)virtual machine is a software application thatsimulates a computer, but hides the underlying operating system and hardwarefrom the programs that interact with it.
e) TheJVM class loader takes the.classfiles containing the program’s bytecodes and transfers them toprimary memory.
f) Thebytecode verifier examines bytecodes to ensurethat they’re valid.
1.7Explain the two compilation phases of Java programs.
1.8One of the world’s most common objects is a wrist watch. Discusshow each of the following terms and concepts applies to the notion of a watch:object, attributes, behaviors, class, inheritance(consider, for example, analarm clock), modeling, messages, encapsulation, interface and informationhiding.
Making a Difference
Throughout the book we’ve included Making a Difference exercisesin which you’ll be asked to work on problems that really matter to individuals,communities, countries and the world. For more information about worldwideorganizations working to make a difference, and for related programming projectideas, visit our Making a Difference Resource Center atwww.deitel.com/makingadifference.
1.9(Test-Drive: Carbon Footprint Calculator)Some scientists believe that carbon emissions,especially from the burning of fossil fuels, contribute significantly to globalwarming and that this can be combatted if individuals take steps to limit theiruse of carbon-based fuels. Organizations and individuals are increasinglyconcerned about their “carbon footprints.” Websites such as TerraPasshttp://www.terrapass.com/carbon-footprint-calculator/and Carbon Footprinthttp://www.carbonfootprint.com/calculator.aspx provide carbon-footprint calculators.Test-drive these calculators to determine your carbon footprint.
Exercises in later chapters will ask you to program your own carbon-footprintcalculator. To prepare for this, use the web to research the formulas forcalculating carbon footprints.
1.10(Test-Drive: Body Mass IndexCalculator)Obesitycauses significant increases in illnesses such as diabetes and heart disease.To determine whether a person is overweight or obese, you can use a measurecalled the body mass index (BMI). The United States Department of Health andHuman Services provides a BMI calculator athttp://www.nhlbi.nih.gov/guidelines/obesity/BMI/bmicalc.htm. Use it to calculate your own BMI. A forthcomingexercise will ask you to program your own BMI calculator. To prepare for this,use the web to research the formulas for calculating BMI.
1.11(Attributes of Hybrid Vehicles)In this chapter you learned some basics ofclasses. Now you’ll“flesh out” aspects of a class called “Hybrid Vehicle.”Hybrid vehicles are becoming increasingly popular, because they often get muchbetter mileage than purely gasoline-powered vehicles. Browse the web and studythe features of four or five of today’s popular hybrid cars, then list as manyof their hybrid-related attributes as you can. Some common attributes includecity-miles-per-gallon and highway-miles-per-gallon. Also list the attributes ofthe batteries (type, weight, etc.).
1.12(Gender Neutrality)Many people want to eliminate sexism in allforms of communication. You’ve been asked to create a program that can processa paragraph of text and replace gender-specific words with gender-neutral ones.Assuming that you’ve been given a list of gender-specific words and theirgender-neutral replacements (e.g., replace both “wife” and “husband” with“spouse,”“man” and “woman” with “person,” “daughter” and “son” with “child”), explainthe procedure you’d use to read through a paragraph of text and manuallyperform these replacements.
How might your procedure generate a strange term like “woperchild?”You’ll soon learn that a more formal term for “procedure” is “algorithm,” andthat an algorithm specifies the steps to be performed and the order in which toperform them. We’ll show how to develop algorithms then convert them to Javaprograms which can be run on computers.
- JHTP练习题及课题_第一章_计算机、互联网及Java简介
- JHTP自测题_第一章_计算机、互联网及Java简介
- JHTP练习题及课题_第三章_类、对象、方法及字符串简介
- JHTP练习题及课题_第二章_Java应用、输入、输出及运算符简介
- JHTP练习题及课题_第四章_控制语句Part 1-赋值、++、--运算符
- JHTP练习题及课题_第五章_控制语句Part 2-逻辑运算符
- JHTP练习题及课题_第六章_深入理解方法 (附加一些感慨)
- JHTP小结_第三章_类、对象、方法及字符串简介
- JHTP自测题_第三章_类、对象、方法及字符串简介
- JHTP小结_第十三章_图形及Java2D
- JHTP自测题_第十三章_图形及Java2D
- JHTP小结_第二章_Java应用、输入、输出及运算符简介
- JHTP自测题_第二章_Java应用、输入、输出及运算符简介
- JHTP小结_第七章_数组及动态数组(Array and ArrayList)
- JHTP自测题_第七章_数组及动态数组(Array and ArrayList)
- JHTP小结_第十四章_字符串、字符及正则表达式(Strings, Characters and Regular Expressions)
- JHTP自测题_第十四章_字符串、字符及正则表达式(Strings, Characters and Regular Expressions)
- Nutch搜索引擎_ Nutch简介及安装
- 常看网址
- svn缓存的账户和密码
- Pro Android学习笔记(四八):ActionBar(1):Home图标区
- Yii2 使DataProvider分页时,page超过最大页数不进行处理
- 日志工具类-文件操作工具类-网络工具类-单位转换-屏幕获取工具类
- JHTP练习题及课题_第一章_计算机、互联网及Java简介
- 自定义progressbar颜色
- Android开发实践:屏幕旋转的处理
- iOS 10 正式降临,10 大改变!
- kNN算法分析
- JDK、JRE和JVM三者之间关系
- Python模拟表单提交登录广工图书馆
- win10 64位中打开注册表、我的电脑等
- Java内部类