SalesTransactionDem. 1 using System; 2 using static System.Console; 3 using System.Globalization; 4 class SalesTransactionDemo 5 { static void Main() { // Write your main here. } 8 10 public static void Display(SalesTransaction s) { 12 // Write your Display() method here. 13 } 14 public static void DisplayTotal(SalesTransaction s) 15 16 17 18 } 19 { // Write your DisplayTotal() method here. + 1.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
SalesTransactionDem..
1 using System;
2 using static System.Console;
commission - The
commission (as a
3 using System.Globalization;
double )
4 class SalesTransactionDemo
5 {
RATE - A readonly
static void Main()
field that stores the
{
// Write your main here.
commission rate (as a
8
}
double ). Define a
10
public static void Display(SalesTransaction s)
{
// Write your Display() method here.
getRate() accessor
11
method that returns
12
13
}
the RATE
14
public static void DisplayTotal(SalesTransaction s)
15
{
16
Include three
// Write your DisplayTotal() method here.
}
18 }
19
constructors for the class.
17
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
+ operator adds the
sales values for two
SalesTransaction
objects and returns a new
SalesTransaction
object.
In order to prepend the $
to currency values, the
program will need to use
the
CultureInfo.GetCult
ureInfo
method. In order to do
this, include the
statement
using
System.Globalizatio
n3;
at the top of your program
and format the output
statements as follows:
Writeline ("This is
an example: {0}",
value. ToString("C",
CultureInfo.GetCult
ureInfo("en-US")));
Transcribed Image Text:SalesTransactionDem.. 1 using System; 2 using static System.Console; commission - The commission (as a 3 using System.Globalization; double ) 4 class SalesTransactionDemo 5 { RATE - A readonly static void Main() field that stores the { // Write your main here. commission rate (as a 8 } double ). Define a 10 public static void Display(SalesTransaction s) { // Write your Display() method here. getRate() accessor 11 method that returns 12 13 } the RATE 14 public static void DisplayTotal(SalesTransaction s) 15 { 16 Include three // Write your DisplayTotal() method here. } 18 } 19 constructors for the class. 17 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 + operator adds the sales values for two SalesTransaction objects and returns a new SalesTransaction object. In order to prepend the $ to currency values, the program will need to use the CultureInfo.GetCult ureInfo method. In order to do this, include the statement using System.Globalizatio n3; at the top of your program and format the output statements as follows: Writeline ("This is an example: {0}", value. ToString("C", CultureInfo.GetCult ureInfo("en-US")));
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY