# C# COIS1020H Question 2 Donuts

Feb 3rd, 2012
Studypool Tutor
Trent University
Price: \$15 USD

Tutor description

Q2: Write a C# program that computes a the cost of donuts at your local Rich Horton’s store. The cost, of course, depends on the number of donuts you purchase. The following table gives the break down: Donuts Purchased Cost per Donut (\$) < 6 0.50 <= 15 0.40 >15 0.30 A customer can save on the HST (13%) if they buy 12 or more donuts so only charge HST (constant) on the purchase if the customer purchases less than 12 donuts. Finally, there is a cover charge for the luxury of actually getting one of Rich Horton’s gourmet donuts. The constant cover charge is a flat \$0.25 (before HST) which is added to the cost no matter how many donuts are purchased. The program should input the Customer’s Last Name (string), and the number of donuts purchased (int). The program should output (in a neat manner): Last Name, Number of Donuts Purchased, and Total Cost. If the user enters a negative number of donuts, print out an error message and do not print out the total.

Word Count: 206
Showing Page: 1/2
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace CSDonuts{ class Program { private const double HST = 0.13; private const double COVER_CHRG = 0.25; static void displayIntro() { Console.WriteLine("Welcome to Rich Horton's Donut Store"); Console.WriteLine(); Console.WriteLine("Donuts Purchased\t\tCost per Donut (\$)"); Console.WriteLine("< 6\t\t\t0.50"); Console.WriteLine("<= 15\t\t\t0.40");

## Review from student

Studypool Student
" This tutor is great! "

1829 tutors are online

### Other Documents

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors