The electric bill program illustrates the use of loops (i.e. iteration)
Loops are used to execute repetitive operations
The electric bill program in Python where comments are used to explain each line is as follows:
#This iteration shows that the process is repeated for 50 consumers
for i in range(50):
#This gets input for the consumer name meter number
mno = input("Consumer name meter number: ")
#This gets input for last month reading
lmr = int(input("Last month reading: "))
#This gets input for current month reading
cmr = int(input("Current month reading: "))
#This calculates the number of units
Nou = cmr - lmr
#This calculates the bills
bill = Nou*2
#This calculates the tax
tax = bill*0.15
#This calculates the netbills
netbill = bill+tax
#This next four lines print the electric bills
print("Number of units:",Nou)
print("Bills:",bill)
print("Tax:",tax)
print("Netbill:",netbill)
Read more about loops at:
Answer:
The DoubleDecimalTest class is as follows:
using System;
class DoubleDecimalTest {
static void Main() {
double doubleNum = 173737388856632566321737373676D;
decimal decimalNum = 173737388856632566321737373676M;
Console.WriteLine(doubleNum);
Console.WriteLine(decimalNum); }}
Explanation:
Required
Program to test double and decimal variables in C#
This declares and initializes double variable doubleNum
double doubleNum = 173737388856632566321737373676D;
This declares and initializes double variable decimalNum (using the same value as doubleNum)
decimal decimalNum = 173737388856632566321737373676M;
This prints doubleNum
Console.WriteLine(doubleNum);
This prints decimalNum
Console.WriteLine(decimalNum);
Unless the decimal variable is commented out or the value is reduced to a reasonable range, the program will not compile without error.
Answer:
65
Explanation:
Answer:
65
Explanation:
Answer:
sample output
Enter f0 = 440
440.0,466.1637615180899, 493.8833012561241,
523.2511306011974, 554.3652619537443
Explanation:
import math // math library
def RaiseToPower(): // RaiseToPower method
r = math.pow(2,1/12) //r = 2^(1/12)
f0 = float(input('Enter f0 : ')) //input from user
//a key has a frequency,sy f0
print(f0,end=' ') //Display statement
for n in range(1,5): //Iterate the loop up to the next 4 higher key Hz
n = f0 * math.pow(r,n) //calculate the fn value
print(fn,end=' ') //Display statement
RaiseToPower() //Call RaiseToPower method
Rest the left-hand’s fingers on A,S, D, and F keys.
Rest the right-hand’s fingers on A,S, D, and F keys.
Rest the right-hand’s fingers on Q,W, E, and R keys.
Answer:
Rest the right-hand’s fingers on Q,W, E, and R keys.is the correct answer
Explanation:
Answer:
System Interfaces.
Explanation:
Most new information systems must communicate with other, existing systems, so the design of the method and details of these communication links must be precisely defined. These are called system interfaces.
Answer:The key to analytics success is not about searching for answers, ... If you are trying to determine where to find new customers, there is a recipe for how to do that, and it ... As we work with small businesses, we help them answer their big ... Moving forward, there is going to be a lot more data of varying types.
Explanation: