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

  Chess program, enable a monitoring component

Given a chess program, enable a monitoring component to switch planning algorithms at runtime, based on the opposing player's style and response time.

  Construct vector and linked lists data structures

You will prepare sorted versions of the Linked Lists and Vector data structures developed in class

  In psuedocode, design an application

In psuedocode, design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values

  Uml diagram of all the classes

Speaking of converting into the correct object-type, the goal of the factory is to abstract away object creation.

  Prompt the user for and read 6 numbers

Write a program using an array that will store input data. Prompt the user for and read 6 numbers between 70 and 90. Verify the numbers should be greater than 70 and less than 90. If the number is less than or equal to 70 or greater than 90, repro..

  Display the array, the average and the number of days above

Write a program that stores the daily temperatures for the month of April in an array name dailytemp. Calculate the average temperature for the month and the count the number of days that the daily temperature was above the average.

  Write a program which accepts the total of food and drink

Write a program which accepts the total of food and drink purchased for a restaurant bill as input. The output should be adjusted bill with a sales tax of six percent 6% and a tip (gratuity) of 15%.

  Implementation of data member counter of type int

Write the implementation (.cpp file) of Counter class. Here is the full specification of the class: A data member counter of type int.

  Create a structure that has one variable called value

"Create a structure that has one variable called value and one pointer to the list (making it a linked list). Prompt for 5 values from the keyboard as input and store them in the linked list. Print out the current contents of the list.

  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

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  C assignment of curl library

C Assignment Curl library must be used To be done on linux, it should be compiled using the following command: gcc -Wall -ansi -pedantic NameOfFile.c -lncurses Please make sure it is commented with clarification Variable names in camel case

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