Question: Please answer in Java language Question 2 (7pts): Dynamic Latency-Computer Program Consequently, as a Summer (Student) Intern in the Project-S Space-Exploration program, part of your




Question 2 (7pts): Dynamic Latency-Computer Program Consequently, as a Summer (Student) Intern in the Project-S Space-Exploration program, part of your job description involves you evaluating point-to-point connections between computing nodes on a daily basis. To this end, on daily basis, you shall be computing the latency incurred in transferring a given quantity of data between any two (2) given nodes within the Project-S MAN. With regard to a microwave communication link on the Project-S network, the tabular data below defines the daily standard bandwidth and the dailv (10 Gigabvtes of data) latencv. Therefore, design an algorithm; and thereafter, develop a Java program based on your predesigned algorithm such that your algorithm and source code will accomplish the following: 1. Title/Name of your algorithm = Algorithm 2: Dynamic Latency computer 2. Name of the Java program/class =A2Q2 3. Display a prompt message for the user to enter the Weekday, the Mode, and a given data quantity as a single group of input separated via space characters. The data quantity value MUST be in {nKy}B format where n is a number and y is a prefix quantifier. Also, the data quantity MUST be either of the following: 10GB,20PB, or 30ZB. Hence, valid inputs for the Weekday (Monday - Sunday), the Mode (Bandwidth or Latency), and the data quantity ( 10GB,20PB, or 30ZB ) variables MUST be case-insensitive. 4. Validate the user's inputs to ensure that only valid values were entered for the Weekday, the Mode, and the data quantity inputs. If an invalid input was received; display the respective error message, and end the program with a note for the user to try again. 5. If the user has entered a valid input with respect to the Weekday, the Mode, and the data quantity; process the user's inputs to determine the corresponding real value in either Bandwidth mode or Latency mode. 6. Thereafter, compute the resultant value for the latency, in milliseconds (ms), incurred with respect to the transmission of the given data quantity over Project-S microwave communication link. 7. You MUST use the switch () statement to implement all your decision/selection logic with respect to the real values for the Bandwidth, the Latency, and the data quantity variables herein. In this regard, using an 1f () statement in lieu of switch () statement will be assumed as a logical failure; and this will attract zero (0) point. 8. After processing, display a confirmation message to the user in the form below: Latency incurred in txansmitting (n)(y)B of data, over Project-s microwave network link, is: fvaluelms will be assumed as a logical failure; and this will attract zero (0) point. 8. After processing, display a confirmation message to the user in the form below: Latency incurred in transmitting {n}{y}B of data, over Project-s microwave network link, is: \{value\}ms 9. Finally, display a complimentary-close message as follows: Once again, thanks for your contribution to Project-s. The following are sample screen shots to illustrate the expected behavior of your program. Your program must display the same information, using the same format, as depicted below: Welcome to the Dynamic Latency-Computer Program: Please enter a Weekday, Mode, and Data Quantity, respectively: 5A Turpay bandwidth 7epp. Latency incurred in transmitting 20PB of data, over.Project-S microwave netivork 1 ink, is: 142 . 045455ms Once again, thanks for your contribution to Profect-s. Figure 10. Sample-1 output of Question 2 Weicome to the Dynamic Latency-Computer Progran: Please enter a Weekday, Mode, and Data Quantity, raspectively: i monday lactacy 10b Latency incurred in transmitting 302B of data, over Project-S microwave network 1 ink, isi 2638s279,e66624ns once again, thanks for your contribution to projectis. Figure 11. Sample-2 output of Question 2 Welcome to the Dynamic Latency-Computer Program: Please enter a Weekday, Mode, and Data Quantity, respectively: sunDeY BAndwIdTh 2ept Latency incurred in transmitting 2ePB of data, over Project-s microwave network 1ink, is: 0.101725ms Once again, thanks for your contribution to Project-5. Figure 12. Sample-3 output of Question 2 Figure 13. Sample-4 output of Question 2 Welcome to the Dynamic Latency-Computer Program: Please enter a Weekday, Mode, and Data Quantity, respectively: THURSOAY BANDWDTH 2 2PB Error: Invalid value entered for the 'Mode' variable. Kindly retry with a valid input. Once again, thanks for your contribution to Project-s. Figure 14. Sample-5 output of Question 2 Welcome to the Dynamic Latency-Computer Program: Please enter a Weekday, Mode, and Data Quantity, respectively: Bandirich MonDAy jaze Error: Invalid value entered for the 'Mode' variable. Kindly retry with a valid input: Please enter a Weekday, Mode, and Data Quantity, respectively: THURSOAY BANDWDTH LUPB Error: Invalid value entered for the 'Mode' variable. Kindly retry with a valid input. Once again, thanks for your contribution to Project-S. Figure 14. Sample-5 output of Question 2 Welcome to the Dynamic Latency-Computer Program: Please enter a Weekday, Mode, and Data Quantity, respectively: Bandwidth MonDAY 30zb Error: Invalid value entered for the 'Mode' variable. Kindly retry with a valid input. Once again, thanks for your contribution to Project-s. Figure 15. Sample-6 output of Question 2 Welcome to the Dynamic Latency-Computer Program: Please enter a Weekday, Mode, and Data Quantity, respectively: MonDAY BandWldth 30ga. Error: Invalid value entered for the 'Data Quantity' variable. Kindly retry with a valid input. Once again, thanks for your contribution to Project-s. Figure 16. Sample-7 output of Question 2 Welcome to the Dynamic Latency-Computer Progran: Please enter a Weekday, Mode, and Data quantity, respectively: TidDaY BavovidTH 20p3 Latency incurred in transmitting 2aPB of data, over Project-s microwave network. Iink, is: 177777,777773ms Once again, thanks for your contribution to Project-s. Figure 17. Sample-8 output of Question 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
