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
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 some of the code but I am unsure how to fix the rest -
// Application looks up home price
// for different floor plans
// allows upper or lowercase data entry
import java.util.*;
public class DebugEight3
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String entry;
char[] floorPlans = {'A','B','C','a','b','c'};
int[] pricesInThousands = {145, 190, 235};
char plan;
int x, fp = 99;
String prompt = "Please select a floor plan\n" +
"Our floorPlanss are:\n" + "A - Augusta, a ranch\n" +
"B - Brittany, a split level\n" +
"C - Colonial, a two-story\n" +
"Enter floorPlans letter";
System.out.println(prompt);
entry = input.next();
plan = entry.charAt(1);
for(x = 0; x < floorPlans.length; ++x)
if(plan == floorPlans[x])
x = fp;
if(fp = 99)
System.out.println("Invalid floor plan code entered");
else
{
if(fp >= 3)
fp = fp - 3;
System.out.println("Model " +
plan + " is priced at only $" +
pricesInThousends[fp] + ",000");
}
}
}
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
- MUST BE WRITTEN IN C++ Write a program so that user can use it to compute and display various statistics for a list of at least 3 values and up to 20 positive real values. The main objectives of this project are to work with menu, arrays, file input, and modules/functions. A menu is available and user can select one of the 4 options from the menu. The program will continue until option 4 is selected. For option 1, process a predefined array in the code with 3 values (73.3 83.4 58.0). User will be able to input an array from the keyboard with a sentinel loop with option 2. Use the following values (73.3 83.4 58.0 11.9 25.1 69.9 45.7 95.0 44.4)as one of your test cases (use-1.0 as a sentinel value). When option 3 is selected, input data from a text file. Use the given p2input.txt Download p2input.txt as a test case. The values in the file are shown below. 73.399.0 83.4 58.0 25.1 69.0 11.9 95.0 74.8 55.0 43.5 47.4 95.6 58.9 52.6 37.7 93.8 19.9 23.9 77.2 You can assume that the user will…arrow_forwardHow would I fill in the blank for this question in pythonarrow_forwardC++ ONLY PLEASE, and please read carefully, i have had people submit wrong answers Assignment 7 A: Rare Collection. We can make arrays of custom objects just like we’ve done with ints and strings. While it’s possible to make both 1D and 2D arrays of objects (and more), for this assignment we’ll start you out with just one dimensional arrays. Your parents have asked you to develop a program to help them organize the collection of rare CDs they currently have sitting in their car’s glove box. To do this, you will first create an AudioCD class. It should have the following private attributes. String cdTitle String[4] artists int releaseYear String genre float condition Your class should also have the following methods: Default Constructor: Initializes the five attributes to the following default values: ◦ cdTitle = “” ◦ artists = {“”, “”, “”, “”} ◦ releaseYear = 1980 ◦ genre = “” ◦ condition = 0.0 Overloaded Constructor: Initializes the five attributes based on values passed…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