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
Difference between copy command and cut command
SOVA2 [1]

Answer:

Control (Ctrl) + C. Remember "C" as. The COPY command is used for just that - it copies the text or image you have selected and stores is on your virtual clipboard

Cut command = Sections of a specified file or piped data and print the result to standard output. The command cuts parts of a line by field, delimiter, byte position, and character.

Explanation:

Think of copy command as a "duplicating tool." It is taking something and duplicating it, making an exact second version of it.

The cut command is like a "delete" key. It takes something and cuts it, or deletes it.

8 0
2 years ago
Consider the program below: public class Test { public static void main( String[] args ) { int[] a; a = new int[ 10 ]; for ( int
Anna11 [10]

Answer:

Result is: 65

Explanation:

To analyze this code let us asign line numbers:

  1. public class Test {
  2.    public static void main( String[] args )
  3.    { int[] a; a = new int[ 10 ];
  4.        for ( int i = 0; i < a.length; i++ )
  5.            a[ i ] = i + 2;
  6.        int result = 0;
  7.        for ( int i = 0; i < a.length; i++ )
  8.            result += a[ i ];
  9.        System.out.printf( "Result is: %d\n", result );
  10.    }
  11. }

On line 3, an array of ints is created of size 10

On line 4 and 5 a for loop is used to add values to the array. at the end of the execution of line 4 and 5, the array will contain the following elements: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

On line 6 an int variable result is created and initialized to 0

line 7 and 8 allows a for loop through the array adding up all the elements of the array and assigning them to result

Line 9 outputs the value of result (Which is the total sum)

3 0
3 years ago
Which of the following is considered to be intellectual property?
ad-work [718]

The answer is actually A. I took the test and selected the wrong answer, but A was the one the test said was right. Plz mark brainliest!!! Hope this helped! ;^)

4 0
3 years ago
A project manager type a document and print it he is using
IRINA_888 [86]
He is using a Computer to type out the document, and a Printer for printing the document.
Thank you!
3 0
3 years ago
The CMOS battery located on a computer's motherboard allows for maintaining the correct time and date information stored in CMOS
siniylev [52]

Answer:

True                

Explanation:

  • CMOS (complementary metal-oxide-semiconductor) is a chip which is placed on the motherboard in order to store the system date and time and this is powered by a CMOS battery which is housed inside this chip and is used to manage the date and time when the system is off.
  • This is a long lasting battery which can work till the life of a motherboard.
  • This battery is also used to maintain BIOS settings and hardware settings and BIOS uses it during the booting process in order to retrieve the stored information regarding the hardware or system date time.
  • CMOS chip is basically volatile and cannot retain settings information when the computer system powers off but the CMOS battery helps to maintain these setting just like system time and date when the computer gets shut down.
4 0
4 years ago
Other questions:
  • A type of touch screen that can be up to four feet by six feet is a(n) _____. plasma screen multitouch interface Electronic Pape
    10·2 answers
  • Which service is enabled on a cisco router by default that can reveal significant information about the router and potentially m
    10·1 answer
  • A type of Knowledge Management System is called
    5·1 answer
  • Write a Java program that generates a new string by concatenating the reversed substrings of even indexes and odd indexes separa
    5·1 answer
  • Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per l
    14·1 answer
  • What is the name for the size and style of text?
    8·2 answers
  • The network backbone
    11·1 answer
  • Another name of computer program is
    6·1 answer
  • What do you mean by Graphics editing​
    14·1 answer
  • Instant Search can NOT be used to search through archived messages.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!