EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 12, Problem 1RQ
Program Description Answer
In object-oriented
Hence, the correct answer is option “B”.
Expert Solution & Answer
Explanation of Solution
Exception:
- In Java, the exception is an object used to signal the unexpected error occurred during a program execution.
- Exception is the error, which arises at run time and such errors can be handled in Java by exception handling.
- The exception handling allows a method to throw an error to its caller and allowing the caller to manage that error.
- The called method itself must manage the error or end the program without this exception handling. But the called method does not know when error occurs.
- The library method helps to find the error, but only caller method knows how to handle that errors.
Want to see more full solutions like this?
Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Instructions
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.
An example of the program is shown below:
Enter a radius for a circle >> 7
The radius is 7
The diameter is 14
The area is 153.93791
Task 1: The DebugPen class compiles without error.
This task is dependent on completing task #2.
Task 2: The DebugCircle class methods work without errors.
Task 3: The DebugFour1 class compiles without error.
Task 4: The DebugFour1 program accepts user input and displays the correct output.
Create an object-oriented program that allows you to enter data for customers and
employees.
Console
Customer/Employee Data Entry
Customer or employee? (c/e): c
DATA ENTRY
First name: Frank
Last name: Wilson
Email: frank44@gmail.com
Number: M10293
CUSTOMER
Name: Frank Wilson
Email: frank44@gmail.com
Number: M10293
Continue? (y/n): y
Customer or employee? (c/e): e
DATA ENTRY
First name: joel
Last name: murach
Email: joel@murach.com
SSN: 123-45-6789
EMPLOYEE
Name: Joel Murach
Email: joel@murach.com
SSN: 123-45-6789
Continue? (y/n): n
Bye!
Specifications
●
●
Create a Person class that provides attributes for first name, last name, and email address. This
class should provide a property or method that returns the person's full name.
Create a Customer class that inherits the Person class. This class should add an attribute for a
customer number.
Create an Employee class that inherits the Person class. This class should add an attribute for a
social security number (SSN).
The program should…
An ----------------- is an object that is generated when a run time error occurs.
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(n) _____________ is generated when a user interacts with a GUI object. a. error b. occasion c. method d. eventarrow_forwardIndicate whether each of the following C# programming language identifiers is legal or illegal. If it is legal, indicate whether it is a conventional identifier for a class. electricBill ElectricBill Electric bill Static void #ssn Ay56we Theater_Tickets 212AreaCode heightInCentimeters Zip23891 Voidarrow_forwardObject-Oriented Programming ❤❤❤ Matchmaker with Java ❤❤❤ Summary: Create a Java application that will determine your true love. Prerequisites: Java, VS Code, and Terminal In this assignment you will develop and test a command-line application written in the Java language that asks questions to determine if a person is your true love. More specifically your application should ask five questions in the form of statements and allow the user to respond to each statement with the numbers 1 through 5 with 1 indicating strongly disagree and 5 indicating strongly agree. You will then compare the person’s answers with your desired “true love” answers. The closer the answers are to your desired “true love” answers the better match the two of you are for each other. For example, suppose you choose the statement “Broccoli is delicious.” and your desired answer was 1 (strongly disagree) because you really don’t like broccoli. If the application user entered 4 (agree), then the two of you would not…arrow_forward
- Write binary calculator java code using object-oriented programming concept. The calculator should +,-,* and / The calculator should convert from binary to decimal, then decimal to binary. The calculator should also apply for hexadecimal the same procedure as the binary calculator Use one of the four pillars of Object-oriented programming. And Don't only use the main method. https://www.calculator.net/binary-calculator.htmlarrow_forwardTask 1 — Object-Oriented Programming (Marks: 100)Learning Units: LU1 – 2Assessment:Assessment/Deliverable Marks Weight DurationTask 1 100 25% 15hrsUsing C# and Visual Studio, design and implement a standalone command line application thatfulfils the following requirements:1. The user shall be able to enter the following values:a. Gross monthly income (before deductions).b. Estimated monthly tax deducted.c. Estimated monthly expenditures in each of the following categories:i. Groceriesii. Water and lightsiii. Travel costs (including petrol)iv. Cell phone and telephone19; 20; 21 2021© The Independent Institute of Education (Pty) Ltd 2021Page 5 of 18v. Other expenses2. The user shall be able to choose between renting accommodation or buying a property.3. If the user selects to rent, the user shall be able to enter the monthly rental amount.4. If the user selects to buy a property, the user shall be required to enter the followingvalues for a home loan:a. Purchase price of propertyb. Total…arrow_forwardMicrosoft Visual C# 7th Edition Instruction: DebugEight3.cs has syntax and/or logical errors. Determine the problem(s), and fix the program. Here is my code but I am having an error saying that Convert is not declared and the code is not working. What did I do wrong, please? // Program demonstrates method that can be called // with one, two, or three arguments // Tuition is $80 per credit // Default district code is I. // If student is in-district (code I), then there is no // out-of-district fee, which is $300 // Default scholarship status is false. // If student is on scholarship, tuition is free using static System.Console; class DebugEight3 { static void Main() { double credits; char code='I'; bool isScholarship=false; string numCredit; WriteLine("Enter number of credit"); numCredit = ReadLine(); credits = Convert.ToDouble(numCredit); double tuition; tuition=CalculateTuition(credits,code, isScholarship);…arrow_forward
- Textbook: Joyce Farrell, Microsoft® Visual C#®: An Introduction to Object-Oriented Programming, Seventh Edition, ISBN: 9781337102100.Microsoft Visual C# (chapter 5 code case problem 5-2) Assignment instruction: In Chapter 4 of your book, you created an interactive application named MarshallsRevenue that prompts a user for the number of interior and exterior murals scheduled to be painted during a month and computes the expected revenue for each type of mural. The program also prompts the user for the month number and modifies the pricing based on requirements listed in Chapter 4. Now, modify your program so that the user must enter a month value from 1 through 12. If the user enters an incorrect number, the program prompts for a valid value. Also, the user must enter a number between 0 and 30 inclusive for the number of murals of each type; otherwise, the program prompts the user again. In order to prepend the $ to currency values, the program will need to use the…arrow_forwardIntroduction: In English vocabulary there are many interesting and meaningful phenomena, such as isogram, pangram, malapropisms, anagram, palindrome, etc., which leave a “room" for language-learners to enthusiastically discover secret, surprise, and something different instead of negatively listing words. They make the boring vocabulary lesson an interactive practical course that helps to grasp interest of students as English language-learners.' Some of these interesting linguistic phenomena² are: • Isogram: referred to a word, phrase, or sentence in which no letter of the alphabet occurs more than once. For example; the words “ambidextrously", “endolymphatic", and “unpredictably". • Pangram: A phrase or sentence containing all 26 letters of the alphabet (ideally repeating as few letters as possible). For example; the sentence: “Brown jars prevented the mixture from freezing too quickly". • Palindrome: a word, number, phrase, or other sequence of characters which reads the same…arrow_forwardIn c++ Create an object-oriented program that manages bank account. Bank Account Manager Main Menu=========1 – Checking Account2 – Saving Accountx - Exit program Requirements Create the bank account to store a bank customer’s account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide the following operations: set the account number, retrieve the account number, retrieve the balance, deposit, and withdraw money, and print account information. Add appropriate constructors. Every bank offers a checking account. Derive the class checking account from the class bank account (designed in part 1). This class inherits members to store the account number and the balance from the base class. A customer with a checking account typically receives interest, maintains a minimum balance. Add member variables to store this additional information. In addition to the operations inherited from the base class, this class…arrow_forward
- Please help with the following: C# .NET change the main class so that the user is the one that as to put the name a driver class that prompts for the person’s data input, instantiates an object of class HealtProfile and displays the patient’s information from that object by calling the DisplayHealthRecord, method. MAIN CLASS---------------------- static void Main(string[] args) { // instance of patient record with each of the 4 parameters taking in a value HeartRates heartRate = new HeartRates("James", "Kill", 1988, 2021); heartRate.DisplayPatientRecord(); // call the method to display The Patient Record } CLASS HeartRATES------------------- class HeartRates { //class attributes private private string _First_Name; private string _Last_Name; private int _Birth_Year; private int _Current_Year; // Constructor which receives private parameters to initialize variables public HeartRates(string First_Name, string Last_Name, int Birth_Year, int Current_Year) { _First_Name = First_Name;…arrow_forwardObject-Oriented Programming Using C# and Visual Studio, design and implement a standalone command-line application thatfulfills the following requirements:1. The user shall be able to enter the following values:a. Gross monthly income (before deductions).b. Estimated monthly tax deducted.c. Estimated monthly expenditures in each of the following categories:i. Groceriesii. Water and lightsiii. Travel costs (including petrol)iv. Cell phone and telephonev. Other expenses 2. The user shall be able to choose between renting accommodation or buying a property.3. If the user selects to rent, the user shall be able to enter the monthly rental amount.4. If the user selects to buy a property, the user shall be required to enter the followingvalues for a home loan:a. Purchase price of propertyb. Total depositc. Interest rate (percentage)d. Number of months to repay (between 240 and 360)5. The software shall calculate the monthly home loan repayment for buying a propertybased on the values that…arrow_forwardObject Oriented Programming: 213COMP, 214COMP (Feb-2022) Assignment- I [10 marks] Academic honesty: O Only pdf file accepted & student ID, will be your upload file. O Student who submit copied work will obtain a mark of zero. O Late work or attach file by email message not allowed. Q1: Write the signature for a method that has one parameter of type String, and does not return a value. Q2: Write the signature for a method that has two parameters, both of type Student, and returns an int value. Q3: Write the constructor's headers of the followings? new Student (202101156, “Ahmed"); new Address(51, "jazan university","CS&IT" ); new Grade(true, 505235600, 4.5); Q4: a) Write a class Student that define the following information: name, stid , age. b) Explain a mutators (setters) and accessors(getters) methods for each attributes(fields). c) Add three constructors: • with empty constructor. one parameter constructor (name of student) two parameters constructor (name and stid) d) Create two…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,