Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The programming language is C++ PA7- Water Bill Part A (getting information) Iteration, Selection, And/Or Logical Operators, Data Validation, Value and Reference Parameters, File Processing
The programming language is C++
PA7- Water Bill Part A (getting information) Iteration, Selection, And/Or Logical Operators, Data Validation, Value and Reference Parameters, File Processing Write a program that will get the billing information for a local water company and store it in a file The water company has different types of customers and their rates vary depending on how the water is used The company uses letter codes to identify the following types of customers H for home, C for commercial, and I for industrial The information collected for each account includes: the customer name, the account number, the code for the account type (H, C or I) and the amount of water used Input Data: Get the following data from the user by calling your library function:s Customer Name: multiword string class object of max size 20 characters create a generic readName Account Number integer in the range 1000 to 9999 - use readlnt Account Type character H. C. or I-create an overloaded readChar Usage Amount: floating point with a minimum value of 0- use readDouble Specifications for Program Overload your readChar library function to create another generic, reusable function that will read and validate one of three possible characters by adding an extra char parameter. When tested move this function (and its prototype) to your library of reusable functions 1. 2. Modify your readDouble function to add formatting for the min and max parameters such that very large anc very small numbers (perhaps above 1e6 and below 1e-6) are displayed in scientific notation and other numbers and 0 are displayed in fixed decimal format. Use a precision of 6 for both formats. Code by using the ternary conditional operator?: and the logical operators && (and) I (or) in the error message cout statement 3. Create a new value-returning function of type string called readName that will be a generic, reusable function that can be used to read, validate and return a name. The function should only accept alphabetic letters and special characters such as apostrophe, period, comma, hyphen, a blank space, etc. that are typically valid for a name. See more on last page. When tested move this function (and its prototype) to your library Note: you may want to code some driver functions to test the above library functions 4. The main function shall be iterative, processing one record at a time until all data has been entered and valid records are written to a file as described below. Use your readChar function to receive user answers to continue entering records or to quit a. Include theStep 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