Question
Fix the code using C# shown below to show the repitition as seen on the example screenshot: (Invalid error must repeat): using System; using System.Collections.Generic;
Fix the code using C# shown below to show the repitition as seen on the example screenshot: (Invalid error must repeat):
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace Program { class Program { static void Main(string[] args) { double num, count = 0; double Tax = 0.00, ship = 5.00, sum = 0.00; double grandtotal; char line;
//Set run =true bool run=true; do {
//read amount of item Console.WriteLine("What is the amount of item : "); //read in num run=double.TryParse(Console.ReadLine(), out num); //check if run is not true that means returns false if entered //value is not number of type double while (!run) { //prompt for value Console.WriteLine("Please re-enter : "); Console.WriteLine("What is the amount of item : "); //read in num run = double.TryParse(Console.ReadLine(), out num); //check if run is true and num is less than 0 if (run && num
} while (line != 'n' && line != 'N');
Console.WriteLine("-----------------------------------------------"); Console.WriteLine("\t\tSales Receipt\t\t\t"); Console.WriteLine("Total Purchase : \t\t\t$" + string.Format("{0:0.00}", sum)); ship = sum / 10; Console.WriteLine("Shippint charges :\t\t\t$" + string.Format("{0:0.00}", ship)); Console.WriteLine("Number of item purchased:\t\t" + count);
if (count 3 && count 6 && count 10 && count
Console.WriteLine("-----------------------------------------------"); grandtotal = sum + ship + Tax; Console.WriteLine("Grand Total : \t\t\t\t$" + string.Format("{0:0.00}", grandtotal));
Console.ReadKey();
} } }
the of What i he item? - -10 Invalid data entered- Please re-enter the amount of the item- n Invalid data entered - Please re-enter the amount of the item - h Invalid data entered - Please re-enter the amount of the item -5.e s amount tStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started