Find and FIx the error } public class Examen{ float[] arrglo; float suma; int contNegativos; public Examen
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
} public class Examen{ float[] arrglo; float suma; int contNegativos; public Examen () { this.arrglo-new float [15]; this.suma=0; this.contNegativos=0; } public void SetElemento (int pos, float valor) { if (pos <0 || pos>14) throw new IndexOutOfBoundsException("Invalid pos value!"); this.arrglo[pos]=valor; } public void calcular Suma () { for (int i=0;i <15;i++) { this.suma += arrglo [i]; } } public void calcularNegativos () { for (int i=0;i <15;i++) { if(this.arrglo [i] <0) } } this.contNegativos += 1; public void imprimir () { System.out.print ("Array Values: "); for (int i=0;i <15;i++) { System.out.print (arrglo [i]+" "); } System.out.printf(" Suma: %.1f ", suma); System.out.printf("Negativos: %d ", contNegativos); } public class Examen{ float[] arrglo; float suma; int contNegativos; public Examen () { this.arrglo-new float [15]; this.suma=0; this.contNegativos=0; } public void SetElemento (int pos, float valor) { if (pos <0 || pos>14) throw new IndexOutOfBoundsException("Invalid pos value!"); this.arrglo[pos]=valor; } public void calcular Suma () { for (int i=0;i <15;i++) { this.suma += arrglo [i]; } } public void calcularNegativos () { for (int i=0;i <15;i++) { if(this.arrglo [i] <0) } } this.contNegativos += 1; public void imprimir () { System.out.print ("Array Values: "); for (int i=0;i <15;i++) { System.out.print (arrglo [i]+" "); } System.out.printf(" Suma: %.1f ", suma); System.out.printf("Negativos: %d ", contNegativos);
Expert Answer:
Answer rating: 100% (QA)
Solution Answer for the following question The error is resolved and below is the corrected code This problem will be having 2 files 1 Examenjava 2 Pruebajava Following Codes 1 Examenjava public class ... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these operating system questions
-
Todd Mountain Development Corporation is expected to pay a dividend of $ 4 in the upcoming year. Dividends are expected to grow at the rate of 1 3 % per year. The risk - free rate of return is 1 0 %...
-
Headland Music Emporium carries a wide variety of musical instruments, sound reproduction equipment, recorded music, and sheet music Headland uses two sales promotion techniques-warranties and...
-
This question concerns lexical grammars. (a) Tree Adjoining Grammars contain two types of elementary tree. (i) What are these trees called? [1 mark] (ii) If one were building a grammar for English...
-
The HaberBosch process for the production of ammonia is one of the key industrial processes in developed countries. N 2 (g) + 3 H 2 (g) 2 NH 3 (g) (a) Calculate r G for the reaction at 298 K, 800...
-
Why have authorities found it so difficult to regulate the fishing catch in the open ocean to allow for a sustainable yield?
-
Use the zeros of 3 to construct an interpolating polynomial of degree 2 for the following functions on the interval [1, 1]. a. f (x) = ex b. f (x) = sin x c. f (x) = ln(x + 2) d. f (x) = x4
-
Discuss the unique control problems created by EDI.
-
Using the following data from Moontrust Corporations financial statements, compute the receivables turnover and the days sales uncollected. (Round to one decimal place or to the nearest whole day.)...
-
The plastic arrow on a spinner for a child's game stops rotating to point at a color that will determine what happens next. Are the given probability assignments possible? Why or why not? a) Since...
-
Only accept hand-written assignment. Use pen and paper, ipad or tablet, save as pdf file and upload. After uploading your assignment, download and open it to make sure that the file is not corrupted....
-
What steps are frequently followed in managerial decision-making? What is the effect of variable and fixed costs on incremental analysis? What information is important when determining whether or not...
-
At the time of his death in 2 0 2 2 , Donald owned a farm ( a qualified, closely held business ) with a most suitable use value of $ 7 , 3 0 0 , 0 0 0 and a current use value of $ 5 , 1 1 0 , 0 0 0 ....
-
Morganton Company makes one product, and has provided the following information to help prepare the master budget for its first four months of operations: The budgeted selling price per unit is $ 7 0...
-
For a 20-year mortgage of $150,000 at 7% interest, one additional payment of $5,000 is paid on the mortgage after 2 years of making regular payments. How many monthly payments will be eliminated from...
-
How does the phenomenon of trophic cascades manifest within complex ecological networks, and what implications does it hold for ecosystem stability and biodiversity conservation ?
-
Determine the resultant moment in N.m of the three forces acting on the frame about point A. (CCW is +) F=318 N; P= 114 N; Q = 477 N. y B 2 m 2 m 60 P 3 m Q F 3 m A O A. 204.00 N.m B. 69.0 N.m C....
-
Air pollution generated by a steel mill is an example of a) a positive production externality. b) a negative production externality. c) a public good. d) the free-rider problem. State and local taxes...
-
Jud's Manufacturing Company produces one product, Kebo. Because of wide fluctuations in demand for Kebo, the Assembly Department experiences significant variations in monthly production levels. The...
-
Lorch Company uses budgets in controlling costs. The May 2002 budget report for the company's Packaging Department is as follows. The budget amounts in the report were on the master budget For the...
-
Lakem elder Dutch manufactures expensive watch eases sold as souvenirs. Three ol its sales departments are: Retail Sales, Wholesale Sales, and Outlet Sales. The Retail Sales Department is a profit...
Study smarter with the SolutionInn App