Write a program that first gets a list of integers from input. The input begins with...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Assume that the list will always contain fewer than 20 integers. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50,60,75, The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75. For coding simplicity, follow every output value by a comma, including the last one. Such functionality is common on sites like Amazon, where a user can filter results. LAB ACTIVITY 5.16.1: LAB: Output values below an amount 1 import java.util.Scanner; 2 3 public class LabProgram { 4 5 6 7 8 9 10} 11 LabProgram.java public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int[] userValues = new int[20]; // List of integers from input /* Type your code here. / } 0/10 Load default template... When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This adjustment can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by dividing all values by the largest value. The input begins with an integer indicating the number of floating-point values that follow. Assume that the list will always contain fewer than 20 floating-point values. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf("%.2f", yourValue); Ex: If the input is: 5 30.0 50.0 10.0 100.0 65.0 the output is: 0.30 0.50 0.10 1.00 0.65 The 5 indicates that there are five floating-point values in the list, namely 30.0, 50.0, 10.0, 100.0, and 65.0. 100.0 is the largest value in the list, so each value is divided by 100.0. For coding simplicity, follow every output value by a space, including the last one. 484934.3417574.37 LAB ACTIVITY 5.17.1: LAB: Adjust list by normalizing 1 import java.util.Scanner; 2 3 public class LabProgram { 4 5 6 7} 8 public static void main(String[] args) { /* Type your code here. / } LabProgram.java 0/10 Load default template... Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Assume that the list will always contain fewer than 20 integers. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50,60,75, The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75. For coding simplicity, follow every output value by a comma, including the last one. Such functionality is common on sites like Amazon, where a user can filter results. LAB ACTIVITY 5.16.1: LAB: Output values below an amount 1 import java.util.Scanner; 2 3 public class LabProgram { 4 5 6 7 8 9 10} 11 LabProgram.java public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int[] userValues = new int[20]; // List of integers from input /* Type your code here. / } 0/10 Load default template... When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This adjustment can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by dividing all values by the largest value. The input begins with an integer indicating the number of floating-point values that follow. Assume that the list will always contain fewer than 20 floating-point values. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf("%.2f", yourValue); Ex: If the input is: 5 30.0 50.0 10.0 100.0 65.0 the output is: 0.30 0.50 0.10 1.00 0.65 The 5 indicates that there are five floating-point values in the list, namely 30.0, 50.0, 10.0, 100.0, and 65.0. 100.0 is the largest value in the list, so each value is divided by 100.0. For coding simplicity, follow every output value by a space, including the last one. 484934.3417574.37 LAB ACTIVITY 5.17.1: LAB: Adjust list by normalizing 1 import java.util.Scanner; 2 3 public class LabProgram { 4 5 6 7} 8 public static void main(String[] args) { /* Type your code here. / } LabProgram.java 0/10 Load default template...
Expert Answer:
Answer rating: 100% (QA)
Answer Python program this list stores the integers listofintegers prompting user for number of i... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
A payment on a loan is $650 a month for 6 years. The principle was $25,000. What was the simple interest rate? Write as a percent with one decimal place.
-
Transform the E-R model of project2 into a relational model. TransactionNo Date Hired Education Employee Address NumberOfItems Email 100 MemberD Name Transaction D Member TypeName Member Classify...
-
A fragile man in his 80s has many sensory and motor deficits from a cerebrovascular accident. When his heart stops, he is resuscitated, and he awakens to find himself hooked up to tubes and machines....
-
Give examples of three exceptions to the Cardozo rule of foreseeability.
-
Solve Prob. 10.97 knowing that 400 l = mm and k = 1.25kN/m. Problem 10.97: Bars AB and BC each of length l and of negligible weight are attached to two springs each of constant k. The springs are...
-
A body mass index (BMI) of more than 25 is considered unhealthy. The Minitab output given is from 50 randomly and independently selected people from the NHANES study. Test the hypothesis that the...
-
Write requirements for the following products and services: a. Computer. b. Airplane. c. Food Processor. d. Online Banking e. Life Insurance. f. Party Planning.
-
Gunkelson Company sells equipment on September 30, 2014, for $18,000 cash. The equipment originally cost $72,000 and as of January 1, 2014, had accumulated depreciation of $42,000. Depreciation for...
-
A stock is expected to increase or decrease by 20% every 6 months over the next year. The current stock price is $50. The 6-month riskfree rate is 10% (semi-annually compounded). (a) (15 pts) What...
-
Kenmare Architects Ltd. (KAL) was incorporated and commenced operations on January 1, 2014. Sheila Kenmare, the company's only employee, consults with various clients and uses expensive equipment to...
-
A man is pacing back and forth along a straight line. The man's velocity can be modeled by v(t) = 2.31n (3+2t) - feet per minute for 0t 120 minutes. (a) Find the acceleration of the man at t = 20...
-
During the past year, Perel Corporation had profit of $126,000, its accounts receivable decreased by $3,500 and its accounts payable decreased by $4,500. What would be the company's cash flows from...
-
What are examples of (social) systems that social workers interact with? 2. What did states do in response to the social norm shift from community responsibility to individual responsibility. 3. What...
-
What is law of one piece? According to law of one price, if a Honda Accord costs $20,000 in the U.S. then at an exchange rate of 149.99 (Yen) /$, the Honda Accord should cost ________ in Japan....
-
Define Secondary Traumatic Stress, Compassion Fatigue aka burnout, and self - care. Then explain how YOU personally can be affected and what steps would you do for selfcare? Question: Define Trauma...
-
What types of federal taxes can be managed through the Electronic Federal Tax Payment System (EFTPS)? Explain briefly
-
1. In the context of the Capital Asset Pricing Model (CAPM) the relevant measure of risk is A. unique risk. B. beta. C. standard deviation of returns. D. variance of returns. E. none of the above.
-
Comptech Ltd is a manufacturer of optical equipment. In September 2019, Ed Thompson the Chief Research Officer, attended a conference in Switzerland that focused on optical developments for the 21st...
-
Here is a header file: // golf.h -- for pe9-1.cpp const int Len = 40; struct golf { char fullname[Len]; int handicap; }; // non-interactive version: // function sets golf structure to provided name,...
-
Which member functions are special member functions, and what makes them special?
-
Redo Listing 7.15 without using the array class. Do two versions: a. Use an ordinary array of const char * for the strings representing the season names, and use an ordinary array of double for the...
-
Demonstrate that for a closed path \(\operatorname{Tr} U_{\gamma}(x, x)\) is gauge invariant, where \(U_{\gamma}\left(x_{0}, x_{1} ight)\) is defined by Eq. (26.9).
-
Use Stokes' theorem [Eq. (27.5)] to prove that Eq. (27.4) leads to Eq. (27.6). Data from Eq. 27.4 Data from Eq. 27.5 Data from Eq. 27.6 = z ) ); A dr. - SA dr) = f A dr.
-
Prove the result of Eq. (26.10) that a path-dependent representation of a gauge group is sensitive to a gauge transformation only at the endpoints of the path.
Study smarter with the SolutionInn App