EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Question
Chapter 6, Problem 1DE
a.
Program Plan Intro
To fix the error in given program and to debug it.
b.
Program Plan Intro
Program Plan:
To fix the error in given program and to debug it.
c.
Program Plan Intro
Program Plan
To fix the error in given program and to debug it.
d.
Program Plan Intro
Program Plan:
To fix the error in given program and to debug it.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
I am struggling on this one. This is the question - Write an application that computes and displays the day on which you become(or became) 10,000 days old. For example, if you we're born on January 1st, 2000, the output would be I will be 10000 days old on 2027-05-19.
This is the starting code -
import java.time.*;
public class TenThousandDaysOld {
public static void main(String[] args) {
// Write code here
}
}
How would I create this code in Java? The coding prompt is attached below.
SAMPLE RUN BELOW (user entry in bold)
Welcome to the book program!
Would you like to create a book object? (yes/no): yEs (yEs, Yes,..., No, NO,nO...etc all acceptable entries)
Enter the author, title and the isbn of the book separated by /: Ericka Jones/Java made Easy/458792132
Got it!
Now, tell me if it is a bookstore book or a library book (enter BB for bookstore book or LB for library book): BSB (Lb, bB...etc all acceptable entries)
Oops! That’s not a valid entry. Please try again: Bookstore
Oops! That’s not a valid entry. Please try again: bB
Got it!
Enter the list price of JAVA MADE EASY by ERICKA JONES: 14.99
Is it on sale? (yes/no): yes (yEs, Yes,..., No, NO,nO...etc all acceptable entries)
Deduction percentage: 15% (Enter this as a percentage)
Got it!
Here is your bookstore book information
[458792132-JAVA MADE EASY by ERICKA JONES- $14.99 listed…
Let's create our first Java file, called Welcome.java, which can be done in any text editor (like Notepad, Notepad++, Visual code, etc.). Open a file and paste the following Java code.
public class Main {
public static void main(String[] args) {
System.out.println("mudau shudufhadzo welcome to BIS2142/ 2542 class");
}
}
Execute/ run it using a command prompt. Your output should contain a name and welcome to BIS2142/ 2542 class message. Therefore, your display message will look like this "mudau shudufhadzo "welcome to BIS2142/2542 class".
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
- Is the following true or false IN JAVA In java it is possible to throw an exception, catch it, then re-throw that same exception if it is desired 2. GUIs are windowing interfaces that handle user input and output.arrow_forwardMake a file named Rectangle.java, in that file create a following methods: //Ask the user for the length of the rectangle. public static double getLength(Scanner keyboard) //Ask the user for the width of the rectangle public static double getWidth(Scanner keyboard) //Calculate the area of the rectangle public static double getArea(double length, double width) //Display the information about the rectangle public static void displayData(double length, double width) Write the code in java and use test case # as an example result.arrow_forwardIN JAVA PLEASE In the course menu of the final project, don't delete class if a student is enrolled in it. That is: when the user chooses the option to delete a class, print something like: "Student(s) are enrolled in that class...Sorry class can't be deleted" when there is a least one student in that class. --------------------------------------------------- Main Menu 1 : Student Management 2 : Course Management 0 : Exit Enter your selection: 1 ----------------- Student Management Menu: Choose one of: A - Search add a student B - Delete a Student C – Print Fee Invoice D – Print List of Students X – Back to Main Menu Enter your selection: D PhD Students ------------ - Zydoun BenSellam - Erica Belksiri MS Students ------------ - Caleb Sidi Kacem - Erika Jones - Walid Wali Undergraduate Students ------------ - Ed Johnson - Willian Jones - Kirby Sons Student Management Menu: Choose one of: A - Search add a student B - Delete a Student C – Print Fee Invoice D – Print List of Students X –…arrow_forward
- How would I create this code in Java? The coding prompt is attached below. SAMPLE RUN BELOW (user entry in bold) Make sure that for the search feature it can search between author, title, or isbn depending on what the user enters. Welcome to the book program! Would you like to create a book object? (yes/no): yEs (yEs, Yes,..., No, NO,nO...etc all acceptable entries) Enter the author, title and the isbn of the book separated by /: Ericka Jones/Java made Easy/458792132 Got it! Now, tell me if it is a bookstore book or a library book (enter BB for bookstore book or LB for library book): BSB (Lb, bB...etc all acceptable entries) Oops! That’s not a valid entry. Please try again: Bookstore Oops! That’s not a valid entry. Please try again: bB Got it! Enter the list price of JAVA MADE EASY by ERICKA JONES: 14.99 Is it on sale? (yes/no): yes (yEs, Yes,..., No, NO,nO...etc all acceptable entries) Deduction percentage: 15% (Enter this as a…arrow_forwardMake a file named Rectangle.java, in that file create a following methods: // Ask the user for the length of the rectangle. public static double getLength(Scanner keyboard) // Ask the user for the width of the rectangle public static double getWidth(Scanner keyboard) // Calculate the area of the rectangle Public static double getArea(double length, double width) // Display the information about the rectangle public static void displayData(double length, double width) Write in java and use test case # as an example result.arrow_forwardIn a Java program, create an automobile class that will be used by a dealership as a vehicle inventory program. The following attributes should be present in your automobile class: private string make, private string model, private string color, private int year, private int mileage. Your program should have appropriate methods such as: constructor, add a new vehicle, remove a vehicle, update vehicle attributes. At the end of your program, it should allow the user to output all vehicle inventory to a text file.arrow_forward
- JavaProgramming 3.a. Create a class named Circle with fields named radius, area and diameter. Include methods names setRadius(), getRadius(), computeDiameter() which computes a circles’s diameter and computeArea which computes a circle’s area. The diameter of a circle is twice its radius and the area is 3.14 multiplied by the square of the radius. b. Create a class named TestCircle whose main() declares three Circle objects. Using the setRadius() method, assign one circle a small radius value. Assign another circle a larger radius value and assign the third circle a radius of 1. Call computeDiameter() and computeArea() for each circle and display the results.arrow_forwardFor this exercise, you will create 2 classes: InputOutput class and AddNumbers class. ⦁ InputOutput Class: write a program that carries out the following tasks:⦁ Create an object of type PrintWriter and that writes into a file with the name greeting.txt.⦁ Print the message “Hello, world!” on the file.⦁ Close the file.⦁ Open the same file again.⦁ Read the message into a string variable (hint: use nextLine() method to read the text).⦁ Print the message on the screen. ⦁ AddNumbers Class: write a program that asks the user to input four floating-point numbers. Add all correctly specified values and print the sum when the user is done entering data. Use exception handling to detect improper inputs. For example, the user might enter letters instead of numbers. In this case, use the exception handling mechanism to print a proper message. (hint: use InputMismatchException) Don’t forget to import java.util.*.arrow_forwardWrite, compile, and test a class that displays at least four lines of your favorite song. Save the class as FavoriteSong.java. Every praise is to our God.Every word of worship with one accordEvery praise every praise is to our God.Sing hallelujah to our GodGlory hallelujah is due our GodEvery praise every praise is to our God.arrow_forward
- Create a java class called Student to represent a Student exam grades. The class has four instance variables: A String variable for the name, and three double variables to store three exams grades for the student. Write a mutator method that takes four parameters—A String and three doubles. Use these parameters to initialize the instance variables declared earlier. Write a getAverage method that calculates and returns the average of the three exam grades. Write a separate program that creates 2 Student objects to hold the following data. First Name Exam#1 Exam#2 Exam#3 Ahmed 83.0 95.5 90.0 Kareema 75.25 83.0 89.0 Output the name and average grade for each of the above students.arrow_forwardJAVAI need a prompt and GUI that allows the user to log in as a teacher, the password for the teacher login should be "Teacher123" and once the user logs in, it should display to the user a grade book, using this code below. import java.util.Scanner;public class Teacher{ public static void main(String[] args) {System.out.println("Enter the number of grades that are going to be calculated of that subject: "); //input Scanner scanner = new Scanner(System.in);int cla = scanner.nextInt();double[] arr = new double[cla]; //Declaring array of elementsdouble total = 0; for(int i=0; i<arr.length; i++){System.out.print("Enter in grade #" +(i+1)+" : "); //input of the gradearr[i] = scanner.nextDouble();}scanner.close();for(int i=0; i<arr.length; i++){ total = total + arr[i];}double average = total / arr.length; //finding the total averageSystem.out.format("The average is: %.3f", average); //print from input}}arrow_forwardJAVA PPROGRAM ASAP Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases. It does not pass the test cases when I upload it to Hypergrade. Because RIGHT NOW IT PASSES 2 OUT OF 7 TEST CASES. I have provided the failed the test cases as a screenshot. The program must pass the test case when uploaded to Hypergrade. import java.io.File;import java.io.FileNotFoundException;import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String fileName; System.out.println("Please enter the file name or type QUIT to exit:"); fileName = keyboard.nextLine().trim(); while (!fileName.equalsIgnoreCase("QUIT")) { File file = new File(fileName); if (file.exists()) { int wordCount = countWords(file); System.out.println("Total number of words: " + wordCount + "\n); break; // Exit…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY