Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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):

image text in transcribed

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 t

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications Dasfaa 2023 International Workshops Bdms 2023 Bdqm 2023 Gdma 2023 Bundlers 2023 Tianjin China April 17 20 2023 Proceedings Lncs 13922

Authors: Amr El Abbadi ,Gillian Dobbie ,Zhiyong Feng ,Lu Chen ,Xiaohui Tao ,Yingxia Shao ,Hongzhi Yin

1st Edition

3031354141, 978-3031354144

Students also viewed these Databases questions

Question

Discuss consumer-driven health plans.

Answered: 1 week ago