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
-
Acknowledgement of Country/ies specific to where your pop-ups will be undertaken Benefits of a Pop-Up Playspace (for children, families and communities) Risks and Risk-Hazard Management Including but...
-
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...
-
Find the volume of the solid cut from the sphere r2 + z2 ( (2 by the cylinder r = ( sin (.
-
Enormous firms exist on account of inward economies of scale-cost benefits appreciated by firms creating huge amounts of an item. Enormous firms utilize numerous specialists, and these laborers will...
-
Equipment costing \($290,000,\) with an expected scrap value of \($30,000\) and an estimated useful life of five years, was purchased on January 1, 2016. Calculate the depreciation expense for years...
-
On January 1, 2015, Sledge had common stock of $120,000 and retained earnings of $260,000. During that year, Sledge reported sales of $130,000, cost of goods sold of $70,000, and operating expenses...
-
Reed worked for OSH as an employee at will. She believed that her manager, Mocker, and other employees were embezzling money. When Reed expressed her concern to Mocker, he twisted her arm and pushed...
-
Many Arabic speakers tend to insert a vowel in their pronunciation of English words. The first column has examples from L2ers whose L1 is Egyptian Arabic; the second column has examples from L2ers...
-
Corporate Responsibility (CR) is a form of corporate self-regulation that helps a company to maintain active compliance with the law, ethical standards, and norms. CR strategies encourage the company...
-
How does process simulation assist in conducting risk assessments and hazard analyses, such as HazOp (Hazard and Operability) studies, and what are the benefits of simulation-based safety analysis ?
-
A toy gun is pointed toward the sky. A styrofoam ball of mass 30g is at rest against a spring with a spring constant of 4,000N/m that is compressed 2.5cm. The spring is released causing the ball to...
-
Conduct an A-B-C analysis of the child's behavior. ABC Data Collection Time Antecedent Behavior Consequence How many instances of the problem behavior (tantrums) did you observe? What were...
-
The following information relate to the business of Katwishi as at 31-12-16 K'000 Purchases Sales Returns inwards Returns outwards Debtors 64,700 125,600 6,340 1,900 11,250 Creditors 7,900...
-
Discuss the role of process simulation in the design and evaluation of sustainable processes. How can Life Cycle Assessment (LCA) and simulation be combined to optimize environmental impacts and...
-
Purpose: Using the object-oriented approach in C#, develop a menu-driven GUI based Hotel Reservation System. The system should be able to provide the following: Accept hotel reservation related...
-
What can you do to reduce hunger where you live? To reduce hunger globally?
-
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....
-
The demand curve for most health care is relatively _________ with respect to price.
-
Insurance _________ the price of health care to consumers and _________ the quantity of health care services demanded.
-
The interaction of _________ advances and _________ significantly increased the demand for medical care.
Study smarter with the SolutionInn App