Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C# application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and their sum. The SalesTransaction class contains the following fields:

Create a C# application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and their sum.

The SalesTransaction class contains the following fields:

  • Name - The salesperson's name (as a string)
  • salesAmount - The sales amount ( as a double)
  • commission - The commission (as a double)
  • RATE - A readonly field that stores the commission rate (as a double). Define a getRate() accessor method that returns the 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 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 + operatoradds the sales values for two SalesTransaction objects and returns a new SalesTransaction object.

Please use this format

using static System.Console;

class SalesTransactionDemo

{

static void Main()

{

// Write your main here.

}

public static void Display(SalesTransaction s)

{

// Write your Display() method here.

}

public static void DisplayTotal(SalesTransaction s)

{

// Write your DisplayTotal() method here.

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions

Question

=+21.16. For the density Cexp( -1x| "), - o Answered: 1 week ago

Answered: 1 week ago

Question

Influences on Nonverbal Communication?

Answered: 1 week ago