Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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 at the beginning of the program to make the setprecision(2) output stream manipulator available in code. CSIS 123 C++ Programming Fundament! Labos - Membership CSIS 123 CH Programming Fundamentals Membership Application Implemented in C++ Create a Windows program named Lab05-Membership in a suitable folder. Copy the completed project folder to H:ICSIS123 and turn in a copy on drive X:. Prompt the user for a family name and store the response (no spaces allowed) in a string variable. Prompt for code showing type of membership requested - Regular or Lifetime. Accept reply in char variable. Prompt to request the number of memberships to purchase. Store user answer in an int variable. Use the cout stream object for output prompts. Extract inpul values with cin. Use appropriate variable types to hold user responses. To calculate the cost of memberships, place three named constant declarations with these values at the beginning of the main routine: const double REGULAR_COST = 85.00; const double LIFETIME COST = 495.00; const double DISCOUNT = 0.32; Based on user input for membership type (R or L), assign one of the two named constant amounts for the chosen type of membership to a cost variable for use in calculations. Use an if structure to select and assign the proper cost value. (Suggestion: check for an uppercase or lowercase 'L' to indicate lifetime membership. Let any other answer assign regular membership - the else portion of the structure.) When 5 or more memberships are ordered, the user is entitled to a discounted price. Multiply the assigned cost by the named constant for the current discount and subtract this value from the full membership cost. 1. Declare a membership cost variable to hold the price of one single membership (if Lis entered, assign LIFETIME_COST to membership cost, else assume R and assign REGULAR_COST to that variable). 2. If number of memberships is 5 or more, calculate a discount price and adjust membership cost accordingly. 3. Multiply this membership cost by the number of memberships requested to calculate the total amount. CVC Project: Labo02-Membership Debug Membership eve CAVC Projects Labo02-Membership Debug Membership.exe Enter Family Baret Robertson Enter Family name: Harper Rey or Life - RLR Rey or Life - L7 L Membership count 1 Membership countt 2 1 nenberships $15.00 - $ 85,00 2 nenberships e $ 495.00 - $990.88 Press any key to continue... Press any key to continue... CCProjects Lab2-Membership Debug Membership exe CAVC Projects Labs02 Membership Debug Membership ene Enter Family name: Sunners Enter Fantly name: Granville Rey or Life - RAL7 Rey or Life - RLY Membership counts Membership count 5 S herships @ 57.88. 462.49 5 nenberships @ $ 336.68 1693.99 ress any key to contine .. Press any key to continue.. Display calculated results at the console, on a line following the three user prompts and responses. Include the class library to enable input and output of string values. Add the library so that dollar amounts can be displayed in fixed format, with two digits to the right of the decimal place. Stream fixed and setprecision(2) manipulators to cout to accomplish this. There is no need to use setw(n) for the simple outputs of this program. Line up input prompts and output values as shown. Follow standard naming conventions for variables, named constants and other program objects

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

what is a peer Group? Importance?

Answered: 1 week ago

Question

b. Where did they come from?

Answered: 1 week ago

Question

c. What were the reasons for their move? Did they come voluntarily?

Answered: 1 week ago

Question

5. How do economic situations affect intergroup relations?

Answered: 1 week ago