Statistics are often calculated with varying amounts of input data. Write a program that takes any...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the max and average. A negative integer ends the input and is not included in the statistics. Assume the input contains at least one non-negative integer. Output the average with two digits after the decimal point followed by a newline, which can be achieved as follows: System.out.printf("%.2f\n", average); Ex: When the input is: 15 20 0 3 -1 the output is: 20 9.50 450974 1755466.qx3zqy7 LAB ACTIVITY 1 import java.util.Scanner; 2 3 public class LabProgram { 4 5 3.15.1: LAB: Varied amount of input data 6 7 8 public static void main(String[] args) { /* Type your code here. */ } LabProgram.java 0/10 Load default template... Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the max and average. A negative integer ends the input and is not included in the statistics. Assume the input contains at least one non-negative integer. Output the average with two digits after the decimal point followed by a newline, which can be achieved as follows: System.out.printf("%.2f\n", average); Ex: When the input is: 15 20 0 3 -1 the output is: 20 9.50 450974 1755466.qx3zqy7 LAB ACTIVITY 1 import java.util.Scanner; 2 3 public class LabProgram { 4 5 3.15.1: LAB: Varied amount of input data 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)
CORAL PROGRAM integer x integer sum integer avg integer max integer len Input anum... View the full answer
Related Book For
Practical Management Science
ISBN: 978-1305250901
5th edition
Authors: Wayne L. Winston, Christian Albright
Posted Date:
Students also viewed these programming questions
-
How do omics technologies, such as genomics, transcriptomics, proteomics, and metabolomics, synergistically integrate to provide a comprehensive understanding of biological systems, and what are the...
-
Social Media, Inc. (SMI) has two services for users. Toot!, which connects tutors with students who are looking for tutoring services, and TIX, which can be used to buy, sell, or exchange event...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
A certain apple bruises if a net force greater than 9 . 5 N is exerted on it . Would a 0 . 1 3 k g apple be likely to bruise if it falls 1 . 8 m and stops after sinking 0 . 0 5 m into the grass?...
-
If the maximum force that any member can support is 4 kN in tension and 3 kN in compression, determine the maximum force P that can be applied at joint B. Take d = 1m. Up-
-
Dr. Krawchuk made deposits of $2000 to his RRSP at the end of each calendar quarter for six years. He then left general practice for specialist training and did not make further contributions for 2...
-
Consider an uncertain constraint aTx b, where aao+u, ||u|| 1. In other words, we have a linear inequality where the data vector a is uncertain, but rather than giving a stochastic characterization,...
-
Theory of constraints, throughput contribution, quality, relevant costs. Aardee Industries manufactures pharmaceutical products in two departments: Mixing and Tablet-Making. Additional information on...
-
Helen invests a total of 8,500 in three interest earning accounts. The amount of money invested in each account at the beginning of the year are x, y and z. The annual rates of interest are 2%, 3%...
-
On December 31, 2020, Helena Company, a California real estate firm, received two $18,000 notes from customers in exchange for services rendered. The 8% note from El Dorado Company is due in nine...
-
1. Tik made a loan of P10,000 in writing from his good friend Tok to be paid on April 30, 2021. Yesterday, Tik asked Tok if he could extend the due date since he (Tik) has no income due to the...
-
system specifications: = 5 GHz fe B = 20MHz Consider a wireless LAN system with the follwoing HTX = 2 dB GRX = 2 dB Fading margin = 16 dB Path loss 90 dB PTX = 20 dBm TX losses: 3 dB Required SNR: 5...
-
According to the consumer behavior model, the buyer's black box consists of buyer processes and characteristics. Explain why this test is called a Black box.?
-
Write a SPIM assembly language program convert.s. The program will do the following: 1. Prompt the user to enter a letter indicating Celsius or Fahrenheit C or c indicates that temperature entered...
-
Topic: Consolidation worksheet with adjustment entries for intragroup transactions: inventories, PPE, services On 1 July 2 0 1 9 , Naomi Ltd acquired all the issued shares of Ashley Ltd . The...
-
Advertising, Public Relations, and Sales Promotions , a well-known rule of thumb in the advertising industry is "Sell the sizzle, not the steak." The goal is to sell the benefits, e.g. what the...
-
At year-end, Harari Sales has a Bonds payable balance of $40,000 and a Discount on bonds payable of $2,100. On the balance sheet, how will this information be shown? O A. $40,000 less discount of...
-
What is your opinion of advertising awards, such as the Cannes Lions, that are based solely on creativity? If you were a marketer looking for an agency, would you take these creative awards into...
-
Modify the warehouse location model so that customers always travel in horizontal or vertical directions. For example, this means that if a customers coordinates are (5, 10) and a warehouse is...
-
A laundromat has five washing machines. A typical machine breaks down once every five days. A repairman can repair a machine in an average of 2.5 days. Currently, three repairmen are on duty. The...
-
Starting with the finished version of Example 9.2, change the decision criterion to maximize expected utility, using an exponential utility function with risk tolerance $5000 (really $5 million)....
-
Let us consider a call option with maturity \(T=1\) year and strike price \(\$ 11\). The current price of the stock share is \(\$ 10\), and the riskfree interest rate is \(10 \%\). The two possible...
-
Let us consider the PDE with terminal condition In order to apply the representation theorem, we observe that \(r=0\), \((x t)=\), and , so that the underlying stochastic process boils down to a...
-
Let us consider the same setting as Example 13.4: \(S_{0}=K=50\), \(r=01, \quad=04\), and time-to-maturity is \(T=5/12\) (here we take \(t=0)\). The calculation is as follows: This exact result may...
Study smarter with the SolutionInn App