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
Which of these files, when included in a program, will provide user assistance?
34kurt

Answer:

Answer for this question is D

Explanation:

Help flies

4 0
3 years ago
Read 2 more answers
Which of the following statements are true about the Internet?
Arlecino [84]
1, 2, and 3 are true
6 0
3 years ago
The area of the spreadsheet highlighted in red is the _____.
iragen [17]

A spreadsheet is a software application which is used to display numerical data in a tabular form. It has <em>further functions</em> which includes organizing, displaying, calculating data, etc where the data can be viewed at a glance and retrieved from memory.

There are <em>different types</em> of spreadsheet which includes:

  • <u>G00gle Sheet</u>
  • <u>Microsoft Excel</u>
  • <u>LibreOffice</u>
  • <u>Smartsheet,</u> etc.

Data can be arranged in rows and columns.

Please note that your question is incomplete so I gave you a general overview to help you get a better understanding of the concept.

Read more here:

brainly.com/question/22101774

5 0
2 years ago
If I had to choose the class I prefer it would be a
dmitriy555 [2]
How about you prefer no class
4 0
3 years ago
A power ratio of 9000000:1 corresponds to ... dB?
sertanlavr [38]

Answer:

69.54

Explanation:

A power ratio of 9000000:1 corresponds to 69.54 dB.

The calculation is presented below:

Formula for calculating Power ratio (db) = 10 * log [P(out)/P(in)]

Since the given ratio is 9000000:1, substituting in the formula gives us 10 * log (9000000/1)

Note that log 9000000 = 6.954

Therefore, 10 * log (9000000/1) = 69.54

Hence the required power ratio in db is 69.54 db.

4 0
3 years ago
Other questions:
  • What is the "host" in a typical email address?
    14·1 answer
  • In Word, tables can be styled much like text can.<br> True<br> False
    6·1 answer
  • How can vlan hopping attacks be prevented on a network?
    10·1 answer
  • An online game is played with two dice, explain why decomposition will be used in creating the algorithm for the game?
    9·2 answers
  • When you move or size a control in the Form Designer, Visual Studio automatically adjusts the ________________ that specify the
    9·1 answer
  • The cold war actually helped in the development of the internet true or false
    8·1 answer
  • A professional bureaucracy is a knowledge-based organization where goods and services depend on the expertise and knowledge of p
    7·1 answer
  • Ergonomically designed workstations and equipment reduce stress-related injuries and improve the productivity and efficiency of
    13·2 answers
  • Describe the procedure for creating a table or spreadsheet in a presentation slide.
    13·1 answer
  • The characteristics of Computer Graphics<br><br>FUEL YOUR<br>GREATNESS​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!