1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kryger [21]
3 years ago
12

Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th

eir sum. The SalesTransaction class contains fields for a salesperson name, sales amount, and commission and a readonly field that stores the commission rate. Include three constructors for the class. One constructor accepts values for the name, sales amount, and rate, and when the sales value is set, the constructor computes the commission as sales value times the commission rate. The second constructor accepts a name and sales amount, but sets the commission rate to 0. The third constructor accepts a name and sets all the other fields to 0. An overloaded + operator adds the sales values for two SalesTransaction objects.
Computers and Technology
1 answer:
crimeas [40]3 years ago
8 0

Answer:

Explanation:

The following code is all written in Java, first I will add the object initialization and declaration code that can be added to the main method of any program. Then I have also written the entire SalesTransaction class as the question was not clear as to exactly which was needed.

//Object Creation to copy and paste into main method

SalesTransaction sale1 = new SalesTransaction("Gabriel", 25, 5);

SalesTransaction sale2 = new SalesTransaction("Daniela", 5);

SalesTransaction sale3 = new SalesTransaction("Jorge");

//SalesTransaction class with three constructors

package sample;

class SalesTransaction {

   String name;

   int salesAmount, commission;

   private int commissionRate;

   public SalesTransaction(String name, int salesAmount, int rate) {

       this.name = name;

       this.salesAmount = salesAmount;

       this.commissionRate = rate;

       commission = salesAmount * rate;

   }

   public SalesTransaction(String name, int salesAmount) {

       this.name = name;

       this.salesAmount = salesAmount;

       this.commissionRate = 0;

   }

   public SalesTransaction(String name) {

       this.name = name;

       this.salesAmount = 0;

       this.commissionRate = 0;

   }

}

You might be interested in
What are the top and side margins for a letter typed in standard format?
ella [17]
They should be between 1 and 1/4 inches
8 0
3 years ago
Coordination in a global information system requires a _____ architecture for data, standardization within departments.
Phantasy [73]

Coordination in a global information system requires a decentralized architecture for data, standardization within departments

6 0
2 years ago
Which of the following is not an Operating System? (1 point)Windows
kobusy [5.1K]
The answers of the following are:

1.  The answer is Linux. It is not an Operating System.
2. Windows XP 2000 and Windows XP Home Edition have the same interface design. 
3. Linux is the operating systems which is considered to be open source.
4. Mac OS is an operating system which is considered to be the most popular with graphic and multimedia designers
5. The software programis the number and variety of programs available for a particular operating system.
4 0
3 years ago
The area or the window that shows the current folder location​
Alex Ar [27]

Answer:

The focused window

Explanation:

However, please provide some more details about this because the question itself is very vague.

8 0
3 years ago
Suppose an initially-empty queue Q has performed a total of 32 enqueue operations, 10 front operations, and 15 dequeue operation
Natasha_Volkova [10]

Answer:

22

Explanation:

1. We are going to have at hand 32 Enqueue Operation, with 10 from front and 15 dequeue and 5 empty queue operation

2. You dequeued total number of 15-5 =10 elements since 5 dequeue did not change the state of the queue, so invariably 10 dequeue is done.

3. Next is to enqueued a total of 32 elements.

Enqueue Operation do not change the state(and Size) of the queue, and can be ignored.

4. To arrive at the Total Size of queue, we will have 32-10 = 22 at the end

Answer : 22 because its a 5 dequeue Operations.

6 0
3 years ago
Other questions:
  • The spreadsheet below shows the age, grade level, major, and minor of four students in college. A purple background in the Major
    7·1 answer
  • What is the next series of dragon ball super
    6·2 answers
  • 1.Which type of camera tool pushes the picture back and makes it wider, exaggerating the distance between the background and for
    13·2 answers
  • PLZ help
    5·1 answer
  • Marla wants to transfer photos from her digital camera to her computer. She has plugged the camera's cord into the USB port. Wha
    11·2 answers
  • The term Linux Intrusion Detection System ( LIDS) refers to a command that allows an administrator to run processes as root with
    5·1 answer
  • What is causing the electricity prices to increase in South Africa?​
    14·1 answer
  • FILL IN THE BLANK.
    10·1 answer
  • Vẽ sơ đồ DFD cho của hàng bán điện thoại ( Môn phân tích và thiết kế hệ thống thông tin)
    10·1 answer
  • Why do companies use online collaborative productivity software.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!