
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
thumb_up100%
Can you help debug my program? It's in Java.
Attached: my code screenshot.
Problems:
1) next cannot be resolved or is not a field (lines 16, 19, 22)
2) Scanner cannot be resolved to a variable
3) Syntax error at ), delete this token (line 29)
![package bounds;
import java.util.Scanner;
public class bounds {
public static void main(String[] args) {
try {
int startingNumber, upperBound, stepSize;
Scanner = new Scanner(System.in);
//I made the user questions more friendly
System.out.print("Give me a starting number?");
startingNumber
= Scanner.next.Int();
System.out.print ("Give me the upper limit?");
upperBound
= Scanner.next.Int();
System.out.print("Give me the step size?");
stepSize
= Scanner.next.Int();
System.out.println("starting number:
+ startingNumber + "upper limit:
+ stepSize);
п
+ upperBound + "step size:
%3D
int calc
for
= 0;
(int i = 0, j = 1; startingNumber + i * stepSize) < upperBound; i++, j±±;
{
int i = 0, j = 1;
calc = startingNumber + i * stepSize;
if (j < 10 || (j % 10) !=0) System.out.print(calc +
else
");
%3D
System.out.println(calc);
} catch (Exception e) {
}}](https://content.bartleby.com/qna-images/question/105a6b10-1479-49f6-854d-b98a0aa319bf/b40e2616-9fc8-4c80-9d5b-acda72e5f3ee/h1mk3t8.png)
Transcribed Image Text:package bounds;
import java.util.Scanner;
public class bounds {
public static void main(String[] args) {
try {
int startingNumber, upperBound, stepSize;
Scanner = new Scanner(System.in);
//I made the user questions more friendly
System.out.print("Give me a starting number?");
startingNumber
= Scanner.next.Int();
System.out.print ("Give me the upper limit?");
upperBound
= Scanner.next.Int();
System.out.print("Give me the step size?");
stepSize
= Scanner.next.Int();
System.out.println("starting number:
+ startingNumber + "upper limit:
+ stepSize);
п
+ upperBound + "step size:
%3D
int calc
for
= 0;
(int i = 0, j = 1; startingNumber + i * stepSize) < upperBound; i++, j±±;
{
int i = 0, j = 1;
calc = startingNumber + i * stepSize;
if (j < 10 || (j % 10) !=0) System.out.print(calc +
else
");
%3D
System.out.println(calc);
} catch (Exception e) {
}}
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 3 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
- Create a calculator that only supports division and multiplication operations using Java and a graphical user interface (GUI). Clear, ON, and OFF buttons must all be present.arrow_forwardTwo methods may terminate operations and resolve impasses:arrow_forwardsolve withhh java:- Write the code for the following UML diagram. Input(): Ask user to provide values for color and fuel. Default values for speed is “0” and state is “stopped” addFuel(): Ask user to provide value for fuel to add. Add that value in fuel (attribute) and return value of total fuel. moving(): Ask user to provide the speed of vehicle and fuel Set the value of speed and reduce the fuel (attribute) according to fuel consumption. And also set the state to “Moving”. stop(): This method will display that “Vehicle is stopped” and sets the value of speed to “0” and state to “Stopped” display(): This method will display the attributes value to output like: “Vehicle is stopped. It has red color. It’s speed is 0.0 and fuel is 2.5 Liter”arrow_forward
- Do not copy from other websites (I will downvote) Correct and detailed answer will be Upvotedarrow_forwardcan you give me the code to the folloowing?arrow_forwardObject-Oriented Programming OvalDraw Plus (Java code) Summary: Create a graphical application with Java that that draws an oval Prerequisites: Java, VS Code, and Terminal Create a graphical Java application that runs on Microsoft Windows and MacOS that draws an oval centered in the main application window when the programming starts. The oval should automatically resize and reposition itself when the window is resized. In this activity you will start with our OvalDraw application in our sample code, review the code, and then make incremental improvements to the application. Be sure to make the resulting application uniquely your own by adding standard comments at the top application (i.e. your name, class, etc.), changing the names of variables, and adding small features. Finally, be sure to save your work as you will often be asked to submit it as part of an assignment. Be sure to review the example OvalDraw project in the Java section of our example code repository. Requirement 1:…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