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]
2 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]2 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
A tower or mini tower pc is a type of all- in -one unit true or false
Svetlanka [38]

Answer:

thx

Explanation:

5 0
3 years ago
Read 2 more answers
All parking revenue comes from a home teams games? True or false
Greeley [361]

Answer:

False

Explanation:

False, all parking revenues do not come from home team games. The home team refers to a team that plays on its ground. Parking Revenue refers to the revenue earned from the rental of parking space.

Stadium owners can generate more revenue from parking and concessions by increasing the use of their venue. Stadium parking is also one of the sources of income.

3 0
2 years ago
Is a plotter input output or both
erastova [34]

Answer:

it is output

Explanation:

it just is .

5 0
3 years ago
DEFINE WHAT COPYRIGHT?
Reika [66]
Copyright is when someone is given the right to print, publish or make a film.
5 0
2 years ago
Read 2 more answers
100 points, PLEASE HELP...To generate numbers between and including -10 to 10 you would use:
Orlov [11]

Answer:

A number line?

6 0
2 years ago
Other questions:
  • While Angela is making modifications to Katie’s Word document, she would like to inform Katie of the reasoning for the change. W
    10·1 answer
  • What's the name of this apex legend hero​
    13·2 answers
  • What does this result prove about the computer’s network connectivity?
    12·1 answer
  • What is an "immediate preemptive scheduler"?
    15·1 answer
  • ____ testing is a straightforward testing technique that looks for vulnerabilities in a program or protocol by feeding random in
    6·1 answer
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
  • How to use access?<br> like working in access and bringing tables and stuff
    5·1 answer
  • Which step in the software development life cycle analyzes the scope of work?
    6·1 answer
  • What is the best way to improve an online search?
    11·2 answers
  • What will be the result from running the following program?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!