The line code will create array is G = array('f',[2.5, 3, 7.4])
<h3>What is meant by array ?</h3>
As opposed to defining distinct variables for each value, arrays are used to hold numerous values in a single variable. Set the data type (such as int) and the array name, followed by square brackets [, to construct an array.
An array is a collection of elements with the same type that are kept in nearby memory locations and may each be separately referred to using an index to a special identifier. There is no need to declare five distinct variables when declaring an array of five int values (each with its own identifier).
In the C programming language, arrays are a derived data type that may contain primitive data types like int, char, double, float, etc.
To learn more about array refer to :
brainly.com/question/28061186
#SPJ1
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))
IPR offers ownership of the intellectual property. The owner of the property has the right to a monetary gain from those who wish to use it.
A formula is statement written by the user to be calculated. Formulas can be as simple or as complex as the user wants. A formula can contain values, references to cells, defined names, and functions.
All formulas must start with the equals sign. =1+2+3
A function is a piece of code designed to calculate specific values and are used inside formulas. Functions to sum values, calculate a trigonometric cosine, and to calculate the current time are built into excel. Additional functions can be defined using Visual Basic.
Functions are typed alongside parenthesizes, where in the arguments if any are listed in between. To use functions in a formula, for example
=COS(3.14) will return the calculated cosine. =NOW() returns the current time. =SUM(1+2+3) *2 will multiply the sum by 2Explanation hope it helps