Apple uses social media to promote their products and increase user-engagement. This is a very effective method of advertising.
Straight
Curvilinear
Rectilinear
Answer:
struct item
{
float previousCost;
float taxAmount;
float updatedCost;
} itemObject;
void calculation(int cost,int quantity,float tax)
{
struct item *itemPointer=&itemObject;
itemPointer->previousCost=(cost) * (quantity);
itemPointer->taxAmount=itemPointer->previousCost * (tax/100);
itemPointer->updatedCost=itemPointer->previousCost+itemPointer->taxAmount;
}
Explanation:
- Define a structure called item that has 3 properties namely previousCost, taxAmount and updatedCost.
- The calculation function takes in 3 parameters and inside the calculation function, make a pointer object of the item structure.
- Calculate the previous cost by multiplying cost with quantity.
- Calculate the tax amount by multiplying previous cost with (tax / 100).
- Calculate the previous cost by adding previous cost with tax amount.
Answer:
here is my crude attempt:
import turtle
t = turtle.Turtle()
t.speed(0)
colors = ["black", "yellow"]
SQUARES = 8
SQUARESIZE = 20
def rectangle(color, s):
t.begin_fill()
t.pendown()
t.color(color)
for i in range(4):
t.forward(s)
t.right(90)
t.end_fill()
t.penup()
for row in range(SQUARES):
for col in range(SQUARES):
t.setpos(row*SQUARESIZE, col*SQUARESIZE)
rectangle(colors[(row+col)%2], SQUARESIZE)