Reference no: EM132401441
Assignment
1) Write a C++ program 6 that allows user to input numbers separated by a new line character and outputs the summation of all the numbers. Users may input any amount of numbers until they input 0, that is, the program should keep taking input from the user until user input 0.
Sample input 22
53
67
-4
0
Output 138
2) Write a C++ that for a given integer n print i * on the ith line for i = 1,2,3,...,n. For example, when an user inputs number 5, the program should output
*
**
***
****
*****
If an user inputs number 4, the program should output
*
**
***
****
3) Write a program to ask the user to enter n.Print the sum of following series until n. 1+1/2+1/3+1/4-------1/n
4) Write a program to ask the user to enter a character. If the character appears in your suburb name then print the message that the character appears in your suburb name else print message that the character does not appear in your suburb address.Hint: Suburb will be fixed by the programmer.
Sample Input: Kurralta Park User Input : t
t appears in your suburb name c
c doesn't appear in your suburb name
5) Write a program to ask the user to enter their customer number and their meter reading for electricity bill generation. Based on the table below calculate the monthly electricity Bill. Make sure you include the supply charge per cycle in the final Bill generated.
South Australia Electricity Pricing
|
Below prices are effective as of July 1 2019.
|
Standing Tarrif
|
Residential Electricity Rates
|
Unit
|
Energy standing Tarrifs
|
General Usage Rates
|
|
Incl GST
|
First 32877 kWh/day
|
c/kWh/day
|
40.18(c/kWh/day)
|
Next 76712 kWh/day
|
c/kWh/day
|
40.28(c/kWh/day)
|
Next 164384 kWh/day
|
c/kWh/day
|
40.38(c/kWh/day)
|
Next 273973 kWh/day
|
c/kWh/day
|
40.48(c/kWh/day)
|
Balance
|
c/kWh/day
|
40.58(c/kWh/day)
|
Supply charge dollars/cycle
|
Dollar per cycle
|
$30
|
6) Write a program to calculate the power of a number entered by the user until the user enters ‘N' or 0 (Its your choice to terminate program either by entering N or 0.)
Sample Input: Enter the base:
Enter the exponent 3 Sample Output = 8
Do you want to calculate again ?