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 average (using integer division) and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is: 15 20 0 5 -1 the output is: 10 20 Assume that at least one non-negative integer is input.
Q: Provide a description of the dataset "Google Public Data Explorer". Discuss how the dataset can be…
A: 1) A dataset refers to a collection of structured and organized information that has been made…
Q: What are different modes of addressing data in Datapath architecture? Explain.
A: Datapath architecture involves the design and organization of the circuits responsible for executing…
Q: I need simple print(beginnger python) code for this problem. The output should be similar to the…
A: SOLUTION -I have solved this problem in Python code with comments and screenshots for easy…
Q: placeholder for the Tile objects. But not all the spots are necessarily occupied. When the block is…
A: A Java implementation for managing blocks of tiles. The `Block` class provides functionality to…
Q: How grid computing differs from cloud computing?
A: Grid computing is a form of distributed computing that involves connecting a network of…
Q: how computer technology has changed business
A: Business activity is a process between humans and the barter system. Technological advancements and…
Q: Redefined Outer Name 1 When writing code inside an inner block (such as within a function…
A: It looks like there are a couple of issues in the provided code. Let's address them:The function…
Q: \table[[Q1, Q2, Q3, Q4], [, Q6, Q7, Q8], [Q9, Q10, Q11, Q12], [Q 13, Q14, Q15,]] Which product…
A: The presented tabular structure unveils a system of product categorization denoted by identifiers Q1…
Q: I tried the code from above and I am getting the following feedback. Max points: 30 Earned…
A: The provided Python code is designed to analyze a collection of tweets, extracting and counting the…
Q: I need help with the following please: Write a small program in java. Compile your program. What is…
A: Here's a basic Java program that you can get started with. After that, you can compile the program…
Q: I need a simple Java program example that secures sensitive information. The secure example should…
A: InsecureExample Algorithm:1. Start the program.2. Create a Scanner object to read input.3. Prompt…
Q: Task: Develop a C++ Program for Book Inventory Management You are tasked with creating a C++ program…
A: Input: Prompt user for total number of books.Initialize: Declare an array of structures to store…
Q: b. J: 2 and A = 5 For k = 1 to 7 do A := A + 1
A: Here in the both questions we have to deal with control statement. There are 4 types of control…
Q: Fines for illegal parking in East Overshoe are $10. However, for each day the fine goes unpaid,…
A: The big-O notation is a notation used to describe the upper bound or worst-case scenario of the…
Q: Look at the following graphs. Notice that there are odd-degree vertices. Identify the odd- degree…
A: In a graph, number of odd degree vertices are always evenA graph has vertices and edges. Edges are…
Q: 8.14 Suppose A is a 10 x 10 array of (4-byte) integers, indexed from [0][0] through [9][9]. Suppose…
A: Array access patterns impact performance in computer programs. Contiguous allocation (row major) and…
Q: SVM - From above data training, find the equation Exercise - Assume you have x1 = 2, hyperplane and…
A: The given question involves training a Support Vector Machine (SVM) on the given data and then using…
Q: How can a router split up broadcast domains? 1- It forwards all broadcasts to the nearest switch. 2-…
A: Routers are essential to network architecture because they make it easier for data to move across…
Q: What rule of inference is used in "It is either hotter than 100 degrees today or the pollution is…
A: This scenario involves logical inference, and the appropriate rule at play is tested.
Q: Use the problem statement below. In your post: Identify the required input and output (document)…
A: The given problem statement involves calculating the total square footage of a house given the…
Q: 2. Given the logic symbol for the 7485 IC (4-bit comparator). Use it to compare two binary numbers…
A: In the heart of digital electronics lies a silent arbiter of reality, a grasp of assessment – the…
Q: Here's the problem " (Math: approximate the square root) There are several techniques for…
A: In this question we have to write and fix the given Java program which calculates the square root of…
Q: .4 Each of the following languages is the intersection of two simpler languages. In each part,…
A: SOLUTION -In the area of language processing, where strings of letters dance and styles emerge, DFAs…
Q: I have this java code " import java.util.Scanner; public class Main3 { public static void…
A: In this question we have to write a code in java program for monthly payment details for a loan over…
Q: A key element of extreme programming is:
A: Extreme programming is the software development process. It is used to produce high quality…
Q: In Java, what are the different ways that sensitive data might be exposed and therefore susceptible…
A: Sensitive data in Java can be exposed and vulnerable to hackers in several ways:1. Memory Exposure:…
Q: 1. In a computer, what is a bus, and what does it connect to?
A: In a computer system, a bus is a communication pathway that allows data to be transferred between…
Q: 1. Let A, B and C be atomic propositions. We are given a proposition I = (¬A⇒B) ⇒ ¬(C^¬A). Write the…
A: Note: According to the guidelines, I can answer the first 3 questions. Please consider this
Q: What are some factors that affect the sensitivity of data in a Java application? What might be an…
A: Java is a high-level, cross-platform, object-oriented programming language created by Sun…
Q: What are the types of database? What are the advantages of using a database?
A: A database is a structured collection of data that is organized and stored in a way that allows for…
Q: In this question, you are provided with two unsigned binary numbers, A and B. You are asked to…
A: The concept revolves around the two's complement representation of numbers and how it is used to…
Q: Please create a Python script to solve the following image.
A: The objective of the question is to create a Python script that computes a vector of y values based…
Q: QUESTION 2: In this exercise, we consider the natural logarithmic function: y(x)= Inax, where a is a…
A: We need to write a Matlab code to plot the given logarithm functions.*** In Matlab, the natural…
Q: distance
A: The Hamming distance, or the number of points at which the corresponding bits are different, can be…
Q: What is called functional dependency? Why functional dependency is important to design DBMS?
A: Functional dependency is a concept in database management that describes the relationship between…
Q: For this assignment, you'll build an application that calculates the car loan amortization (month by…
A: For writing a C# program you can use Visual Studio or any online C# editor/compiler.
Q: Write code that iterates while userNum is less than 12. Each iteration: Put userNum to output. Then,…
A: The objective of the question is to write a program that iterates while a variable 'userNum' is less…
Q: 1. PART Evaluation and optimization: A schema of the ski shop information system is given: Customer…
A: Relational algebra is a mathematical system designed for articulating and handling relationships…
Q: The nth harmonic number is defined non-recursively as: H(n)=1+1/2+1/3+1/4+...+1/n Come up with a…
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT.....
Q: Discuss compliance and risk management strategies specific to series ecognition patterns and the…
A: SQL injection is a type of cyber attack where an attacker inserts malicious SQL code into an…
Q: Create a Python program for managing a music store's inventory system. The inventory information is…
A: Read the existing inventory from "music_inventory.txt" into a dictionary.Display the current…
Q: Using object-oriented principles, write a C++ program that will analyze a year's worth of rainfall…
A: The objective of the question is to create a C++ program that reads rainfall data from a file,…
Q: Predict what will be displayed when the following Python commands are executed. Then try…
A: The question is asking to predict the output of the given Python commands and then explain how they…
Q: in java Integer numInts is read from input representing the number of integers to be read next. Use…
A: Algorithm: ReadIntegersAndOutputGrapes1. Open the input file ("Input.txt").2. Create a Scanner to…
Q: What is data normalization? Write Advantages of Data Normalization?
A: Data normalization is a process in database design that organizes and structures data in a…
Q: Describe briefly how blockchain technology can be used to secure cloud
A: Blockchain technology is a decentralized and distributed ledger system that securely records and…
Q: Mention some of the advantages of distributed database management systems over conventional database…
A: A Distributed Database Management System (DDBMS) is a database management system that manages a…
Q: Let U = {2, 4, 5, 6, 8, 10, 12}, S = {2, 4, 5, 10}, and T = {2, 6, 8, 10}. (U is the universal set.)…
A: Some questions related to set theory are given that need to be answered.Note: Multiple questions are…
Q: The following equation can be used to compute values of y as a function of x: y=bea sin (bx)…
A: Algorithm: Compute and Plot1. Import necessary libraries 1.1. Import numpy as np 1.2. Import…
Q: Draw the state diagram of an FSM which accepts a binary stream and outputs a ‘1’ whenever it detects…
A: Introduction:In designing a Finite State Machine (FSM) to detect a pattern "1111" in a binary stream…
Statistics are often calculated with varying amounts of input data. Write a
Ex: When the input is:
15 20 0 5 -1
the output is:
10 20
Assume that at least one non-negative integer is input.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
- Statistics are often calculated with varying amounts of input data. Write a program that prompts for and takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Example program run (the user types only the numbers, in this case 15 20 0 5 -1): Enter numbers separated by spaces, with a negative number to quit: 15 20 0 5 -1 Average = 10 Max = 20 #include <iostream>using namespace std;/* program that prompts for and takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Example program run (the user types only the numbers, in this case 15 20 0 5 -1): Enter numbers separated by spaces, with a negative number to quit:15 20 0 5 -1 Average = 10 Max = 20*/ int main() { /* Type your code here. */ return 0;}Transient PopulationPopulations are affected by the birth and death rate, as well as the number of people who move in and out each year. The birth rate is the percentage increase of the population due to births and the death rate is the percentage decrease of the population due to deaths. Write a program that displays the size of a population for any number of years. The program should ask for the following data: The starting size of a population P The annual birth rate (as a percentage of the population expressed as a fraction in decimal form)B The annual death rate (as a percentage of the population expressed as a fraction in decimal form)D The average annual number of people who have arrived A The average annual number of people who have moved away M The number of years to display nYears Write a function that calculates the size of the population after a year. To calculate the new population after one year, this function should use the formulaN = P + BP - DP + A - Mwhere N is the…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:printf("%0.2lf\n", average); Ex: When the input is: 15 20 0 3 -1 the output is: 20 9.50 given c code #include <stdio.h> int main(void) { /* Type your code here. */ int max, v; scanf("%d", &v); while (v >= 0) { scanf("%d", &v); if (max < v){ max = v; } } printf("%d", max); return 0; }
- Given the sample code above in generating a random number. Create a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don't display the computer's choice yet.) 2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer.) 13. The computer's choice is displayed. 4. A winner is selected according to the following rules: a. If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) b. If one player chooses scissors and the other player chooses paper, then scissor wins. (Scissors cuts paper.) c. If one player chooses paper and the other player…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 average and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is 15 20 0 5 -1, the output is: 10 20 You can assume that at least one non-negative integer is input. Code need to be writing in coral languageThe Café Noir Coffee Shop wants some market research on its customers. When a customer places an order, a clerk asks for the customer’s zip code and age. The clerk enters that data as well as the number of items the customer orders. The program operates continuously until the clerk enters a 0 for zip code at the end of the day. When the clerk enters an invalid zip code (more than 5 digits) or an invalid age (defined as less than 10 or more than 110), the program reprompts the clerk continuously. When the clerk enters fewer than 1 or more than 12 items, the program reprompts the clerk two more times. If the clerk enters a high value on the third attempt, the program accepts the high value, but if the clerk enters a negative value onthe third attempt, an error message is displayed and the order is not counted. At the end of the program, display a count of the number of items ordered by customers from the same zip code as the coffee shop (54984), and a count from other zip codes. Also…
- Given the sample code below in generating a random number. Create a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated.If the number is 1, then the computer has chosen rock. If the number is 2, then thecomputer has chosen paper. If the number is 3, then the computer has chosen scissors.(Don’t display the computer’s choice yet.)2. The user enters his or her choice of “rock”, “paper”, or “scissors” at the keyboard.(You can use a menu if you prefer.)3. The computer’s choice is displayed.4. A winner is selected according to the following rules:a. If one player chooses rock and the other player chooses scissors, then rock wins.(The rock smashes the scissors.)b. If one player chooses scissors and the other player chooses paper, then scissorwins. (Scissors cuts paper.)c. If one player chooses paper and the other player chooses rock, then…write a program in python Write a program that will allow a student to enter their name and then ask them to solve 10 mathematical equations. The program should display two random numbers that are to be added, such as: 247 + 129 The program should allow the student to enter the answer. The program should then display whether their answer was right or wrong, and accumulate the right values. After the 10 questions are asked, calculate the average that was correct. Then display the student name, the number correct, and the average correct in both decimal and percentage format. In addition to any system functions you may use, you might consider the following functions: A function that allows the student to enter their name. A function that gets two random numbers, anywhere from 1 to 500. A function that displays the equation and asks the user to enter their answer. A function that checks to see if the answer is correct and accumulates the number correct. A function that calculates the…At a certain university, students have to submit their exams online. The administration decides that for each minute of late submission, 5 points are deducted. Write a program that asks the user for his initial grade and the late submission time (in minutes), and then displays the final result. Sample Run 1: Enter your initial grade: 82 Enter the late submission time (in minutes): 6 Your final grade is 52 Sample Run 2: Enter your initial grade: 115 Grades should be between 0 and 100 Sample Run 3: Enter your initial grade: 43 Enter the late submission time (in minutes): 10 Your final grade is 0
- At a certain university, students have to submit their exams online. The administration decides that for each minute of late submission, 5 points are deducted. Write a program that asks the user for his initial grade and the late submission time (in minutes), and then displays the final result. Sample Run 1: Enter your initial grade: 82 Enter the late submission time (in minutes): 6 Your final grade is 52 Sample Run 2: Enter your initial grade: 115 Grades should be between 0 and 100 Sample Run 3: Enter your initial grade: 43 Enter the late submission time (in minutes): 10 Your final grade is 0 Sample Run 4: Enter your initial grade: 72 Enter the late submission time (in minutes): -2 Time should be positiveIn various applications, you are often asked to compute the mean and standard deviation of data. The mean is simply the average of the numbers. The standard deviation is a statistic that tells you how tightly all the various data are clustered around the mean in a set of data. For example, what is the average age of the students in a class? How close are the ages? If all the students are the same age, the deviation is 0. Write a program that prompts the user to enter any number of values into a double array, and then calculates and displays the mean and standard deviations of these numbers using the following formulas: mean)? 2i +x2 + .. + xn i=1 i=1 mean = deviation = п - 1In various applications, you are often asked to compute the mean and standard deviation of data. The mean is simply the average of the numbers. The standard deviation is a statistic that tells you how tightly all the various data are clustered around the mean in a set of data. For example, what is the average age of the students in a class? How close are the ages? If all the students are the same age, the deviation is 0. Write a program that prompts the user to enter any number of values into a double array, and then calculates and displays the mean and standard deviations of these numbers using the following formulas: (z - mean) z+z3+ *** +zn deviation = mean = n-1 Required Methods You must write your program so that the following methods are defined/implemented and used (called): • /* Compute the deviation of double values */ public static double deviation (double[] x) • /* Compute the mean of an array of double values */ public static double mean (double[] x) Sample Run (user input…