Đang chuẩn bị liên kết để tải về tài liệu:
A Complete Guide to Programming in C++ part 35

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

A Complete Guide to Programming in C++ part 35. This book provides both novice and experienced programmers with a comprehensive resource manual for the C++ programming language. Readers gain experience in all aspects of programming, from elementary language concepts to professional software development, with in depth coverage of all the language elements en route. These elements are carefully ordered to help the reader create useful programs every step of the way. | SOLUTIONS 319 ------------------------------------------------------ member_t.cpp Using the class Member. ------------------------------------------------------ include member.h Class definition include iostream include string using namespace std int main Date today today.setDate cout Date today.asString endl Member fran 0 Quick Fran 17 11 81 kurt 2222 Rush Kurt Date 3 5 77 franzi.setNr 1111 cout nTwo members of the sports club n endl fran.display kurt.display cout nSomething changed endl fran.setName Rush-Quick fran.display Member benny 1122 Rush Benny 1 1 2000 cout The youngest member of the sports club n benny.display Who is the boss int nr Member ptr NULL cout nWho is the boss of the sports club n Enter the member number if cin nr if nr fran.getNr ptr fran else if nr kurt.getNr ptr kurt Member setBoss ptr cout nThe Boss of the sports club endl ptr Member getBoss if ptr NULL ptr- display else cout No boss existing endl return 0 320 CHAPTER 15 MEMBER OBJECTS AND STATIC MEMBERS Exercise 3 The definition of class Lights from this chapter remains unchanged. ------------------------------------------------------ Lights_t.cpp Simulates two traffic lights. ------------------------------------------------------ include lights.h Definition of class Lights include iostream include ctime Standard function time using namespace hr inline void wait int sec Wait sec seconds. time_t end time NULL sec while time NULL end Alternative for Windows include windows.h inline void wait int sec Sleep 1000 sec Lights A1 A2 Traffic lights and enum greenTimel 10 amberTimel 1 time to wait. greenTime2 14 amberTime2 2 int main cout Simulating two traffic lights n n Terminate this program with Ctrl C n endl cout 1. Light 2. Light n --------------------------- endl while true A1.setState Lights red A1 red A2.setState Lights amber cout endl wait amberTime2 cout A2.setState Lights green cout endl wait greenTime2 cout A2.setState Lights amber cout endl wait amberTime2 A1.setState Lights amber A2 .

crossorigin="anonymous">
Đã 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.