Answer:
Replace /* Your solution goes here */
with
<em>const int CENTS_PER_POUND = 25;
</em>
<em>
cout << "Weight(lb): ";
</em>
<em>cin >> shipWeightPounds;
</em>
<em>shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;
</em>
<em />
Explanation:
This line declares and initializes CENTS_PER_POUND as constant integer to 25
const int CENTS_PER_POUND = 25;
This line prompts user for weight of shipment
cout << "Weight(lb): ";
This line gets weight from the user
cin >> shipWeightPounds;
This line calculates the cost of shipment
shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;
Answer:
def length( mystring):
count = 0
for i in mystring:
count += 1
return count
def reversed( mystring):
strlist = []
for i in range(length(mystring)):
strlist.append(mystring[(length(mystring) - 1) - i])
txt = "".join(strlist)
return txt
string = 'Yolanda'
print(reversed(string))
Explanation:
The python module defines two functions 'reversed' and 'length'. The length function counts the number of characters in a string variable while the reversed function reverses the string variable value.
Answer: 32 bit number
Explanation:
The IP address basically contain 32 bit number as due to the growth of the various internet application and depletion of the IPV4 address. The IP address basically provide two main function is that:
- The location addressing
- The network interface identification
The IP address are basically available in the human readable format. The IPV6 is the new version of the IP address and its uses 128 bits.
Answer:
a=input("Amount in pennies")
b=int(a)
dollars=0
dimes= 0
quarters=0
nickels=0
pennies = 0
dollars = int(b/100)
b= b- dollars *100
quarters=int(b/25)
b=b-quarters*25
dimes = int(b/10)
b = b -dimes*10
nickels=int(b/5)
b=b - nickels * 5
pennies = b
print(dollars)
print(dimes)
print(nickels)
print(pennies)
Explanation:
The required program is in answer section. Note, the amount is entered in pennies.