Answer:
The program in Python is as follows:
qty = int(input("Quantity: "))
price = 100 * qty
if qty >1000:
price = (100 - 0.10 * 100) * qty
print("Cost: "+str(price))
Explanation:
This prompts the user for the quantity
qty = int(input("Quantity: "))
This calculates the price or cost, without discount
price = 100 * qty
This checks if the quantity is greater than 1000
if qty >1000:
If yes, this calculates the price or cost, after discount
price = (100 - 0.10 * 100) * qty
This prints the calculated cost
print("Cost: "+str(price))
Answer:
ALTER TABLE Products
ADD Products_price float(5,2) DEFAULT 9.99,
ADD Adding_time datetime;
Explanation:
So at first we need to use ALTER TABLE statement, when we use this statement we also need to provide the table name. In this case, i assume it is 'Products'.
Then, as per question, we need to add two columns.
The first one is 'product_price' and it contains decimal points. So, we need to use ADD statement and give a column name like 'Prodcuts_price' and its datatype 'float' because it contains decimal or floating points. so, for 3 digits on the left and 2 digits on the right, it makes a total of 5 digits. So, we need to declare it like this. (5,2) it means a total of 5 digits and 2 after the decimal point. after that, we need to set our Default value using the DEFALUT statement. so DEFAULT 9.99. it will set the default value to 9.99 for existing products.
And for our next column, we give its a name like 'Adding_time' then it's datatype 'datetime' because it will contain date and times.
Answer:
The answers are explained below
Explanation:
1) Identify the potential classes in this problem domain be list all the nouns
class Customer
class Acco unt
2) Refine the list to include only the necessary class names for this problem
the class customer is not necessary to solve the problem itself, therefore the only class could be the account class
3) Identify the responsibilities of the class or classes.
The responsibilities of the class account will be
* determination of the type of account--> Acc ount . type(char)
* deposit money into the account --> Acc ount . de posit(float)
* withdraw money into the account --> Acc ount . with draw(float)
* show balance of the account --> Acc ount . bal ance()
* generate interest --> Acc ount . int erest()
Please join the words together. I used spaces due to regulations
Answer:
You will use Single Mode Fiber (SMF).
Explanation:
SMF is the best option in this case since we will be installing segments of up to 4000m. SMF is known for its capability to maintain a high-quality signal and practically zero degradation across long distances.