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
(100 points) why does file explorer look like this and how do I fix it? I'm not good with computers, and I kinda need help
Degger [83]

Go To View -> Navigation Pane -> Then Click Navigation Pane

7 0
3 years ago
How are sorting tools helpful for using spreadsheets and databases? Sorting tools let you locate information by searching for na
Black_prince [1.1K]

Answer:

Sorting tools allow you to organize data into columns and rows that help you locate what you are looking for.

Explanation:

Spreadsheet applications and relational databases are similar in configuration as they are both arranged in rows and columns (tabular). Sorting a spreadsheet or database is useful as it helps to organize data. A sorted spreadsheet or database can be in ascending or descending order which makes it easier and faster to locate rows of data manually or by query.

7 0
2 years ago
Read 2 more answers
Can anyone tell me this answer?
algol [13]

Answer: yes it is

Explanation:

u can research it up

4 0
2 years ago
How to bypass securly or fortiguard (fortinet)
ira [324]

Answer:

thanks for whatever you just said!! <3

Explanation:

3 0
2 years ago
(Java) Meadowdale Dairy Farm sells organic brown eggs to local customers. It charges $3.25 for a dozen eggs, or 45 cents for ind
zepelin [54]

import java.util.Scanner;

public class Eggs {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("How many eggs?");

       int eggs = scan.nextInt();

       int dozens = eggs / 12, ind = eggs - (dozens*12);

       

       System.out.println("You ordered "+eggs+" eggs. That's "+dozens+" at $3.25 per dozen and "+ind+" loose eggs at 45 cents each for a total of $"+((dozens*3.25)+(ind*0.45))+".");

   }

   

}

I hope this helps!

8 0
2 years ago
Other questions:
  • What component on a smartphone requires pairing with another device?
    8·1 answer
  • Fax machines, voice mail, electronic mail, and electronic conferencing are all examples of _________.
    15·2 answers
  • HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol inclu
    5·1 answer
  • What is used to configure data sources for applications that require access to a database?
    14·1 answer
  • PLZ HELP ME I WILL GIVE BRAINLIST!!! Why was the Internet originally constructed?
    12·1 answer
  • Which of the following are benefits of designing a scalable system? Choose 3 options.
    15·1 answer
  • Make this be a 7th grade argument over a boy
    5·2 answers
  • In order to detect repeated lines anywhere in the input, myuniq must keep track of all of the lines it has seen as it moves thro
    9·1 answer
  • MOA115 Medical Records and Insurance
    6·1 answer
  • Why is a salt added to a password that is being stored in a database?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!