Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 8 O Points This is an extra credit question worth 4 points. Consider a software system that will implement the following classes: Student Professor,

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Question 8 O Points This is an extra credit question worth 4 points. Consider a software system that will implement the following classes: Student Professor, StaffMember. ContractWorker. List three candidates for common attributes of these classes. What would be a good abstract class from which these classes may be extended via inheritance? Use the editor to format your answer when the Tollowing code executes, what will be displayed? public class Test public static void main(String[args) { String mystring = "5": String yourstring = "five". int number: try { number = Integer.parseInt(yourstring); System.out.print (number +""); number = Integer.parseInt(mystring): System.out.print (number); } catch (Number FormatException e) { System.out.print("not a number"); } finally 1 System.out.print("final"); 3 > A not a number B five 5 not a number final not a number final D 5 final Question 14 2 Points is the following "add" method overloaded or overridden? class Addition // adding two integer values. public int add{int a, int b) int sum = a +b: return sum: 3 11 adding three integer values. public int add(int a, int b. intc) { int sum = a +b+c return sum: I } A overloaded B overridden Question 7 2 Points Write a catch statement that would throw the appropriate exception if the user does not enter the correct data type. Your code would go where indicated by the comment in capital letters. Import java.util." : public class Square public static void main(String[] a) { Scanner scan = new Scannert System.in); int num: System.out.print("Enter an integer:"); try ( num= scan.nextinto: System.out.printin("The square of num+" is* + num"num : // YOUR CATCH STATEMENT WOULD GO HERE System.out.println("You entered bad data." I System.out.println("Good-by"> Use the editor to formot your

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

what is a peer Group? Importance?

Answered: 1 week ago