CS 31 Projects 2 Specs & Solution

CS 31 Projects 2 Specs & Solution - Fall 2011 CS 31...

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
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. If the number of text messages is negative:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/06/2012 for the course CS 31 taught by Professor Melkanoff during the Fall '00 term at UCLA.

Page1 / 8

CS 31 Projects 2 Specs & Solution - Fall 2011 CS 31...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online