Monday, June 18, 2012

Homework 2: Initialization

1. Declare an integer variable  cardsInHand and initialize it to 13.

int cardsInHand = 13 ;

2.  Declare a variable  temperature and initialize it to 98.6.

double temperature = 98.6 ;

3. Declare a numerical variable  precise and initialize it to the value 1.09388641.

double precise = 1.09388641 ;

4.  Declare and initialize the following variables: 
A variable  monthOfYear , initialized to the value 11
A variable  companyRevenue , initialized to the value 5666777
A variable  firstClassTicketPrice , initialized to the value 6000
A variable  totalPopulation , initialized to the value 1222333

int monthOfYear = 11 ; int companyRevenue = 5666777 ; int firstClassTicketPrice = 6000 ; int totalPopulation = 1222333 ;

No comments:

Post a Comment