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
Concept explainers
Question
This is a debugging question I am stuck on -
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
I have edited the code but it doesn't seem to print right so I am unsure what I missed. The "Enter + STOP + when you want to stop" keeps interjecting which it shouldn't be -
// Application allows user to enter a series of words
// and displays them in reverse order
import java.util.*;
public class DebugEight4
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int x = 0, y;
String array[] = new String[100];
String entry;
final String STOP = "XXX";
StringBuffer message = new
StringBuffer("The words in reverse order are\n");
System.out.println("Enter any word\n" +
"Enter + STOP + when you want to stop");
entry = input.next();
while(!(entry.equals(STOP)))
{
array[x] = entry;
++x;
System.out.println("Enter another word\n" +
"Enter " + STOP + " when you want to stop");
entry = input.next();
}
for(y = x - 1; y > 0; ++y)
{
message.append(array[y]);
message.append("\n");
}
System.out.println(message);
}
}
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 2 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
- A bit confused on where to begin this program. I'm confused by the information I'm being given I think? Honestly I'm not sure. I need to write the program in pseudocode."A dramatic theater has three seating sections. It charges section A seats 20$ each, section B seats 15$ each, and section C seats 10$ each. There are 300 seats in section A, 500 seats in section B, and 200 seats in section C. Design a program that asks for the number of tickets sold in each section, then display the amount of income generated from ticket sales. The program should validate the numbers from each section."I think I know how to finish the program but I'm not sure where I should start. I don't know what variables to declare and I don't know if I need to declare ALL the variables, if any, before the "While" loop.arrow_forwardanswer with proper explanation and step by step solution. can someone help on this using java char symbol & for looparrow_forwardI have an idea and would appreciate some help. Here is my idea: What is my program supposed to do: . I want to be able to create a program that can extract a player's name based on the sport I decide to choose (either football, basketball, or baseball) and have them be placed on the user's team where they can choose to keep them or remove them from said team. As the season progresses the user will go into the program and input the stats of their players and the program will calculate their fantasy performance based on what the user inputs. The user may also be able to put in, take out, or adjust any stats that are calculated at any time during the season. The user will also take the players and be able to choose from a number of options on what to do with them. I hope to either make it so that multiple users can "play" at the same time against one another with the program, if not then I may try to input at least one other team controlled by the program so that there would be some…arrow_forward
- Can you use Python programming language to wirte this code? Thank you very much!arrow_forwardUse the name "jobe" when you run your program. Find the "answer" in memory using the Labels display. What is the value in hexadecimal at answer? Run your program again with the name 4567. What is the value in hexadecimal at answer? If you select the ASCII button what appears at answer? Based on your observations, what is the byte ordering scheme of the mips processor as implemented in the simulator?arrow_forwardCan someone help me with this program in python? Using this code how can I use the stopwatch module to filll out this table Use the stopwatch module to estimate how long your program runs. stake - initial amount you start with goal - the amount you want to end with (you will either lose it all or make your goal) trials - the number of times you want to run the experiment - run the experiment 100 times to get a more accurate estimate of the probability. Do any empirical analysis using the doubling method. Start with the stake = 500 and goal 1000 and continue to double until the stake = 1000000.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