tailieunhanh - Java™ How to Program ( Deitel - Deitel) - Phần 4
Tham khảo sách 'java™ how to program ( deitel - deitel) - phần 4', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | First Program in Java Printing a Line of Text Modifying Our First Java Program Displaying Text with printf Another Java Application Adding Integers Memory Concepts Arithmetic Decision Making Equality and Relational Operators Optional Software Engineering Case Study Examining the Requirements Document Wrap-Up Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises PREV NEXT E Page 36 continued . Introduction We now introduce Java application programming which facilitates a disciplined approach to program design. Most of the Java programs you will study in this book process information and display results. We present six examples that demonstrate how your programs can display messages and how they can obtain information from the user for processing. We begin with several examples that simply display messages on the screen. We then demonstrate a program that obtains two numbers from a user calculates their sum and displays the result. You will learn how to perform various arithmetic calculations and save their results for later use. Many programs contain logic that requires the program to make decisions. The last example in this chapter demonstrates decision-making fundamentals by showing you how to compare numbers then display messages based on the comparison results. For example the program displays a message indicating that two numbers are equal only if they have the same value. We analyze each example one line at a time to help you ease your way into Java programming. To help you apply the skills you learn here we provide many fun and challenging problems in the chapter s exercises. E a Page 36 continued PREV NEXT . First Program in Java Printing a Line of Text Every time you use a computer you execute various applications that perform tasks for you. For example your e-mail application helps you send and receive e-mail and your Web browser lets you view Web pages from Web sites around the .
đang nạp các trang xem trước