
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Hello, can you please help me with this Java program : (just solve 1)
1- Write the line number in which there is an error and following each line number briefly explain why.
![Given the following Java program, which is saved in a Java file getEvenSum.java:
1 public class evenSum {
2-
2345678a
6-
private static void main(String[] args) {
calcEvenSum();
}
public void calcEvenSum() {
int total = 0;
//Summing the even integers from 2 to 20
for (int number = 2, number <= 20, number += 2) {
total += number;
}
System.out.println("Sum of even numbers is %d\n", total);
9
10-
11
12
13
14
}
15 }//end class evenSum
Write the line number in which there is an error and following each line number briefly explain why.](https://content.bartleby.com/qna-images/question/1bdd780f-3753-43b2-9812-bf30e8f71e29/775a0f7a-57e3-4d85-bb86-0d42c5b3266b/lem173k_thumbnail.jpeg)
Transcribed Image Text:Given the following Java program, which is saved in a Java file getEvenSum.java:
1 public class evenSum {
2-
2345678a
6-
private static void main(String[] args) {
calcEvenSum();
}
public void calcEvenSum() {
int total = 0;
//Summing the even integers from 2 to 20
for (int number = 2, number <= 20, number += 2) {
total += number;
}
System.out.println("Sum of even numbers is %d\n", total);
9
10-
11
12
13
14
}
15 }//end class evenSum
Write the line number in which there is an error and following each line number briefly explain why.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Please help with the following: in JAVAarrow_forwardcan you give me the code to the folloowing?arrow_forwardPlease Explain the Steps. (In Java Programming) See expected output below. Create a new Java application called "WeightedAvgDropSmallest" (without the quotation marks) according to the following guidelines. The program prompts the user for five to ten numbers all on one line, separated by spaces, calculates the weighted average of all those numbers except the lowest n numbers, where n and the weight are also given by the user, and displays all the numbers, the weight, the number of lowest numbers dropped, and the calculated average to the user. The program uses methods to: Get the numbers used to calculate the average. Get the number of lowest numbers to drop before calculating the average. Get the weight, a double greater than 0 and less than or equal to 1. Calculate the weighted average of the numbers (except the lowest n numbers) entered by the user. Print the results. 1. The first method should take no arguments and return an array list of doubles. 2. The second method…arrow_forward
- Can someone help me pleasearrow_forwardName:- Mit (Question-1) Note:- Please type this java code and also need an output for this given Java program.arrow_forward(PLEASE USE BASIC JAVA NOT COMPLEX I AM A BEGINNER THANKS) Canadian phone number has the following format: +1 (604) 295- 8959 Area Code= Three digits starting with 2-9Prefix= Three digits starting with 2-9Subscriber= Any four digits 0-9Write a java program, using loops, that asks the user to enter a phone number then if correct print theArea Code, Prefix, and Subscriber numbers. If not correct, print what is wrong. Sample run:Enter a number or -99 to quit: +1 (604) 277-9999The number is correct with area code: 604, prefix 277, and subscriber 9999Enter a number or -99 to quit: 1 (104) 277-0123Country code doesn’t start with + and area code doesn’t start with a 2-9 number.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education