Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CSIS 123 C++ Programming Fundamentals Assign04 - CableBill Cable Bill Calculation Create the Windows console program shown below. Name the Project Assign04-CableBill. Save the final
CSIS 123 C++ Programming Fundamentals Assign04 - CableBill Cable Bill Calculation Create the Windows console program shown below. Name the Project Assign04-CableBill. Save the final version to your H. drive and turn in a copy on the X: drive. Define const double values at the start of the main function to set these dollar amounts for the program: BASIC RESIDENTIAL 18.50; basic charge - residential BASIC_BUSINESS = 75.00; // basic charge - business CONNECT_RESIDENTIAL = 6.50; // additional connection cost - residential CONNECT BUSINESS - 5.00; Wadditional connection cost (above 10 total)-business PREMIUM RESIDENTIAL = 7.50; 1/cost per premium channel - residential PREMIUM_BUSINESS - 50.00; //cost per premium channel - business Prompt the user for three inputs and store them in suitable variables you have declared: a char variable (R or B) to indicate the type of installation (Business or Residential) an int variable to hold the number of additional connections (zero or more) requested an int variable to store the number of premium channels ordered Use conditional statements to calculate the total cable TV bill based on these values. All subscribers pay a basic charge, depending on the type of installation. Residential customers pay $6.50 for each additional connection. Business subscribers receive up to 10 connections in the basic fee; a charge applies only to the total number of connections more than 10. Up to 9 additional connections incurs no extra charge. Added connections over 9 cost $5.00 per connection. If the number of additional business connections is greater than 9, determine this charge using the total number greater than 9 (use subtraction to calculate). Resi- dential subscribers pay $7.50 per premium channel. Business users pay $50.00 for each premium channel. Suggestion: Check if either B or b is entered in response to the installation type prompt. If so, assign a 'B to the install Type variable. Otherwise, assign 'R' to the variable. (This situation is suitable for an else clause with assignment in the conditional test. In other words, if the user does not specifically indicate a Business installation, assume it is Residential. This avoids cumbersome input error checks and logic tests later. Coding is simpler with only two upper-case values (just R or B) to consider in subsequent condition tests. C CProjects CableBill Debug Cablelill.exe -OX Residential or Business CR or Bl? R How many Additional Connections? 8 Total number of Premium Channels: 2 Total anount of Cable Bill: Press Center> to end... 33.52 Display a dollar sign (S), followed by a space in the calculated cable bill output. Use fixed decimal output. Always show cents (the amount charged with two decimal places) in the output. Include the preprocessor directive #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started