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
Which of the following statements should be avoided when developing a mission statement?
Citrus2011 [14]

Answer: The how-to statements

Explanation:

The mission statement is simply a short summary of the purpose of a company. It is the guideline on how a company will operate. The mission statement states the reason for the existence of a company, products sold or service rendered and the company's goals.

The mission statement should be brief but comprehensive, consist of simple words and describe the “who, what, and where” of the organization.

Therefore, the incorrect option based on the explanation above is "The how-to statements". This shouldn't be part of the mission statement.

3 0
3 years ago
Which of the following is an accurate statement? When the LOWER function is used in a SELECT clause, it will automatically store
quester [9]

Answer:

Hi there! The answer is C:

Explanation:

The scope of the LOWER function is limited to the select clause it is being used in. Outside of the select statement, the column will be returned as it is currently present in the database. Using the LOWER function will not automatically store data in lower case letters in the database tables. As an exercise, try creating a simple database table called "Employees" with columns "id" and "name". Then input a row using an insert statement with id as 1 and name as "BLAH". Try using the select statement with LOWER function and then without the LOWER statement.

5 0
2 years ago
A _____ is usually a smaller version of a data warehouse
Strike441 [17]
A ( micro ) is usually a smaller version of a data warehouse
4 0
2 years ago
HELLO!!!! For instance, will we get an error if we put a space after the word “print” and before the opening parenthesis in pyth
IceJOKER [234]

In python, spaces in the sense you're talking about, dont matter. For instance,

print ( "hello") will run the same as print("hello")

But, you cannot put a space before the print statement. That's called indenting. You are only supposed to indent code that is inside loops, if-elif-else statements, and functions.

7 0
2 years ago
A recursive method without a special terminating case would _________. Hint: Self Check 13.3 had infinite number of isLucky() me
asambeis [7]

Answer:

You need exit condition like If, otherwise method will repeat endlessly.

7 0
3 years ago
Other questions:
  • Throwing an improperly drained oil filter into the trash dumpster is a violation that can carry heavy penalties. A) true b) fals
    7·1 answer
  • When troubleshooting a desktop motherboard, you discover the network port no longer works. What is the best and least expensive
    10·1 answer
  • How can I code this in Python with only if-statements? (Only allowed to use the built-in functions int(), float(), and str().)
    8·1 answer
  • (TCO B) The symbol shown as a three-sided box that is connected to the step it references by a dashed line is what?
    12·1 answer
  • give the difference between functional and functional tools in the middle of to the circle give importance​
    10·1 answer
  • The default print setting for worksheets is________
    13·1 answer
  • To have a reason or purpose to do something
    8·2 answers
  • What what do these two parts of the lift do ​
    14·1 answer
  • Is y0utube an example of unsupervised learning or supervised learning?
    13·1 answer
  • Select the correct answer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!