TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Steph Bassos
NA
17
15.5k
Test Application
Jun 25 2013 8:36 PM
What is wrong with this? The red text is what is getting flagged.
using System;
public class Invoice
{
string partNum;
string partDesc;
int quantity;
double price;
public Invoice(string partNumber, string partDescription, int quantity, double price)
{
PartNumber = partNum;
PartDescription = partDesc;
Quantity = quantity;
Price = price;
}
public string PartNumber
{
get { return partNum; }
set { partNum = value; }
}
public string PartDescription
{
get { return partDesc; }
set { partDesc = value; }
}
public int Quantity
{
get { return quantity; }
set { quantity = value; }
}
public double Price
{
get { return price; }
set
{
if (value < 0) value = 0;
price = value;
}
}
public decimal InvoiceAmount;
//method
public void GetInvoiceAmount(decimal InvoiceAmount)
{
InvoiceAmount =
quantity * price
;
}
}
class Test
{
static void Main()
{
Invoice inv = new Invoice("Part 1", "Spool", 10, 9.99);
decimal cost =
inv.GetInvoiceAmount
(decimal InvoiceAmount);
Console.WriteLine("Part {0}, Desc {1}, Quantity {2}, Price Each {3:C}, Total Cost {4:C}", inv.PartNumber, inv.PartDescription, inv.Quantity, inv.Price, cost);
Console.ReadKey();
}
}
Reply
Answers (
1
)
Regex help
how to display message box in label click using function