You can use while loop to simulate the downloading time (see below). You may also need...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You can use while loop to simulate the downloading time (see below). You may also need to do decisions (if-else statement) in each loop iteration according to the requirements listed in the assignment description below. (20 pts) Assume one is sitting in a room with very unstable Wi-Fi signal and is downloading a big file via a cell phone. Sometimes the Wi-Fi signal is ON, but sometimes it is OFF. According to modern settings, a phone will use Wi-Fi if the Wi-Fi signal is ON, but it will use 4G LTE if the Wi- Fi signal is OFF. Assume the person will stay in the room for 2 minutes (i.e. 120 seconds). The phone will switch between the Wi-Fi signal and the 4G LTE signal back and forth to download the big file, depending on the status of the Wi-Fi signal. The switching time between one signal to another can be ignored. Assume that the phone will check whether the Wi-Fi signal is ON at every second, and if it is ON, the phone will use Wi-Fi to download data in that second. Otherwise, the phone will use 4G LTE to download data in that second. Whether the Wi-Fi signal is ON or OFF is random, but the 4G LTE signal is always available. The signal checking time can be ignored. The downloading speed in Wi-Fi is 1.2 Mbytes/second, and it is 0.8 Mbytes/second in 4G LTE environment. The Wi-Fi signal is free, but the 4G LTE signal charges 0.5 dollar/second. Please write a program that simulates the downloading process in those 2 minutes. You do not have to simulate the "clock" time in your code, just use 120 iterations to simulate the procedure. The program should print the following statistics at the end (i.e. after the loop), and then the program terminates. a. The total bytes the phone downloads (in Mbytes). b. The total bytes downloaded in Wi-Fi environment (in Mbytes). c. The total bytes downloaded in 4G LTE environment (in Mbytes). d. The price for using the 4G LTE signal (in dollars). Submission Requirement: Please upload your Java source code (.java file) to Blackboard Assignment 5 section. Clues: You may want to use the return value of Math.random() to simulate the fact whether the Wi-Fi signal is ON or OFF. STOP at here and think about how to use and interpret its return value. If you need further information, please follow the arrow below. You can follow our examples on slides to randomly generate either of two values (0 or 1), then you can use value 0 to indicate "Wi-Fi ON", and value 1 to indicate "Wi-Fi OFF". You can use while loop to simulate the downloading time (see below). You may also need to do decisions (if-else statement) in each loop iteration according to the requirements listed in the assignment description below. (20 pts) Assume one is sitting in a room with very unstable Wi-Fi signal and is downloading a big file via a cell phone. Sometimes the Wi-Fi signal is ON, but sometimes it is OFF. According to modern settings, a phone will use Wi-Fi if the Wi-Fi signal is ON, but it will use 4G LTE if the Wi- Fi signal is OFF. Assume the person will stay in the room for 2 minutes (i.e. 120 seconds). The phone will switch between the Wi-Fi signal and the 4G LTE signal back and forth to download the big file, depending on the status of the Wi-Fi signal. The switching time between one signal to another can be ignored. Assume that the phone will check whether the Wi-Fi signal is ON at every second, and if it is ON, the phone will use Wi-Fi to download data in that second. Otherwise, the phone will use 4G LTE to download data in that second. Whether the Wi-Fi signal is ON or OFF is random, but the 4G LTE signal is always available. The signal checking time can be ignored. The downloading speed in Wi-Fi is 1.2 Mbytes/second, and it is 0.8 Mbytes/second in 4G LTE environment. The Wi-Fi signal is free, but the 4G LTE signal charges 0.5 dollar/second. Please write a program that simulates the downloading process in those 2 minutes. You do not have to simulate the "clock" time in your code, just use 120 iterations to simulate the procedure. The program should print the following statistics at the end (i.e. after the loop), and then the program terminates. a. The total bytes the phone downloads (in Mbytes). b. The total bytes downloaded in Wi-Fi environment (in Mbytes). c. The total bytes downloaded in 4G LTE environment (in Mbytes). d. The price for using the 4G LTE signal (in dollars). Submission Requirement: Please upload your Java source code (.java file) to Blackboard Assignment 5 section. Clues: You may want to use the return value of Math.random() to simulate the fact whether the Wi-Fi signal is ON or OFF. STOP at here and think about how to use and interpret its return value. If you need further information, please follow the arrow below. You can follow our examples on slides to randomly generate either of two values (0 or 1), then you can use value 0 to indicate "Wi-Fi ON", and value 1 to indicate "Wi-Fi OFF".
Expert Answer:
Answer rating: 100% (QA)
Heres the program that simulates the downloading process according to the requirements you provided ... View the full answer
Related Book For
Strategic Management Concepts And Cases A Competitive Advantage Approach
ISBN: 9780136120988
13th Edition
Authors: Fred R. David
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
A yo-yo moves downward until it reaches the end of its string, where it "sleeps." As it sleeps-that is, spins in place-its angular speed decreases from 35 rad/s to 25 rad/s. During this time it...
-
Behavioral economists have different views of the anomalies uncovered by experiments. Some view the anomalies as evidence of mistakes in decision making. Others view the anomalies as providing a new...
-
Discuss the meaning of the specific heat of water which is represented by the formula: specific heat of water = 1.00 cal/(g C). Given that 1.00 calorie is needed to increase the temperature of 1.00...
-
Inland Equipment uses the allowance method to account for uncollectible accounts. On December 31,2010, Allowance for Uncollectible Accounts has a $600 credit balance. Journalize the year-end...
-
Wilm Schmidt, the owner of Wilm?s Window Washing Services, had difficulty getting the debits to equal credits on the January 31, 2020, trial balance. The following errors were discovered: a. Schmidt...
-
Instructions: Watch the video titled "Human Head Transplant" (Links to an external site.)Links to an external site. and write a short 3 paragraph analysis of the video. The analysis should identify...
-
Cherry Cotta makes custom ordered clay pots for residential gardens. Below is cost information regarding its latest job. a. Materials were purchased on account. $18,996 purchased b. A materials...
-
Benedetta Company has the following information about inventory costs Total Cost to place order =P50 Total Cost to carry one unit =P4 Economic Order Quantity=7 000 units . What is the company's...
-
The uniform rectangular relief gate AB has a weight of 8000 lb and a width of 4 ft. Determine the specific weight of the fluid if a minimum depth h= 5.626 ft of the fluid within the container is...
-
On February 1, 2024, Wolf Incorporated issued 10% bonds dated February 1, 2024, with a face amount of $240,000. The bonds sold for $287,503 and mature in 20 years. The effective interest rate for...
-
Ropalique is a popular clothing brand in the country Wesabania. The company wants to expand its market and decides to establish itself in the country Tristonville. To accomplish this, Ropalique...
-
The following selected transactions relate to liabilities of Rose Dish Corporation. Rose's fiscal year ends on December 31. 2024 February 3 Negotiated a revolving credit agreement with Second Bank,...
-
Teal Inc. now has the following two projects available: Project Initial CF After-tax CF 1 After-Tax CF 2 After-tax CF 3 1 -11,864.01 5,250 6,125 6,500 2 -3,336.42 3,750 3,150 Assume that R F =...
-
O O O O Locating device is classified as :Select one a. Both a and b b. Text input devices c. None of the above d. Graphics input devices
-
Find the intercepts and then graph the line. (a) 2x - 3y = 6 (b) 10 - 5x = 2y
-
In performing strategic management case analysis, you can find information about the respective companys actual and planned strategies. Comparing what is planned versus what you recommend is an...
-
This exercise gives you the opportunity to evaluate your universitys major strengths and weaknesses. As will become clearer in the next chapter, an organizations strategies are largely based upon...
-
This exercise can improve your understanding of various strategies by giving you experience classifying strategies. This skill will help you use the strategy-formulation tools presented later....
-
A survey of 250 members from an organized union of over 20,000 members. In Exercises 1120, determine whether the data set is a population or a sample. Explain your reasoning.
-
The carbon monoxide levels of 12 of 49 people who escaped a burning building. In Exercises 1120, determine whether the data set is a population or a sample. Explain your reasoning.
-
The annual revenue of each team in a pro sports league. In Exercises 1120, determine whether the data set is a population or a sample. Explain your reasoning.
Study smarter with the SolutionInn App