63.7k views
16 votes
Write a Console program, let users to enter prices calculate subtotal, tax, and total.

- Delcare variable data type as decimal (6 variables needed)
decimal apple;

- Conver string to decimal from input
apple = Convert.ToDecimal(Console.ReadLine());

- Do addition for subtotal

- Multiplication for tax (0.065M) --- M or m stands for money value, read page 94.

- Addition for total

- You need to show only two digits after decimal point
Console.WriteLine(" Subtotal: ${0}", String.Format("{0:0.00}", subTotal));



blank line: Console.WriteLine("")



Console.Write(" Apple: $");
apple = Convert.ToDecimal(Console.ReadLine());

User Saru
by
6.4k points

1 Answer

4 votes

Answer:

Step-by-step explanation:

This is a project I already submitted, but I never received feedback. All my upcoming assignments will be based on this, so I wanted to make sure it is correct. I got this program to work as far as calculating the information, but I was hoping someone could please let me know if it meets the parameters/requirements?

I did attempt it. It works and adds the items exactly how the example showed in the video. However, I wanted to make sure my code is solid, and not just a mishmash or working because I got lucky, and if there is a better more solid way to do this I want to make sure I can. I do want feedback so I can learn and get better and I am trying my hardest. I always right out all the code I see here and try it and learn what it does piece by piece, because it helps me learn and improve. I also want to make sure it is going to work once I start the code for the next half of the requirements.

i cant really help they dont let us put codes on here

User Berkus
by
6.4k points