Chapter 2, Part 2
Numerical Data Types
There are a large variety of numerical types in Java.
They fall under two types:
Floating-point: Have a decimal part.
float: has 7 or 8 decimal places after the decima
Write a program that lets the user perform arithmetic operations. First ask the user for a first
number. Then use a while loop to do the following:
1. The user enters another second double number.
2. The user selects
Write a program that lets you take a word and convert it to 'Pig Latin'. The rules of conversion
are as follows:
Take the letters up to the first index of a vowel and move it to the end of the word. Then add an
"ay" on th
Electric Fields and Equipotential Lines
Map out the equipotential lines and electric field due to a given 2-D charge
configuration, using voltage measurement techniques.
An electric field is said to exist at a point in
Lab 1 - Static Electricity
To investigate the nature of static electricity.
Static electricity is familiar in everyday life, whether manifested as a spark after you shuffle
your stocking feet across a carpet and touch a
Chapter 6, Part 1
The Basics of
Motivation for Using methods
Find the sum of integers from 1 to 10, from
20 to 30, and from 35 to 45, respectively.
/ IN MAIN
int sum = 0;
for (int i = 1; i <= 10; i+)
sum += i;
Lab 2 - Conceptual Introduction to Circuits
In this lab well be analyzing the dierences between dierent arrangements of simple circuits. The two types of connections for a simple circuit are series connections and parallel
connections. One way
Chapter 6, Part 2
A return statement is required for a value-returning method.
The method shown below in (a) is logically correct, but it has
a compilation error because the Java compiler thinks it
Lab 8 - Coulombs Law for Magnetism
Objective: Measure the magnetic force between two north (or south) poles and find its dependence on distance.
Magnetic forces behave very similarly to electric forces, with the exception that there
What is a Computer?
A computer consists of a CPU, memory, hard disk, floppy disk,
monitor, printer, and communication devices.
e.g., Disk, CD,
public static void main(String args) cfw_
int a = 7;
int b = 35;
/ swap a with b
System.out.println(a + " " + b);
public static void swap(i