Calculate and display the number of units of electricity

Assignment Help C/C++ Programming
Reference no: EM13165440

The manager of PG&E wants a program that calculates a customer's electric bill. He will enter the current and previous meter readings. The program should calculate and display the number of units of electricity used and the total charge for the electricity. The charge for each unit of electricity is $0.11. The program allows the user to display the electric bill for more than one customer without having to run the program again. Use a sentinel value to end the program. Create 3 functions: getInput: Gets the current and previous meter readings from the user. If the user does not enter a sentinel value as the current reading, the getInput function should prompt the user to enter the previous reading. To be valid, the current reading must be greater than or equal to the previous reading. The main function should not call the calcBill or displayBill functions when the readings are not valid. Instead, it should display an error message. calcBill: Calculates both the number of units used and the total charge. displayBill: Displays both the number of units used and the total charge. Input Validation: Do not accept negative numbers for meter readings 

Reference no: EM13165440

Questions Cloud

Process cost system to record the costs of processing : HomeStyle Soup Co. uses a process cost system to record the costs of processing soup, which requires the cooking and filling processes. Materials are entered from the cooking process at the beginning of the filling process.
Find the amount of heat transferred from the water : A 486 mL sample of water was cooled from 50.0°C to 10.0°C. Assuming a specific heat of 4.184 J/K g and a density of 1.00 g/mL, find the amount of heat transferred from the water to the surroundings.
What will be the equilibrium concentration of co : what will be the equilibrium concentration of CO.
For this program reads the first 11 characters : E main for this program reads the first 11 characters from input, saving them. It then reads 26 short integers into |vals|, and passes them and the characters to EmbedWatermark, which subtly alters the contents of vals to contain the characters. A..
Calculate and display the number of units of electricity : The manager of PG&E wants a program that calculates a customer's electric bill. He will enter the current and previous meter readings.
Jerry has done some analysis : Jerry has done some analysis about the profit ability of the bicycle shop. If Jerry builds the large bicycle shop, he will earn $60,000 if the market is good, but he will lose $40,000 if the market is bad
Design a 8m x 32 bit memory board : design a 8M x 32 bit memory board. You may use only 256K x 8 bit RAM chips with full parallel addressing.
Create a book class : Create a Book class. In addition to properties of author and isbn, with setters/getters, the Book should override Object's base method "boolean equals(Object)" and have a "boolean validate()" method.
Implement the vector class using inheritance : Is it better to implement the Vector class using inheritance (is-a relationship) or composition (has-a relationship). In other word, which one of the following gives a better implementation?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  If a class is derived protected

If a class is derived protected from a base class, explain how this affects the inheritance of all public, protected, and private members of the base class by the derived class.

  Base process which communicate with child processes

Write a program which has a "base process" which communicates with child processes acting as "bombers" that it creates.

  State diagram to recognize one form

Design a state diagram to recognize one form of the comments of the C-based programming languages, those that begin with /* and end with */. and also Write and test the code to implement the state diagram.

  Make a class employee

Make a class EMPLOYEE with a name and salary. Make a class MANAGER inherit from EMPLOYEE. Add an instance field, named DEPARTMENT

  Declare a vector

Declare a vector of these structures where the size of the vector is to be 7.

  Write c program-visual studio to scan multiple text files

Write program in C or C++ and Visual Studio to scan multiple text files and count number of occurrences of each word in those files. Use binary tree to keep track of all words.

  Reads in a list of integers

Write a program in C++ that reads in a list of integers into and array with base type int. Provide the facility to either read this array from the keyboard or from a file, at the user's option. If the user chooses file input, the program should reque..

  Change this code to read in strings from a text file

code takes in a string from a user, checks if the paranthesis are ballanced (as defined by my class) and also returns the variable from my line (also from my class). All like to change this code to read in strings from a text file (each line is a str..

  How a base version of this assignment works

For this assignment you are to create an interactive moving sign in the context of a cityscape street scene. Click the link below to see how a base version of this assignment works. Type a message in the long blank slot at the top left, and then clic..

  Is a void function a function that does not return a value?

Is a void function a function that does not return a value?

  Make a game in which you guess a number

Make a game in which you guess a number between two set numbers to find the answer, the game should tell you if you are too low in your guess or too high. For example

  Create a customer profile class.

a. Create a CustomerProfile class. Each CustomerProfile contains a last name, phone number, and bit fields indicating whether the customer:

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd