TAILIEUCHUNG - Kỹ thuật lập trình C++

1. C++ is at the center of modern programming because it was derived from C and is the parent of Java and C#. These are the four most important programming languages. 2. True, a C++ compiler produces code that can be directly executed by the computer. 3. Encapsulation, polymorphism, and inheritance are the three guiding principles of OOP. 4. C++ programs begin execution at main( ). | Answers to Mastery Checks Module 1 C Fundamentals 1. C is at the center of modern programming because it was derived from C and is the parent of Java and C . These are the four most important programming languages. 2. True a C compiler produces code that can be directly executed by the computer. 3. Encapsulation polymorphism and inheritance are the three guiding principles of OOP. 4. C programs begin execution at main . 5. A header contains information used by the program. 6. iostream is the header the supports I O. The statement includes the iostream header in a program. 7. A namespace is a declarative region in which various program elements can be placed. Elements declared in one namespace are separate from elements declared in another. 8. A variable is a named memory location. The contents of a variable can be changed during the execution of a program. 9. The invalid variables are d and e. Variable names cannot begin with a digit or be the same as a C keyword. 10. A single-line comment begins with and ends at the end of the line. A multiline comment begins with and ends with . 11. The general form of the if if condition statement The general form of the for for initialization condition increment statement 12. A block of code is started with a and ended with a . 13. Show a table of Earth to Moon weights. Ainclude iostream using namespace std int main 1 C A Beginner s Guide by Herbert Schildt double earthweight weight on earth double moonweight weight on moon int counter counter 0 for earthweight earthweight earthweight moonweight earthweight cout earthweight earth-pounds is equivalent to moonweight moon-pounds. n counter if counter 25 cout n counter 0 return 0 14. Convert Jovian years to Earth years. include iostream using namespace std int main double e years earth years double j years Jovian years cout Enter number of Jovian years cin j years e years j years cout Equivalent Earth years e years return 0 15. When a function is called program

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.