Rainfall Program Modification
Recall that
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Absolute Java (6th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
Problem Solving with C++ (10th Edition)
Starting Out with Java: Early Objects (6th Edition)
Modern Database Management
Computer Science: An Overview (12th Edition)
- (Data processing) Write an array declaration statement that stores the following values in an array named volts: 16.24, 18.98, 23.75, 16.29, 19.54, 14.22, 11.13, and 15.39. Include these statements in a program that displays the values in the array.arrow_forward(Electrical eng.) Write a program that declares three one-dimensional arrays named volts, current, and resistance. Each array should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to store in current are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, and 3.98. The numbers to store in resistance are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9, and 4.8. Your program should pass these three arrays to a function named calc_volts(), which should calculate elements in the volts array as the product of the corresponding elements in the current and resistance arrays (for example ,volts[1]=current[1]resistance[1]). After calc_volts() has passed values to the volts array, the values in the array should be displayed from inside main().arrow_forward(Data processing) Write a program that uses an array declaration statement to initialize the following numbers in an array named slopes: 17.24, 25.63, 5.94, 33.92, 3.71, 32.84, 35.93, 18.24, and 6.92. Your program should locate and display the maximum and minimum values in the array.arrow_forward
- (Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in an array named testvals. The array should be declared in main() and include the values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The variance() function should calculate and return the variance of the data. The variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg() and variance() should be displayed by using cout statements in main().arrow_forwardFor each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program named CheckZips that is used by a package delivery service to check delivery areas. The program contains an array that holds the 10 zip codes of areas to which the company makes deliveries. Prompt a user to enter a zip code, and display a message indicating whether the zip code is in the companys delivery area.arrow_forward(Electrical eng.) Write a program that specifies three one-dimensional arrays named current, resistance, and volts. Each array should be capable of holding 10 elements. Using a for loop, input values for the current and resistance arrays. The entries in the volts array should be the product of the corresponding values in the current and resistance arrays (sovolts[i]=current[i]resistance[i]). After all the data has been entered, display the following output, with the appropriate value under each column heading: CurrentResistance Voltsarrow_forward
- The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. The statement intSales (2) += 10 will _____. replace the 900 amount with 10 replace the 900 amount with 910 replace the 12000 amount with 10 replace the 12000 amount with 12010arrow_forward(Numerical) Write and test a function that returns the position of the largest and smallest values in an array of double-precision numbers.arrow_forwardDesign a roulette wheel which allows the user to enter bets on multiple numbers. Allow the user to stop betting when they enter 0 on a bet. The program will then choose a random number between 0 and 36. If the user wins, they will get back 30 times the amount they bet on that number. The program will print out the winning number as well as how much they won or lost. Create an array to store the numbers the user bet on. Create a corresponding array to store the amount they bet on each number.o int[] bets=new int[36];//To store the person's betso int[] amount =new int[36];//To store the amount of the bet Ask them what numbers they want to bet on and how they want to bet. Store these in the arrays. The program chooses a winning random number. Check to see if any of their bets match the correct number. If they have the correct number tell them this and inform them as to how much they won or lost. If they did not get the correct number tell them this and tell them how much they…arrow_forward
- object oriented programming (OOP) write a program that lets the user to enter the 10 values into the array . the program shoould then largest and the smallest value shoul in the arrayarrow_forwardDesign a program that lets the user enter the total rainfall for each of the 12 months into an array. The program should calculate and display the total rainfall for the year, the average monthly rainfall, the months with the highest and lowest amounts. Using java programmingarrow_forwardDesign a program that lets the user enter the total rainfall for each of 12 months into an array. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts.should be done in simple pseudocodearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning