Question: cogramming Exercise 8-3 Tasks Auction.cs + >_Terminal + 1 Bids greater than or equal to $10 are accepted Bit accepted Bit not high enough Bit

 cogramming Exercise 8-3 Tasks Auction.cs + >_Terminal + 1 Bids greater

cogramming Exercise 8-3 Tasks Auction.cs + >_Terminal + 1 Bids greater than or equal to $10 are accepted Bit accepted Bit not high enough Bit accepted 0.00 out of 10.00 1 using System; 2 using System.Text.RegularExpressions; 3 public class Auction { 4 static void Main() { 5 AcceptBid(12,10); //call the method with int, int 6 AcceptBid(8.75,10); // call the method with double, int 7 AcceptBid("18 dollars", 10); //call the method with string, int 0 out of 3 checks passed. Review the results below for more details. 8} Checks Unit Test Incomplete Method Acceptbld accepts int bid over $10 > Unit Test Incomplete Method AcceptBid accepts string bid over $10 Unit Test Incomplete Method AcceptBtd accepts double bid over $10 Bids less than $10 are not accepted 9 public static void AcceptBid(int bid, int min) //method definition 10 { 11 if(bid>min) //check bid is greater the min or not 12 Console.WriteLine("Bit accepted"); //print text 13 else 14 Console.WriteLine("Bit not high enough"); 15 16] 17 public static void AcceptBid(double bid, int min) //method definition 18 { 19 if(bid>min) //check bid is greater the min or not 20 Console.WriteLine("Bit accepted"); 21 else 22 Console.WriteLine("Bit not high enough"); 23 24] 25 public static void AcceptBid(string bid, int min) //method definition 26 { 27 var num-Regex.Match(bid, @"\d+").Value; //get numbers from string bid 28 //check the string is starts with $ or ends with dollar and num Length is > 0 29 if((bid.StartsWith("$")|bid.EndsWith("dollars"))&&num. Length>e) 30 { 31 int num1=Int16.Parse(num); // convert string to int 32 if(numl>min) //check numi is greater than min or not 33 Console.WriteLine("Bit accepted"); 34 else 35 Console.WriteLine("Bit not high enough"); 36} 37 else 38 Console.WriteLine("Bid was not in correct format"); 39] 40 } 41 0.00 out of 10.00 The message "Bid not high enough" was not detected for bids under $10. Checks Unit Test Incomplete Method AcceptBid rejects string bid under $10 Error message is displayed whe... >

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The issue in your code seems to be mainly due to misprints and improper logic syntax Heres a correct... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!