CS 31 Projects 2 Specs &amp; Solution

# CS 31 Projects 2 Specs &amp; Solution - Fall 2011 CS 31...

This preview shows pages 1–3. Sign up to view the full content.

Fall 2011 CS 31 Programming Assignment 2 Phoney Baloney Time due: 9:00 PM Thursday, October 13 Saturday, October 15 Before you ask questions about this specification, see if your question has already been addressed by the Project 2 FAQ . And read the FAQ before you turn in this project, to be sure you didn't misinterpret anything. (Be sure you also do the homework accompanying this project.) Your job at Surprizin' Wireless is to produce the bill for a customer given their mobile phone usage. The program you write must accept as input the number of minutes used (an integer), the number of text messages sent and received (an integer), the customer's name, and the billing month. Here is an example of a dialog with the program (user input is in boldface ): Minutes used: 385 Text messages: 423 Customer name: Alex Bell Month number (1=Jan, 2=Feb, etc.): 11 --- The bill for Alex Bell is \$48.46 According to Surprizin's usage plan: The basic charge is \$45, which includes up to 400 free minutes and up to 250 free text messages. The charge for minutes beyond 400 is 40¢ per minute. Each text message from the 251st to the 500th cost 2¢ if the month is October through May. However, Surprizin' offers a summer discount: from June though September, each such message costs only 1¢ Text messages beyond the 500th cost 11¢ apiece.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
As an example, Alex above would be charged the base \$45 and no minutes charge, since he didn't use more than 400 minutes. He'd be charged \$3.46 for the 173 texts after his first free 250; those are 2¢ apiece in November. Here's another example: Minutes used: 417 Text messages: 531 Customer name: Elisha Gray Month number (1=Jan, 2=Feb, etc.): 7 --- The bill for Elisha Gray is \$57.71 Elisha's 251st through 500th texts were billed at the July rate. You can test your understanding of the rate schedule by experimenting with the phone charge calculator we found at the Surprizin' Wireless website. Your program must collect the information for one customer in the manner indicated by the examples, and then write to cout a line with three hyphens only (no spaces), followed by exactly one line in a format required below. Our grading tool will judge the correctness of your program by examining only the line following the line with three hyphens. That line you write must be in one of the following five forms; the text must be identical to what is shown, except that italicized items are replaced as appropriate: If the number of minutes used is negative: The number of minutes used must be nonnegative.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern