Answer:
#include <iostream>
using namespace std;
int main() {
int a[4][5];//declaring a matrix of 4 rows and 5 columns.
for(int i=0;i<4;i++)
{
for(int j=0;j<5;j++)
{
if(i==3)//initializing last row as 0.
{
a[i][j]=0;
}
else//initializing last row as 1.
{
a[i][j]=1;
}
}
}
for(int i=0;i<4;i++)
{
for(int j=0;j<5;j++)
cout<<a[i][j]<<" ";//printing the matrix.
cout<<endl;
}
return 0;
}
Output:-
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
0 0 0 0 0
Explanation:
I have created a matrix of size 4 rows and 5 columns.I have used for loops to fill the array.To fill the last row with 0 i have used if statement.else we are filling it with 1.
Answer: Absolute
Explanation: The Cascading Style Sheet is used to describe the style of a Hypertext Markup Language document. The cascading style sheet has different property value for setting the position of elements. When the property value to absolute, it moves the element relative to its original position and allows other elements to flow into the space that the absolutely positioned element would have otherwise occupied. Element is relative to browser window when set to fixed. Element is positioned relative to its original position when property value is set to relative.
The reason why computers has the need to periodically check
for the DNS of websites that an individual has already visited because certain
websites can change its IP address and that the individual using it can be
directed to a different website that he or she does not know of.
The answer is: Lower overall taxes
Answer:
widgets=float(input("Enter number of widgets you want to buy"))
if widgets<0:
print("Can't compute negative number")
else:
if widgets<100:
cost=widgets*25
else:
cost=widgets*20
print("The total cost of widgets is", cost,"cents")
Explanation:
First I made a variable called widgets to take input of the number of widgets the customer wants to buy. I use the first comditional statement to test if the number of items typed in is not less than zero.
The else statement computed the prices of widgets based on number of widgets greater than zero.
Another conditional statement to check if the widgets is lower that 100 or greater. The cost represents the total amount, in terms of cost it will take for some nuber of widgets.
The last line prints the total cost and some statments