Question: C# problem: Requirements: Use the appropriate looping construct for a posttest loop. You can assume that the user provides valid numeric input, but you may

C# problem: C# problem: Requirements: Use the appropriate looping construct for a posttestloop. You can assume that the user provides valid numeric input, but

Requirements: Use the appropriate looping construct for a posttest loop. You can assume that the user provides valid numeric input, but you may use any conversion method (Parse(), Convert() or TryParse()) to convert the string to a number. Use accurate and efficient range checks to determine price per piece. Use one and only one WriteLine() to produce your output (Hint: outside of the range check decision structure, perhaps?) Make sure dollar amounts are printed using currency formatting. Apart from that, you may use any technique for formatting the string (placeholders, concatenation, string interpolation.) You do not need to build constants to hold the various range boundary values. Number of Chocolates Payment per Chocolate O and below 0.00 0.73 O to 500 (non-inclusive) 500 to 1000 (inclusive) Over 1000 1.58 2.15 Example Output *** PROBLEM 1 *** How many pieces? Enter any whole number or -999 to quit: 100 At 100 pieces at $0.73 per piece, you've earned $73.00. How many pieces? Enter any whole number or -999 to quit: 0 At o pieces at $0.00 per piece, you've earned $0.00. How many pieces? Enter any whole number or -999 to quit: 1000 At 1000 pieces at $1.58 per piece, you've earned $1,580.00. How many pieces? Enter any whole number or -999 to quit: 10000 At 10000 pieces at $2.15 per piece, you've earned $21,500.00. How many pieces? Enter any whole number or -999 to quit: -50 At -50 pieces at $0.00 per piece, you've earned $0.00. How many pieces? Enter any whole number or -999 to quit: -999

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!