Exercise 7-2 Enhance the Future ValueapplicationThis exercise guides y dịch - Exercise 7-2 Enhance the Future ValueapplicationThis exercise guides y Việt làm thế nào để nói

Exercise 7-2 Enhance the Future Val

Exercise 7-2 Enhance the Future Value
application
This exercise guides you through the process of modifying the Future Value
application so it uses classes that provide static methods.
1. Open the project named ch07_ex2_FutureValue that’s stored in the ex_starts
directory. Then, review the code for the FutureValueApp class.
2. Start a new class named Validator in the same package as the FutureValueApp
class. Then, move the getDouble, getDoubleWithinRange, getlnt, and
getlntWithinRange methods from the FutureValueApp class to the Validator
class. For this to work, you will also need to add an import statement for the
Scanner class to the Validator class.
3. Change the name of the getDoubleWithinRange method to getDouble, and
change the name of the getlntWithinRange method to getlnt. This overloads
the getDouble and getlnt methods.
4. Modify the FutureValueApp class so it uses the methods in the Validator
class. Then, run the application to make sure that it still works correctly.
5. Start a new class named FinancialCalculations and save it in the same
package as the other classes. Then, move the calculateFutureValue method
from the FutureValueApp class to the FinancialCalculations class, and make
sure that the method is public.
6. Modify the FutureValueApp class so it uses the static calculateFutureValue
method that’s stored in the FinancialCalculations class. Then, run the
application to make sure that it still works properly
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Exercise 7-2 Enhance the Future ValueapplicationThis exercise guides you through the process of modifying the Future Valueapplication so it uses classes that provide static methods.1. Open the project named ch07_ex2_FutureValue that’s stored in the ex_startsdirectory. Then, review the code for the FutureValueApp class.2. Start a new class named Validator in the same package as the FutureValueAppclass. Then, move the getDouble, getDoubleWithinRange, getlnt, andgetlntWithinRange methods from the FutureValueApp class to the Validatorclass. For this to work, you will also need to add an import statement for theScanner class to the Validator class.3. Change the name of the getDoubleWithinRange method to getDouble, andchange the name of the getlntWithinRange method to getlnt. This overloadsthe getDouble and getlnt methods.4. Modify the FutureValueApp class so it uses the methods in the Validatorclass. Then, run the application to make sure that it still works correctly.5. Start a new class named FinancialCalculations and save it in the samepackage as the other classes. Then, move the calculateFutureValue methodfrom the FutureValueApp class to the FinancialCalculations class, and makesure that the method is public.6. Modify the FutureValueApp class so it uses the static calculateFutureValuemethod that’s stored in the FinancialCalculations class. Then, run theapplication to make sure that it still works properly
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Tập thể dục 7-2 Nâng cao giá trị gia tăng trong tương lai
ứng dụng
Bài tập này sẽ hướng dẫn bạn thông qua quá trình thay đổi các giá trị trong tương lai
ứng dụng để sử dụng các lớp học cung cấp phương pháp tĩnh.
1. Mở dự án có tên ch07_ex2_FutureValue đó được lưu trữ trong ex_starts
thư mục. Sau đó, xem lại các mã cho các lớp FutureValueApp.
2. Bắt đầu một lớp mới tên là Validator trong gói giống như FutureValueApp
lớp. Sau đó, di chuyển getDouble, getDoubleWithinRange, getlnt, và
phương pháp getlntWithinRange từ lớp FutureValueApp đến Validator
lớp. Để làm việc này, bạn cũng sẽ cần thêm một tuyên bố nhập khẩu đối với các
lớp Scanner để lớp Validator.
3. Thay đổi tên của phương pháp getDoubleWithinRange để getDouble, và
thay đổi tên của phương pháp getlntWithinRange để getlnt. Điều này đã làm quá tải
các getDouble và phương pháp getlnt.
4. Sửa đổi các lớp FutureValueApp để nó sử dụng các phương pháp trong Validator
lớp. Sau đó, chạy ứng dụng để đảm bảo rằng nó vẫn hoạt động một cách chính xác.
5. Bắt đầu một lớp mới tên là FinancialCalculations và lưu nó trong cùng một
gói như các lớp khác. Sau đó, di chuyển các phương pháp calculateFutureValue
từ lớp FutureValueApp đến lớp FinancialCalculations, và chắc
chắn rằng phương pháp này là công khai.
6. Sửa đổi các lớp FutureValueApp để nó sử dụng các calculateFutureValue tĩnh
phương pháp đó được lưu trữ trong lớp FinancialCalculations. Sau đó, chạy
ứng dụng để đảm bảo rằng nó vẫn hoạt động đúng
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2024 I Love Translation. All reserved.

E-mail: