Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment

1. Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables-a part number (type String), a part description (type String), a quantity of the item being purchased (type int) and a price per item (double).

Your class should have two overloaded constructors: one as zero argument constructor and the other as a 4 argument constructor, for initializing the instance variables.

Provide a set and a get method for each instance variable. In addition, provide a method named getInvoiceAmount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), 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 0.0.
Write a test application named InvoiceTest (a driver class) that demonstrates class Invoice's capabilities. Try and demonstrate use of all the constructors & methods in the class. Take print screen of the output of the driver class.

2. 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 three argument 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 application named DateTest (a driver class) that demonstrates class Date's capabilities and the use of "this" reference. Try and demonstrate use of all the constructors & methods in the class. Take print screen of the output of the driver class.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92714305
  • Price:- $80

Priced at Now at $80, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question summary using an organization of your

Question: Summary: Using an organization of your choice: Develop a Complete Disaster Recovery Plan to be submitted to the executive board of your company. Please note that this is a formal writing, all references (peer-r ...

Bond a is a 1-year zero-coupon bond bond b is a 2-year

Bond A is a 1-year zero-coupon bond. Bond B is a 2-year zero-coupon bond. Bond C is a 2-year 10% coupon bond that pays annually. The yield to maturity (annually compounded) on bond A is 10%, and the price of bond B is $8 ...

Question what is stuxnet and what are its real-world

Question : What is Stuxnet and what are its real-world implications? Should your national government be concerned about the potential of a Stuxnet-like attack? Why or why not.

Question using the apple company identify all the social

Question: Using the Apple company, identify all the social media platforms it currently uses. List all the social media platforms. List five different KPI's you could use to measure the engagement on each platform. Expla ...

How do you apply the five components of the information

How do you apply the five components of the information systems to an information systems application like "online bill pay" system offered by many banks.

Requirementsdesign and implement an application with a

Requirements Design and implement an application with a graphical user interface to manage a library of songs. A song is uniquely identified by name and artist (case insensitive). Your application should have a SINGLE WI ...

Suppose you are a manager in the it department for the

Suppose you are a manager in the IT department for the government of a corrupt dictator, who has a collection of computers that need to be connected together to create a communication network for his spies. You are given ...

Question several social networks like facebook or linkedin

Question : Several social networks like Facebook or LinkedIn are able to accurately recommend people you may want to become friends with or connect to. Explain what graph algorithm is relevant for producing this kind of ...

Can someone please help me with this examthis is consists

can someone please help me with this exam This is consists of four questions. The questions are designed to test your understanding of certain concepts that were studied over the course of the semester. Please answer all ...

What are some of the skill sets required for the various

What are some of the skill sets required for the various aspects of cloud administration. Are there any certifications related to cloud computing? Is there value in obtaining one of these certifications?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As