Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use Neatbeans # 3.13 # 3.12 Chapter 3 Introduction to Classes, Objects, Methods and Strings instance v item being pur that initializes the four instance

use Neatbeans image text in transcribed

# 3.13

image text in transcribed

# 3.12

Chapter 3 Introduction to Classes, Objects, Methods and Strings instance v item being pur that initializes the four instance variables. Provide a set and a get method for each es -a part number (type String), a part description (type String), a quantity of the type int) and a price per item (double). Your class should have a constructor 0 instance variable. In addition, provide a method named getinvoiceAmount that calculates the invoice amount (i.e. tem), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to multiplies the quantity by the price per i 0.0. Write a test app named InvoiceTest that demonstrates class Invoice's capabilities. (Employee Class) Create a class called Employee that includes three instance variables-a first name (type String), a last name (type String) and a monthly salary (double). Provide a constructor that initializes the three instance variables. Provide a set and a get method for each instance variable. If the monthly salary is not positive, do not set its value. Write a test app named EmployeeTest that demonstrates class Employee's capabilities. Create two Employee objects and display each object's rly salary. Then give each Employee a 10% raise and display each Employee's yearly salary again. 3.14 (Date Class) Create a class called Date that includes three instance variables-a month (type int), a day (type int) and a year (type int). Provide a constructor that initializes the three instance variables and assumes that the values provided are correct. Provide a set and a get method for each instance variable. Provide a method displayDate that displays the month, day and year separated by forward slashes (/). Write a test app named DateTest that demonstrates class Date's capabilities. 3.13 2 3.15 (Removing Duplicated Code in Method main) In the AccountTest cla main contains six statements (lines 11-12, 13-14, 26-27, 28-29, 38-39 and 40-41 play an Account object's name and balance. Study these statements and you'll notice th ss of Fig. 3.9, method ) that each dis- Scounti or account2, In this exercise vou def

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

Step: 3

blur-text-image

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

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

what is 25 and 26 match and count together

Answered: 1 week ago

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago