You are shopping at a clothing store in the local mall. You have decided to purc
ID: 3788271 • Letter: Y
Question
You are shopping at a clothing store in the local mall. You have decided to purchase two separate items with different prices. Your Visual Logic program solution should first accept two purchase prices. Then calculate a subtotal for the2 items. Next, determine whether the two item subtotal was more than $300. If that is true apply a ten percent discount to the subtotal.Lastly, apply an eight percent sales tax to the subtotal in order to compute the total bill.
You should display three things on the console: (1) the first subtotal, (2) whether the subtotal is over $300 and therefore is to be discounted by 10%, and if so what the discounted subtotal then is, and (3) the total bill amount including any discount and sales tax. The displays should include the appropriate literal strings that indicate exactly what is being displayed and be PROPERLY FORMATTED.
Upon execution of your program, the console should display something like what is shown below that includes both the two inputs and the three outputs:
Enter the price of the first purchased item 000.00
Enter the price of the second purchased item 000.00
The purchase subtotal of $000.00 was greater than $300, so it will be discounted by 10%
The modified subtotal is $000.00
The purchase total (including 8% sales tax) is $000.00
SOLUTION:
I have done the coding in VISUAL LOGIC but i am not able to run the program as it keep saying error in output statement:
Can someone please help and explain it to me from start
thanks
Explanation / Answer
hi dear i am not aware about visual logic but following solution is visual c#
please check and get the logic to solve your's problem
//code
private void btnCalculate_Click(object sender, EventArgs e)
{
double firstItem = double.Parse(txtFirstItem.Text);
double secondItem = Double.Parse(txtSecondItem.Text);
double total = firstItem + secondItem;
lblTotal.Text = total.ToString();
lblDiscount.Text = Convert.ToString(0);
if (total > 300)
{
double discount = (total * 10) / 100;
lblDiscount.Text = Convert.ToString(discount);
total = total - discount;
}
double salesTax = (total * 8) / 100;
total = total + salesTax;
lblfinal.Visible = true;
lblfinal.Text = Convert.ToString(total);
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.