123k views
5 votes
The exercise instructions here are long -- please read them all carefully. If you see an internal scrollbar to the right of these instructions, be sure to scroll down to read everything. Declare and initialize the following variables:_______.

A) A variable month of Year, initialized to the value 11.
B) A variable company Revenue, initialized to the value 5666777.
C) A variable first Class Ticket Price, initialized to the value 6000.
D) A variable total Population, initialized to the value 1222333.

User Campbeln
by
5.1k points

1 Answer

2 votes

Answer:

A) int monthofYear = 11;

B) long companyRevenue = 5666777;

C) int ClassTicketPrice = 6000;

D) long totalPopulation = 1222333;

Step-by-step explanation:

A) The variable monthofYear is initialized with value 11. The data type of the variable is int as 11 is an integer value.

B) The variable companyRevenue is initialized with value 5666777. The data type of the variable is long as 5666777 is a large value and need more bytes to store in the memory.

C) The variable ClassTicketPrice is initialized with value 6000. The data type of the variable is int as 6000 is an integer value.

D) The variable totalPopulation is initialized with value 1222333. The data type of the variable is long.

Note: - The programming language (C, C++, JAVA, etc) in which the variables are declared is a case sensitive language that is no special symbol and white spaces are allowed while declaring the variables.

User Muhammad Vakili
by
5.2k points