Answer:
Question is answered using python:
num = int(input("User Input: "))
for i in range(3):
num = num+1
print("Number is now "+str(num))
for i in range(3):
num = num-1
print("Number is now "+str(num))
Explanation:
This line prompts user for input
num = int(input("User Input: "))
The following iterates from 1 to 3
for i in range(3):
This increments user input each time
num = num+1
This prints the value of num after increment
print("Number is now "+str(num))
The following iterates from 1 to 3
for i in range(3):
This decrements the value of num
num = num-1
This prints the value of num after decrement
print("Number is now "+str(num))
Answer:
rows and columns, or matrix
Explanation:
Two-dimensional 2D arrays are being indexed with the help of two subscripts. The first one is for the row and the second one if for the column. And each of the elements of the 2D array must be of the one kind like they all can be an object type or they all can be of primitive type.
Like:
int A[3][3];
The above is the 2-dimensional array in C++, and elements are of type int, which is a primitive data type.
Because this is a on your own problem, it cannot be solved. You must speak to it after the person says something.
Answer:
The definition of a class Telephone is given as
public class Telephone // class telephone
{
String number; // variable number of type string
static int quantity = 250;
// variable quantity of type int
static double total = 1565.92; // variable total of type double
}
Explanation:
Following is the description of Statement
- Create a class "Telephone" by using the keyword class.In that class we declared data member .
- We declared a variable "number" of type "string" which has no constructor.
- We declared a variable "quantity" of type "int" which is a static type variable. The static type variable retains the value during the program execution.
- We declared a variable "total" of type "double" which is a static type variable. The static type variable retain the value during the program execution .