Problems


[Page 35 (continued)]

2.1

Some computer science concept questions:

  • What is an object?

  • What is a class?

  • What is a type? Why are types important?

  • What is casting? What is it used for?

  • What is a variable? When do you need one? What are the differences between object variables and primitive variables?

  • What is garbage collection?

  • What are relational operators? What are math operators?

  • What is a string?

2.2

What objects would you encounter in a bank?

2.3

What objects would you encounter in going to a movie?

2.4

What objects would you encounter in a clothing store?

2.5

What objects are involved in a airplane flight?

2.6

What objects are in your classroom?

2.7

What objects would you encounter when you go to the dentist?

2.8

Use the interactions pane to calculate how long it will take to travel 770 miles at an average speed of 60 miles per hour? How much shorter will it take if you average 70 miles per hour?


[Page 36]
2.9

Use the interactions pane to calculate how much money you will make if you work 40 hours at $13.00 and 10 hours at time and a half?

2.10

Test your understanding of Java with the following:

  • What does System.out.println(); do?

  • What does the statement System.out.println(3 + 2); do?

  • What does the statement System.out.println("The answer is: " + 3 + 2); do?

  • What does the statement System.out.println("Hi " + " there"); do?

2.11

Test your understanding of Java with the following:

  • What does the code int x = 3; System.out.println("The result is" + x); do?

  • What does the code String firstName = "Sue"; System.out. println(firstName); do?

  • What does the code System.out.println(2 < 3); do?

  • What does the code System.out.println(2 == 3); do?

  • What does the code System.out.println(3 >= 2); do?

2.12

What does int x = 1 / 3; System.out.println(x); do and why?

2.13

What does double d = 1 / 2.0; System.out.println(d); do and why?

2.14

What does double d1 = 1 / 3; System.out.println(d1); do and why?

2.15

What does the double d2 = (double) 1 / 3; System.out. println(d2); do and why?

2.16

Declare variables for each of the following:

  • the number of people in your family

  • the cost of a video game

  • your name

  • answer to, "Are you righthanded?"

  • the temperature in your room

  • the number of items in a shopping cart

2.17

Declare variables for each of the following:

  • your grade point average

  • your telephone number

  • the number of times you were absent from class

  • the number of miles from your home to school

  • answer to, "Do you wear glasses?"

  • your credit card number


[Page 37]
2.18

Which of the following is the correct way to declare a variable that represents a price?

  • declare double price = 0;

  • int price = 0;

  • Integer price = 0.0;

  • double PRICE = 0.0;

  • double price;

2.19

Which of the following is the correct way to declare a variable that represents the desired quantity of an item in an order?

  • double numItems;

  • INT numItems;

  • int numItems;

  • DOUBLE numItems;

2.20

Which of the following is the correct way to declare a variable that represents whether an order has been canceled?

  • BOOLEAN canceled = false;

  • boolean canceled = false;

  • boolean CANCELED = false;

  • boolean canceled = FALSE;



Introduction to Computing & Programming Algebra in Java(c) A Multimedia Approach
Introduction to Computing & Programming Algebra in Java(c) A Multimedia Approach
ISBN: N/A
EAN: N/A
Year: 2007
Pages: 191

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net