Write a
Your program must contain at least the following functions: a function that calculates and returns the mean and a function that calculates the standard deviation.
Trending nowThis is a popular solution!
Chapter 6 Solutions
C++ Programming: From Problem Analysis to Program Design
- Write a program that reads integers between 1 and 100 and counts the occurrences of each. Assume the input ends with 0. Write a program that reads integers between 1 and 100 and counts the occurrences of each. Assume the input ends with 0. Here is a sample run of the program: Enter integers from 1-100 (input 0 value to end inputs): 2 5 6 5 4 3 23 43 2 02 occurred 2 times3 occurred 1 time4 occurred 1 time5 occurred 2 times6 occurred 1 time23 occurred 1 time43 occurred 1 timearrow_forwardUse python The speeding ticket fine policy in Wonderland-Bemidji is $50 plus $5 for each mph over the limit, plus an additional penalty of $200 for any speeds over 90mph. Write a program that accepts a speed limit (<= 90) and a clocked speed, and either outputs a message indicating the speed was legal, or prints the amount of the fine if the speed is illegal.arrow_forwardWrite a program that calculates the equivalent resistance of a circuit. n electrical resistors with resistance values R1, R2,.., Rn are said to be connected in parallel if the same voltage is applied across each. Their equivalent resistance Reg is related to the values R1, R2, ..., Rn by: 1 1 1 1 + +...+ R R R, R. "eq Write a program that prompts the user to enter the resistance of n resistors. The user should be prompted continuously by using a while loop until a zero or negative value is entered (the program should count the number of resistors n entered by the user and store the values in an array). Use another separate loop to print the resistance values entered by the user and the equivalent resistance Reg. Test your program with R1= 1 kn, R2= 2 kn, R3= 4 kQ and R4= 8 kQ.arrow_forward
- Write a program that converts degree Kelvin(TK) to degrees Fahrenheit (TF)arrow_forwardWrite a program that generates a random two-digit integer. The program prompts the user to predict the generated number by entering a two- digit integer, and then determines the accuracy of the user’s prediction according to the following rules:If the user’s prediction matches the generated number exactly, the accuracy is 100%. If one digit in the user’s predicted number matches a digit in the gener- ated number, the accuracy is 50%. If none of the digits in user’s predicted number matches with the generated number, the accuracy is 0%.arrow_forward3. Write a program that accepts two input numbers and compute the Greatest Common Divisor using do-while To get the GCD of another input number, type Y or y; otherwise, type N or n to quit the program. Sample Output: Enter the value of the first number: 10 Enter the value of the second number: The Greatest Common Divisor of 10 and 6 is 2 Type Yly if you want to try again. Type N/n to exit. :arrow_forward
- Write a program using integers userNum and x as input, and output userNum divided by x four times. Ex: If the input is: 2000 2 the output is: 1000 500 250 125 Note: In Coral, integer division discards fractions. Ex: 6 / 4 is 1 (the 0.5 is discarded). 333666.1636490.qx3zqy7arrow_forwardWrite a program that accepts 3 decimal numbers as input and outputs their sumarrow_forwardPerform the following using DEV-C++ Show your solution Write a program that determines a student’s grade. It reads four test scores (between0 and 100) and calculates the grade based on the following rules: If the average score is 90 or more, the grade is ‘A’. If the average score is between 80 and 90, the grade is ‘B’. If the average score is between 70 and 80, the grade is ‘C’. If the average score is between 60 and 70, the grade is ‘D’. If the average score is less than 60, the grade is ‘F’.arrow_forward
- i need the answer quicklyarrow_forwardWrite a Python (or R) program that asks the user to enter an integer (X), then: Determines if X is prime or not • If X is not prime, compute and print the factors of that integer X • Evaluate and print the equation Y=8X²+ 1, for X values from -5 to 5 using the range function and for looparrow_forward1. Write a program that asks the user to enter n and then it computes the value of the sum: 12 + 22+32 + +n? = Ei? ... check" whenn = 200, the answer shou; ld be 2686700 2. The total resistance of n resistors in parallel is: 1 = R Suppose we have a network of two resistors with the values 400 Q and 200 . Then our equation would be: 1 1 1 R 400 * 200 and the total resistance of our two-resistor network is 133.3 Q. Write a program to compute the total resistance for any number of parallel resistors.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education