Full file at

Size: px
Start display at page:

Download "Full file at https://fratstock.eu"

Transcription

1 Full file at Solutions to Exercises (Chapters 1 through 4) Dawn Ellis and Frank M. Carrano

2 Chapter 1 Exercises 1. What is volatile and nonvolatile memory? Volatile is a property of primary memory whereas nonvolatile is a property of secondary memory. Primary memory is volatile because when the power to the computer system is interrupted, the contents of primary memory are lost. Secondary memory is nonvolatile because when the power to the computer system is interrupted, the contents in secondary memory remain. 2. Name three input and three output devices. Input devices: mouse, keyboard, scanner Output devices: printer, monitor, and speakers 4. Define a memory address. A memory address is a numerical reference to a physical byte within a computer systems primary memory. The designers of the computer system fix this address. The address cannot be changed, but the contents in which the address refers can be changed. 5. What is a binary numeral? A binary numeral is a sequence of bits. A bit can have the value of either a 1 or a What is the decimal equivalent of the following binary numbers? 10110, 11001, = = = = = = = = = 21

3 7. Java is a multiplatform programming language. What does this statement mean? Java source code is compiled into a file containing byte code when is interpreted by the Java Virtual Machine. The Java Virtual Machine is designed to run on many different operating systems, making a Java a platform independent language.

4 Chapter 2 Exercises 1. What are the three categories of Java identifiers? Give an example of each category. Identifiers fall into one of three categories: identifiers that we invent, identifiers that another programmer has chosen, and identifiers that are part of the Java language. Identifiers we invent: sample, args Identifiers invented by others: System, out, println, main Identifiers included in the Java language: public, static, void, class 2. Is programming style, such as indentation, a requirement of the Java language? Programming style is not a requirement of the Java language. Although it is good to develop a basic style that uses white space, brace alignment and indentation to make the program easy for the human reader. 3. Write statements to display the following phrase exactly as shown: To be or not to be System.out.println("To be or"); System.out.println("not to be"); 4. Write statements to display the following phrase in one line of output. To be or not to be System.out.println("To be or not to be"); 5. What is the difference between the // comment notation and the /* */ comment notation? The // notation represents a single line comment and the /* */ notation represents a comment that spans several lines.

5 6. What is the purpose of the Javadoc utility? Give an example of a Javadoc utility comment. The Javadoc utility produces an HTML document that describes the classes and methods that use the Javadoc comment. /** This is a javadoc comment. It can span several lines. */ 7. What primitive data type would you use to represent the most precise real number? double 8. Write a statement to declare a variable to represent the sales tax percentage. Write a second statement to assign the variable the value of 9.25%. Then write a statement that computes the sales tax on a purchase of $19.95 and stores the result in a properly declared variable called salestax. What is the value of salestax? double salestaxrate; salestaxrate =.0925; double salestax = * salestaxrate; The value of salestax is Write a statement that displays the label Sales tax: and appends the calculated value from the previous exercise to the end of the label. System.out.println("Sales tax:" + salestax); 10. When the following sequence of statements executes, what is displayed? double length = 5.0; double width = 8.5; System.out.println("Length: " + length); System.out.println("Width: " + width); System.out.print("Area: "); System.out.println(length * width);

6 Length: 5.0 Width: 8.5 Area: Which of the following are literals? count, a, 7.5, letter, 10, salestax a, 7.5, and Write a statement to declare a named constant for a sales tax rate of 7.5%. final double salestaxrate =.075; 13. Why is it good practice to use named constants, as opposed to using literals? Named constants not only make a program more readable, but it also drastically reduces the chance of an error in the value of the constant that could be introduced if the literal value is used instead. 14. Consult the documentation of the Java class library for the Scanner class. What method would you use to read a string from a Scanner object? next() 15. Write a statement that asks the user to enter the sales tax rate. Write statements to create a Scanner object, and then use it to read and store the rate as a real number. System.out.print("Enter the sales tax rate: "); Scanner keyboard = new Scanner(System.in); double rate = keyboard.nextdouble();

7 16. Write an application that prints the following pattern: * ** *** **** ***** ***** **** *** ** * public class Pattern System.out.println("*"); System.out.println("**"); System.out.println("***"); System.out.println("****"); System.out.println("*****"); System.out.println("*****"); System.out.println("****"); System.out.println("***"); System.out.println("**"); System.out.println("*"); 17. Write an application that prompts for your name, address, birthday and hobby. Display each on separate lines, properly labeled. import java.util.*; /* This program prompts for your name, address, birthday and hobby, then displays each on separate lines, properly labeled. */ public class AboutYou Scanner keyboard = new Scanner(System.in); String name, streetaddress, city, state, zip, birthday, hobby; //Collect all the inputs System.out.print("Enter your name: "); name = keyboard.nextline();

8 System.out.print("Enter your street address: "); streetaddress = keyboard.nextline(); System.out.print("Enter your city: "); city = keyboard.nextline(); System.out.print("Enter your state: "); state = keyboard.nextline(); System.out.print("Enter your zip: "); zip = keyboard.nextline(); System.out.print("Enter your birthday: "); birthday = keyboard.nextline(); System.out.print("Enter your favorite hobby: "); hobby = keyboard.nextline(); //Display the inputs to the user System.out.println(); System.out.println("Name: " + name); System.out.println("Address: " + streetaddress); System.out.println("City: " + city); System.out.println("State: " + state); System.out.println("Zip: " + zip); System.out.println("Birthday: " + birthday); System.out.println("Hobby: " + hobby);

9 Chapter 3 Exercises 1. What is the value of each of the following expressions? a / * 5 2 b. 3 * 2 / c. 6 / 2 * 3 10 d. 6 % 2 * 10 a. 18 b. 15 c. 10 d. -1 e What is the value of each of the following expressions? a. 12 / 3.0 b. 12 / 3 c / 3 d. 16 / 3 a. 4.0 b. 4 c d Explain how to use Java to determine whether x is an odd integer. int result = x % 2; If result is not equal to zero, then x is an odd integer. 4. Write two different Java statements that each compute the cube of an integer x. result = x * x * x; result = Math.pow(x, 3); result = Math.cbrt(x); 5. Classify the following Java statements as either legal or illegal. Let b, s, i, l, f, and d represent variables of type byte, short, int, long, float, and double. a. d = l; b. l = f; c. i = b; d. i = s; e. b = s;

10 a. legal b. illegal c. legal d. legal e. illegal f. illegal 6. What is the data type of each of the following expressions if i, l, f, and d represent variables of type int, long, float, and double? a. f + d b. d * i c. l i d. i / f e. l % d f. l * l a. double b. double c. long d. float e. double f. long 7. Using Zellers congruence algorithm, determine the day of the week for March 17, m = 3 d = 17 y = 2020 f = d + [(26 * (m + 1)) / 10] + y + [y / 4] + 6[y / 100] + [y /400] f = 17 + [(26 * (3 + 1))/ 10] [2020/4] + 6[2020/100] + [2020 / 400] f = 2677 w = f % 7 w = 3 3/17/2020 falls on a Tuesday. 8. For each of the following mathematical expressions, write a Java expression to represent it. a. 64 b. "17 c. e "1 d. 2 3 e. 6 2

11 a. Math.sqrt(64) b. Math.abs(-17) c. Math.exp(-1) d. Math.cbrt(2) e. Math.pow(6, 2) 9. Write a program that displays the following table. Use the method Math.min to compute the smaller of x and y in each case. X Y Min(x, y) public class MakeTable System.out.println("X\tY\tMin(x, y)"); System.out.println("10\t5\t" + Math.min(10, 5)); System.out.println("23\t13\t" + Math.min(23, 13)); System.out.println("100\t100\t" + Math.min(100, 100)); System.out.println("-1\t-5\t" + Math.min(-1, -5)); System.out.println("0\t-8\t" + Math.min(0, -8)); 10. Write a program to convert a user-supplied temperature from Fahrenheit to Celsius using the following formula. If C represents a temperature in degrees Celsius, and F represents a temperature in degrees Fahrenheit, then C = 5 x (F 32) / 9. import java.util.*; public class TempConverter Scanner keyboard = new Scanner(System.in); double celsiustemp, fahrenheittemp; System.out.print("Enter the temperature to convert: "); fahrenheittemp = keyboard.nextdouble(); celsiustemp = (5.0/9.0) * (fahrenheittemp );

12 System.out.print(fahrenheitTemp + " degrees Fahrenheit equals "); System.out.println(celsiusTemp + " degrees Celsius"); 11. In a contest, a ticket number wins a prize if it is a multiple of 6. Write a program that reads a ticket number and indicates whether it is a winner. The program s output could appear as follows: Sample Output 1 Is your ticket a winner? Enter your ticket number: 12 The ticket number 12 is a winner if the following value is zero: 0 Sample Output 2 Is your ticket a winner? Enter your ticket number: 37 The ticket number 37 is a winner if the following value is zero: 1 import java.util.scanner; public class Ticket // describe problem System.out.println("Is your ticket a winner " + "(a multiple of 6)?\n"); // get input Scanner keyboard = new Scanner(System.in); System.out.print("Enter your ticket number: "); int ticket = keyboard.nextint(); // compute winning ticket numbers int winner = ticket % 6; // display results System.out.println(); System.out.println("The ticket number " + ticket + " has a remainder of " + winner + "."); System.out.println(); System.out.println("If the remainder is 0, you are a winner!"); // end main // end Ticket

13 12. One integer is a multiple of another integer if the remainder after dividing the first integer by the second is zero. Write a program that tests whether one integer is a multiple of a second integer. The program s output could appear as follows: Sample Output 1 A test of whether one integer is a multiple of a second integer. Enter the first integer: 25 Enter the second integer: 5 25 is a multiple of 5 if the following value is zero: 0 Sample Output 2 A test of whether one integer is a multiple of a second integer. Enter the first integer: 23 Enter the second integer: 7 23 is a multiple of 7 if the following value is zero: 2 import java.util.scanner; public class Multiple // describe problem System.out.println("This program determines whether one " + "number is a multiple of a second number.\n"); // get input Scanner keyboard = new Scanner(System.in); System.out.print("Enter your first integer number: "); int first = keyboard.nextint(); System.out.print("Enter your second integer number: "); int second = keyboard.nextint(); // compute winning ticket numbers int multiple = first % second; // display results System.out.println(); System.out.println("The first number is " + first + "."); System.out.println("The first second is " + second + "."); System.out.println("The remainder is " + multiple + "."); System.out.println(); System.out.println("If the remainder is 0, the first number " + "is a multiple of the second number."); // end main // end Multiple

14 Chapter 4 Exercises 1. What does it mean to instantiate an object? Instantiating an object is simply the process of creating a new instance of a class type. This is usually accomplished using the new operator. 2. What is a reference variable? How does it relate to an alias? A reference variable is a variable of a class type. A reference variable contains the memory address of the object it refers to. An alias is simply an object with multiple references. 3. Display the following tabbed heading by using one println statement. Name Address City State Zip System.out.println("Name\tAddress\tCity\tState\tZip"); 4. In the expression one.concat(two), what object is the receiving object? The receiving object is one. 5. What do the following statements display? String data = "54 Long Street"; Scanner scan = new Scanner(data); System.out.println(scan.next()); What is the difference in meaning between the following two statements? import java.util.date; import java.util.*; The first statement only imports the class Date from the java.util package. The second statement imports the entire java.util package.

15 7. Write statements that a. Define a Date object. b. Define a string that contains only the date portion of the Date object. For example, if the string representation of the Date object is "WedJul3016:19:38EDT2010", define the string "Jul 30, 2010". c. Define a string that contains only the time portion of the Date. object. a. Date adateobject = new Date(); b. String date = adateobject.tostring(); String month = date.substring(3, 6); String day = date.substring(6, 8); String year = date.substring(19); String dateportion = month + " " + day + ", " + year; c. String date = adateobject.tostring(); String time = adateobject.substring(8, 19); 8. When constructing a BigDecimal object, why is it desirable to pass the constructor a string that represents the numeric value? You write the desired value of the BigDecimal object as a string to preserve its accuracy. 9. By consulting the online documentation of the Java Class Library for the class BigDecimal, answer the following questions. a. What constructor would you use to construct a BigDecimal object from a string that is rounded toward positive infinity? b. What method would you use to convert a BigDecimal object to a floating-point value? c. What method would you use to move the decimal point of a BigDecimal object two places to the left? a. BigDecimal(String val, MathContext mc) b. floatvalue() c. movepointleft(int n) 10. Why is the method equals provided for the wrapper classes in the Java Class Library? The equals method is provided not only for the wrapper classes in Java but for other classes as well. The equals method allows one to compare two objects to determine if their data components are equivalent.

16 11. Complete the following table of maximum and minimum values for the wrapper classes: Wrapper Class MAX_VALUE MIN_VALUE Byte 2 7 "1 "2 7 Character Double Float Integer Long Short Wrapper Class MAX_VALUE MIN_VALUE Byte 2 7 "1 "2 7 Character /uffff /u0000 Double ( 2 " 2 "52 ) # "1074 Float (2 " 2 "23 ) # "149 Integer 2 31 "1 "2 31 Long 2 63 "1 "2 63 Short 2 15 "1 " After consulting the online documentation for the class JOptionPane in the Java Class Library, describe the differences among the methods showconfirmdialog, showinputdialog, and showmessagedialog. The showconfirmdialog method presents a dialog box that asks a confirming question such as yes, no, or cancel. The showinputdialog method presents a dialog box that accepts input. The showmessagedialog method presents a dialog box that relays a message. 13. Given a Random object called rand, what does the call rand.nextdouble() return? A pseudorandom, uniformly distributed, double value between 0.0 and 1.0 will be returned. 14. What do the following statements display? System.out.println(Integer.parseInt("17")); System.out.println(Integer.parseInt("17", 10)); System.out.println(Integer.parseInt("17", 16)); Why must numeric input read from an input dialog box be parsed?

17 The input dialog reads all data provided by the user as a string. If we were collecting numeric data for computations, the string must be parsed into the correct format before being used in any computation, otherwise, we would get unexpected results. For example, suppose a dialog box was provided to enter two floating-point values to be summed. When the plus sign appears between two strings, concatenation occurs. 16. The program in Listing 4-1 uses the method nextline to read the first and last names of a person. Revise the program using the method next instead of nextline to read the first and last names into separate variables. Your revised program should produce the same output as the original program in Listing 4-1. import java.util.scanner; public class StringDemoEx16 Scanner keyboard = new Scanner(System.in); System.out.print("Please type your first name, a space, and " + "your last name: "); String firstname = keyboard.next(); String lastname = keyboard.next(); int namelength = firstname.length() + lastname.length(); char firstinitial = firstname.charat(0); char lastinitial = lastname.charat(0); String initials = firstinitial + ". " + lastinitial + "."; System.out.println("Hi, " + firstname + " " + lastname + ".\nyour name contains " + namelength + " characters."); System.out.println("Your first name is " + firstname + "."); System.out.println("Your last name is " + lastname + "."); System.out.println("Your initials are " + initials); // end main // end StringDemoEx Many programs convert the information provided by the user to a consistent format. For example, we could require all data that is read to be converted to uppercase. Create a Java program that reads, converts to uppercase, and displays a person s name and full address. import java.util.scanner; public class UpperCase

18 Scanner keyboard = new Scanner(System.in); //Collect the information System.out.println("Please type your name: "); String name = keyboard.nextline(); name = name.trim(); System.out.println("Please type your street address: "); String streetaddress = keyboard.nextline(); streetaddress = streetaddress.trim(); System.out.println("Please type your city: "); String city = keyboard.nextline(); city = city.trim(); System.out.println("Please type your state: "); String state = keyboard.nextline(); state = state.trim(); System.out.println("Please type your zip code: "); String zipcode = keyboard.nextline(); zipcode = zipcode.trim(); //Convert the information name = name.touppercase(); streetaddress = streetaddress.touppercase(); city = city.touppercase(); state = state.touppercase(); //Display the information System.out.println(name); System.out.println(streetAddress); System.out.println(city + ", " + state + " " + zipcode); 18. Write a program that displays a tree, such as the following one, using text characters: /\ / \ / \ / \ / \ "" "" "" Remember to use escape sequences to display the characters \ and the ".

19 public class Tree System.out.println(" /\\"); System.out.println(" / \\"); System.out.println(" / \\"); System.out.println(" / \\"); System.out.println(" / \\"); System.out.println(" "); System.out.println(" \" \""); System.out.println(" \" \""); System.out.println(" \" \""); // end main // end Tree 19. Write a Java program using the methods of the class JOptionPane to read a string containing an address. The string must begin as My address is and be followed by an address. Extract the address from the string using methods of the class Scanner, and display it using the methods of the class JOptionPane. Demonstrate that only bob@bob.com is extracted from the string My address is bob@bob.com. import javax.swing.joptionpane; import java.util.scanner; public class Extractor String extractionstring = JOptionPane.showInputDialog( "Enter a string containing an address:"); //Scan the string for spaces; the 5th space should be the //start of the address Scanner scan = new Scanner(extractionString); scan.usedelimiter("\\s"); String = scan.next(); = scan.next(); = scan.next(); = scan.next(); = scan.next(); JOptionPane.showMessageDialog(null, " address: " + ); System.exit(0);

20 20. Write a program that generates and displays five random numbers within the range 0.0 to 1.0. Allow the user to provide the seed. Display the random numbers with four digits after the decimal point. import java.util.random; import java.util.scanner; import java.text.decimalformat; public class MyRandomGenerator Scanner keyboard = new Scanner(System.in); System.out.println("Enter a seed for the random number " + "generator: "); long seed = keyboard.nextlong(); //Seed the generator Random generator = new Random(seed); //Generate 5 random numbers double firstnumber = generator.nextdouble(); double secondnumber = generator.nextdouble(); double thirdnumber = generator.nextdouble(); double fourthnumber = generator.nextdouble(); double fifthnumber = generator.nextdouble(); DecimalFormat formatter = new DecimalFormat("0.0000"); System.out.println("Five random numbers in the range of 0.0 " + "to 1.0:"); System.out.println(formatter.format(firstNumber)); System.out.println(formatter.format(secondNumber)); System.out.println(formatter.format(thirdNumber)); System.out.println(formatter.format(fourthNumber)); System.out.println(formatter.format(fifthNumber));

Chapter 2 ELEMENTARY PROGRAMMING

Chapter 2 ELEMENTARY PROGRAMMING Chapter 2 ELEMENTARY PROGRAMMING Lecture notes for computer programming 1 Faculty of Engineering and Information Technology Prepared by: Iyad Albayouk ١ Objectives To write Java programs to perform simple

More information

Chapter 2: Data and Expressions

Chapter 2: Data and Expressions Chapter 2: Data and Expressions CS 121 Department of Computer Science College of Engineering Boise State University April 21, 2015 Chapter 2: Data and Expressions CS 121 1 / 53 Chapter 2 Part 1: Data Types

More information

Basic Computation. Chapter 2

Basic Computation. Chapter 2 Basic Computation Chapter 2 Outline Variables and Expressions The Class String Keyboard and Screen I/O Documentation and Style Variables Variables store data such as numbers and letters. Think of them

More information

Oct Decision Structures cont d

Oct Decision Structures cont d Oct. 29 - Decision Structures cont d Programming Style and the if Statement Even though an if statement usually spans more than one line, it is really one statement. For instance, the following if statements

More information

Full file at

Full file at Chapter 2 Console Input and Output Multiple Choice 1) Valid arguments to the System.out object s println method include: (a) Anything with double quotes (b) String variables (c) Variables of type int (d)

More information

Chapter 2: Data and Expressions

Chapter 2: Data and Expressions Chapter 2: Data and Expressions CS 121 Department of Computer Science College of Engineering Boise State University January 15, 2015 Chapter 2: Data and Expressions CS 121 1 / 1 Chapter 2 Part 1: Data

More information

CEN 414 Java Programming

CEN 414 Java Programming CEN 414 Java Programming Instructor: H. Esin ÜNAL SPRING 2017 Slides are modified from original slides of Y. Daniel Liang WEEK 2 ELEMENTARY PROGRAMMING 2 Computing the Area of a Circle public class ComputeArea

More information

Course PJL. Arithmetic Operations

Course PJL. Arithmetic Operations Outline Oman College of Management and Technology Course 503200 PJL Handout 5 Arithmetic Operations CS/MIS Department 1 // Fig. 2.9: Addition.java 2 // Addition program that displays the sum of two numbers.

More information

A+ Computer Science -

A+ Computer Science - import java.util.scanner; or just import java.util.*; reference variable Scanner keyboard = new Scanner(System.in); object instantiation Scanner frequently used methods Name nextint() nextdouble() nextfloat()

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

Chapter 2 Primitive Data Types and Operations

Chapter 2 Primitive Data Types and Operations Chapter 2 Primitive Data Types and Operations 2.1 Introduction You will be introduced to Java primitive data types and related subjects, such as variables constants, data types, operators, and expressions.

More information

Full file at

Full file at Java Programming, Fifth Edition 2-1 Chapter 2 Using Data within a Program At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional

More information

Basic Computation. Chapter 2

Basic Computation. Chapter 2 Walter Savitch Frank M. Carrano Basic Computation Chapter 2 Outline Variables and Expressions The Class String Keyboard and Screen I/O Documentation and Style Variables Variables store data such as numbers

More information

Chapter 02: Using Data

Chapter 02: Using Data True / False 1. A variable can hold more than one value at a time. ANSWER: False REFERENCES: 54 2. The int data type is the most commonly used integer type. ANSWER: True REFERENCES: 64 3. Multiplication,

More information

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics Java Programming, Sixth Edition 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional Projects Additional

More information

Chapter 2: Using Data

Chapter 2: Using Data Chapter 2: Using Data TRUE/FALSE 1. A variable can hold more than one value at a time. F PTS: 1 REF: 52 2. The legal integer values are -2 31 through 2 31-1. These are the highest and lowest values that

More information

Section 2: Introduction to Java. Historical note

Section 2: Introduction to Java. Historical note The only way to learn a new programming language is by writing programs in it. - B. Kernighan & D. Ritchie Section 2: Introduction to Java Objectives: Data Types Characters and Strings Operators and Precedence

More information

What two elements are usually present for calculating a total of a series of numbers?

What two elements are usually present for calculating a total of a series of numbers? Dec. 12 Running Totals and Sentinel Values What is a running total? What is an accumulator? What is a sentinel? What two elements are usually present for calculating a total of a series of numbers? Running

More information

BASIC INPUT/OUTPUT. Fundamentals of Computer Science

BASIC INPUT/OUTPUT. Fundamentals of Computer Science BASIC INPUT/OUTPUT Fundamentals of Computer Science Outline: Basic Input/Output Screen Output Keyboard Input Simple Screen Output System.out.println("The count is " + count); Outputs the sting literal

More information

CS 302: Introduction to Programming

CS 302: Introduction to Programming CS 302: Introduction to Programming Lectures 2-3 CS302 Summer 2012 1 Review What is a computer? What is a computer program? Why do we have high-level programming languages? How does a high-level program

More information

Over and Over Again GEEN163

Over and Over Again GEEN163 Over and Over Again GEEN163 There is no harm in repeating a good thing. Plato Homework A programming assignment has been posted on Blackboard You have to convert three flowcharts into programs Upload the

More information

Console Input and Output

Console Input and Output Solutions Manual for Absolute C++ 4th Edition by Walter Savitch Link full download Test bank: https://getbooksolutions.com/download/test-bank-for-absolute-c-4th-edition-by-savitch/ Link full download Solutions

More information

COMP 202. Built in Libraries and objects. CONTENTS: Introduction to objects Introduction to some basic Java libraries string

COMP 202. Built in Libraries and objects. CONTENTS: Introduction to objects Introduction to some basic Java libraries string COMP 202 Built in Libraries and objects CONTENTS: Introduction to objects Introduction to some basic Java libraries string COMP 202 Objects and Built in Libraries 1 Classes and Objects An object is an

More information

Basic Programming Elements

Basic Programming Elements Chapter 2 Basic Programming Elements Lecture slides for: Java Actually: A Comprehensive Primer in Programming Khalid Azim Mughal, Torill Hamre, Rolf W. Rasmussen Cengage Learning, 2008. ISBN: 978-1-844480-933-2

More information

Key Concept: all programs can be broken down to a combination of one of the six instructions Assignment Statements can create variables to represent

Key Concept: all programs can be broken down to a combination of one of the six instructions Assignment Statements can create variables to represent Programming 2 Key Concept: all programs can be broken down to a combination of one of the six instructions Assignment Statements can create variables to represent information Input can receive information

More information

What methods does the String class provide for ignoring case sensitive situations?

What methods does the String class provide for ignoring case sensitive situations? Nov. 20 What methods does the String class provide for ignoring case sensitive situations? What is a local variable? What is the span of a local variable? How many operands does a conditional operator

More information

Computational Expression

Computational Expression Computational Expression Variables, Primitive Data Types, Expressions Janyl Jumadinova 28-30 January, 2019 Janyl Jumadinova Computational Expression 28-30 January, 2019 1 / 17 Variables Variable is a name

More information

Chapter 2: Java Fundamentals

Chapter 2: Java Fundamentals Chapter 2: Java Fundamentals Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 2 discusses the following main topics: The Parts of a Java

More information

8/23/2014. Chapter Topics. Chapter Topics (2) Parts of a Java Program. Parts of a Java Program. Analyzing The Example. Chapter 2: Java Fundamentals

8/23/2014. Chapter Topics. Chapter Topics (2) Parts of a Java Program. Parts of a Java Program. Analyzing The Example. Chapter 2: Java Fundamentals Chapter 2: Java Fundamentals Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 2 discusses the following main topics: The Parts of a Java

More information

Chapter 2: Using Data

Chapter 2: Using Data Chapter 2: Using Data TRUE/FALSE 1. A variable can hold more than one value at a time. F PTS: 1 REF: 52 2. The legal integer values are -2 31 through 2 31-1. These are the highest and lowest values that

More information

Input. Scanner keyboard = new Scanner(System.in); String name;

Input. Scanner keyboard = new Scanner(System.in); String name; Reading Resource Input Read chapter 4 (Variables and Constants) in the textbook A Guide to Programming in Java, pages 77 to 82. Key Concepts A stream is a data channel to or from the operating system.

More information

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals 1 Recall From Last Time: Java Program import java.util.scanner; public class EggBasketEnhanced { public static void main(string[]

More information

JAVA Programming Concepts

JAVA Programming Concepts JAVA Programming Concepts M. G. Abbas Malik Assistant Professor Faculty of Computing and Information Technology University of Jeddah, Jeddah, KSA mgmalik@uj.edu.sa Programming is the art of Problem Solving

More information

Chapter 2 Elementary Programming

Chapter 2 Elementary Programming Chapter 2 Elementary Programming 1 Motivations In the preceding chapter, you learned how to create, compile, and run a Java program. Starting from this chapter, you will learn how to solve practical problems

More information

A variable is a name for a location in memory A variable must be declared

A variable is a name for a location in memory A variable must be declared Variables A variable is a name for a location in memory A variable must be declared, specifying the variable's name and the type of information that will be held in it data type variable name int total;

More information

Review Chapters 1 to 4. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013

Review Chapters 1 to 4. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013 Review Chapters 1 to 4 Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013 Introduction to Java Chapters 1 and 2 The Java Language Section 1.1 Data & Expressions Sections 2.1 2.5 Instructor:

More information

Motivations 9/14/2010. Introducing Programming with an Example. Chapter 2 Elementary Programming. Objectives

Motivations 9/14/2010. Introducing Programming with an Example. Chapter 2 Elementary Programming. Objectives Chapter 2 Elementary Programming Motivations In the preceding chapter, you learned how to create, compile, and run a Java program. Starting from this chapter, you will learn how to solve practical problems

More information

Full file at

Full file at MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) Suppose a Scanner object is created as follows: 1) Scanner input = new Scanner(System.in); What

More information

Java Foundations: Introduction to Program Design & Data Structures, 4e John Lewis, Peter DePasquale, Joseph Chase Test Bank: Chapter 2

Java Foundations: Introduction to Program Design & Data Structures, 4e John Lewis, Peter DePasquale, Joseph Chase Test Bank: Chapter 2 Java Foundations Introduction to Program Design and Data Structures 4th Edition Lewis TEST BANK Full download at : https://testbankreal.com/download/java-foundations-introduction-toprogram-design-and-data-structures-4th-edition-lewis-test-bank/

More information

CONTENTS: Compilation Data and Expressions COMP 202. More on Chapter 2

CONTENTS: Compilation Data and Expressions COMP 202. More on Chapter 2 CONTENTS: Compilation Data and Expressions COMP 202 More on Chapter 2 Programming Language Levels There are many programming language levels: machine language assembly language high-level language Java,

More information

Basic Computation. Chapter 2

Basic Computation. Chapter 2 Basic Computation Chapter 2 Increment and Decrement Operators Used to increase (or decrease) the value of a variable by 1 Easy to use, important to recognize The increment operator count++ or ++count The

More information

Fundamentals of Programming Data Types & Methods

Fundamentals of Programming Data Types & Methods Fundamentals of Programming Data Types & Methods By Budditha Hettige Overview Summary (Previous Lesson) Java Data types Default values Variables Input data from keyboard Display results Methods Operators

More information

Conditional Programming

Conditional Programming COMP-202 Conditional Programming Chapter Outline Control Flow of a Program The if statement The if - else statement Logical Operators The switch statement The conditional operator 2 Introduction So far,

More information

Programming with Java

Programming with Java Programming with Java Data Types & Input Statement Lecture 04 First stage Software Engineering Dep. Saman M. Omer 2017-2018 Objectives q By the end of this lecture you should be able to : ü Know rules

More information

Lecture Notes. System.out.println( Circle radius: + radius + area: + area); radius radius area area value

Lecture Notes. System.out.println( Circle radius: + radius + area: + area); radius radius area area value Lecture Notes 1. Comments a. /* */ b. // 2. Program Structures a. public class ComputeArea { public static void main(string[ ] args) { // input radius // compute area algorithm // output area Actions to

More information

A+ Computer Science -

A+ Computer Science - Visit us at www.apluscompsci.com Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content! www.facebook.com/apluscomputerscience import java.util.scanner; Try

More information

Chapter 5 Lab Methods

Chapter 5 Lab Methods Chapter 5 Lab Methods Lab Objectives Be able to write methods Be able to call methods Be able to write javadoc comments Be able to create HTML documentation using the javadoc utility Introduction Methods

More information

Peer Instruction 1. Elementary Programming

Peer Instruction 1. Elementary Programming Peer Instruction 1 Elementary Programming 0 Which of the following variable declarations will not compile? Please select the single correct answer. A. int i = 778899; B. double x = 5.43212345; C. char

More information

Chapter 2: Data and Expressions

Chapter 2: Data and Expressions Chapter 2: Data and Expressions CS 121 Department of Computer Science College of Engineering Boise State University August 21, 2017 Chapter 2: Data and Expressions CS 121 1 / 51 Chapter 1 Terminology Review

More information

! A program is a set of instructions that the. ! It must be translated. ! Variable: portion of memory that stores a value. char

! A program is a set of instructions that the. ! It must be translated. ! Variable: portion of memory that stores a value. char Week 1 Operators, Data Types & I/O Gaddis: Chapters 1, 2, 3 CS 5301 Fall 2016 Jill Seaman Programming A program is a set of instructions that the computer follows to perform a task It must be translated

More information

Introduction to Java (All the Basic Stuff)

Introduction to Java (All the Basic Stuff) Introduction to Java (All the Basic Stuff) Learning Objectives Java's edit-compile-run loop Basics of object-oriented programming Classes objects, instantiation, methods Primitive types Math expressions

More information

BlueJ Demo. Topic 1: Basic Java. 1. Sequencing. Features of Structured Programming Languages

BlueJ Demo. Topic 1: Basic Java. 1. Sequencing. Features of Structured Programming Languages Topic 1: Basic Java Plan: this topic through next Friday (5 lectures) Required reading on web site I will not spell out all the details in lecture! BlueJ Demo BlueJ = Java IDE (Interactive Development

More information

Task #1 The if Statement, Comparing Strings, and Flags

Task #1 The if Statement, Comparing Strings, and Flags Chapter 3 Lab Selection Control Structures Lab Objectives Be able to construct boolean expressions to evaluate a given condition Be able to compare Strings Be able to use a flag Be able to construct if

More information

Introduction to Java Unit 1. Using BlueJ to Write Programs

Introduction to Java Unit 1. Using BlueJ to Write Programs Introduction to Java Unit 1. Using BlueJ to Write Programs 1. Open up BlueJ. Click on the Project menu and select New Project. You should see the window on the right. Navigate to wherever you plan to save

More information

CS 106 Introduction to Computer Science I

CS 106 Introduction to Computer Science I CS 106 Introduction to Computer Science I 06 / 02 / 2015 Instructor: Michael Eckmann Today s Topics Operators continue if/else statements User input Operators + when used with numeric types (e.g. int,

More information

Introduction to Software Development (ISD) David Weston and Igor Razgon

Introduction to Software Development (ISD) David Weston and Igor Razgon Introduction to Software Development (ISD) David Weston and Igor Razgon Autumn term 2013 Course book The primary book supporting the ISD module is: Java for Everyone, by Cay Horstmann, 2nd Edition, Wiley,

More information

Define a method vs. calling a method. Chapter Goals. Contents 1/21/13

Define a method vs. calling a method. Chapter Goals. Contents 1/21/13 CHAPTER 2 Define a method vs. calling a method Line 3 defines a method called main Line 5 calls a method called println, which is defined in the Java library You will learn later how to define your own

More information

Lecture 8 " INPUT " Instructor: Craig Duckett

Lecture 8  INPUT  Instructor: Craig Duckett Lecture 8 " INPUT " Instructor: Craig Duckett Assignments Assignment 2 Due TONIGHT Lecture 8 Assignment 1 Revision due Lecture 10 Assignment 2 Revision Due Lecture 12 We'll Have a closer look at Assignment

More information

Please answer the following questions. Do not re-code the enclosed codes if you have already completed them.

Please answer the following questions. Do not re-code the enclosed codes if you have already completed them. Dec. 9 Loops Please answer the following questions. Do not re-code the enclosed codes if you have already completed them. What is a loop? What are the three loops in Java? What do control structures do?

More information

Date: Dr. Essam Halim

Date: Dr. Essam Halim Assignment (1) Date: 11-2-2013 Dr. Essam Halim Part 1: Chapter 2 Elementary Programming 1 Suppose a Scanner object is created as follows: Scanner input = new Scanner(System.in); What method do you use

More information

We now start exploring some key elements of the Java programming language and ways of performing I/O

We now start exploring some key elements of the Java programming language and ways of performing I/O We now start exploring some key elements of the Java programming language and ways of performing I/O This week we focus on: Introduction to objects The String class String concatenation Creating objects

More information

AP Computer Science Unit 1. Programs

AP Computer Science Unit 1. Programs AP Computer Science Unit 1. Programs Open DrJava. Under the File menu click on New Java Class and the window to the right should appear. Fill in the information as shown and click OK. This code is generated

More information

Full file at

Full file at Chapter 1 1. a. False; b. False; c. True; d. False; e. False; f; True; g. True; h. False; i. False; j. True; k. False; l. True. 2. Keyboard and mouse. 3. Monitor and printer. 4. Because programs and data

More information

Data Types and the while Statement

Data Types and the while Statement Session 2 Student Name Other Identification Data Types and the while Statement In this laboratory you will: 1. Learn about three of the primitive data types in Java, int, double, char. 2. Learn about the

More information

CSIS 10A Assignment 3 Due: 2/21 at midnight

CSIS 10A Assignment 3 Due: 2/21 at midnight CSIS 10A Assignment 3 Due: 2/21 at midnight Read: Chapter 3 Choose and complete any 10 points from the problems below by first downloading the assignment 3 folder from the website. Use BlueJ to complete

More information

BLOCK STRUCTURE. class block main method block do-while statement block if statement block. if statement block. Block Structure Page 1

BLOCK STRUCTURE. class block main method block do-while statement block if statement block. if statement block. Block Structure Page 1 BLOCK STRUCTURE A block is a bundle of statements in a computer program that can include declarations and executable statements. A programming language is block structured if it (1) allows blocks to be

More information

double float char In a method: final typename variablename = expression ;

double float char In a method: final typename variablename = expression ; Chapter 4 Fundamental Data Types The Plan For Today Return Chapter 3 Assignment/Exam Corrections Chapter 4 4.4: Arithmetic Operations and Mathematical Functions 4.5: Calling Static Methods 4.6: Strings

More information

Chapter 2. Elementary Programming

Chapter 2. Elementary Programming Chapter 2 Elementary Programming 1 Objectives To write Java programs to perform simple calculations To obtain input from the console using the Scanner class To use identifiers to name variables, constants,

More information

Entry Point of Execution: the main Method. Elementary Programming. Learning Outcomes. Development Process

Entry Point of Execution: the main Method. Elementary Programming. Learning Outcomes. Development Process Entry Point of Execution: the main Method Elementary Programming EECS1021: Object Oriented Programming: from Sensors to Actuators Winter 2019 CHEN-WEI WANG For now, all your programming exercises will

More information

CHAPTER 2 Java Fundamentals

CHAPTER 2 Java Fundamentals CHAPTER 2 Java Fundamentals Copyright 2016 Pearson Education, Inc., Hoboken NJ Chapter Topics Chapter 2 discusses the following main topics: The Parts of a Java Program The print and println Methods, and

More information

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments. Java How to Program, 9/e Education, Inc. All Rights Reserved. } Java application programming } Use tools from the JDK to compile and run programs. } Videos at www.deitel.com/books/jhtp9/ Help you get started

More information

Chapter 2 Elementary Programming

Chapter 2 Elementary Programming Chapter 2 Elementary Programming Part I 1 Motivations In the preceding chapter, you learned how to create, compile, and run a Java program. Starting from this chapter, you will learn how to solve practical

More information

Chapter 5 Lab Methods

Chapter 5 Lab Methods Chapter 5 Lab Methods Lab Objectives Be able to write methods Be able to call methods Be able to write javadoc comments Be able to create HTML documentation for our Java class using javadoc Introduction

More information

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. A Guide to this Instructor s Manual:

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. A Guide to this Instructor s Manual: Java Programming, Eighth Edition 2-1 Chapter 2 Using Data A Guide to this Instructor s Manual: We have designed this Instructor s Manual to supplement and enhance your teaching experience through classroom

More information

COMP-202: Foundations of Programming. Lecture 2: Variables, and Data Types Sandeep Manjanna, Summer 2015

COMP-202: Foundations of Programming. Lecture 2: Variables, and Data Types Sandeep Manjanna, Summer 2015 COMP-202: Foundations of Programming Lecture 2: Variables, and Data Types Sandeep Manjanna, Summer 2015 Announcements Midterm Exams on 4 th of June (12:35 14:35) Room allocation will be announced soon

More information

Variables and Assignments CSC 121 Spring 2017 Howard Rosenthal

Variables and Assignments CSC 121 Spring 2017 Howard Rosenthal Variables and Assignments CSC 121 Spring 2017 Howard Rosenthal Lesson Goals Understand variables Understand how to declare and use variables in Java Programs Learn how to formulate assignment statements

More information

Datatypes, Variables, and Operations

Datatypes, Variables, and Operations Datatypes, Variables, and Operations 1 Primitive Type Classification 2 Numerical Data Types Name Range Storage Size byte 2 7 to 2 7 1 (-128 to 127) 8-bit signed short 2 15 to 2 15 1 (-32768 to 32767) 16-bit

More information

Welcome to the Primitives and Expressions Lab!

Welcome to the Primitives and Expressions Lab! Welcome to the Primitives and Expressions Lab! Learning Outcomes By the end of this lab: 1. Be able to define chapter 2 terms. 2. Describe declarations, variables, literals and constants for primitive

More information

Chapter 2 Primitive Data Types and Operations

Chapter 2 Primitive Data Types and Operations Chapter 2 Primitive Data Types and Operations 2.1 Introduction You will be introduced to Java primitive data types and related subjects, such as variables constants, data types, operators, and expressions.

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

Check out how to use the random number generator (introduced in section 4.11 of the text) to get a number between 1 and 6 to create the simulation.

Check out how to use the random number generator (introduced in section 4.11 of the text) to get a number between 1 and 6 to create the simulation. Chapter 4 Lab Loops and Files Lab Objectives Be able to convert an algorithm using control structures into Java Be able to write a while loop Be able to write an do-while loop Be able to write a for loop

More information

PRIMITIVE VARIABLES. CS302 Introduction to Programming University of Wisconsin Madison Lecture 3. By Matthew Bernstein

PRIMITIVE VARIABLES. CS302 Introduction to Programming University of Wisconsin Madison Lecture 3. By Matthew Bernstein PRIMITIVE VARIABLES CS302 Introduction to Programming University of Wisconsin Madison Lecture 3 By Matthew Bernstein matthewb@cs.wisc.edu Variables A variable is a storage location in your computer Each

More information

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI CSCI 2010 Principles of Computer Science Data and Expressions 08/09/2013 CSCI 2010 1 Data Types, Variables and Expressions in Java We look at the primitive data types, strings and expressions that are

More information

Chapter 4 Fundamental Data Types. Big Java by Cay Horstmann Copyright 2009 by John Wiley & Sons. All rights reserved.

Chapter 4 Fundamental Data Types. Big Java by Cay Horstmann Copyright 2009 by John Wiley & Sons. All rights reserved. Chapter 4 Fundamental Data Types Chapter Goals To understand integer and floating-point numbers To recognize the limitations of the numeric types To become aware of causes for overflow and roundoff errors

More information

4. If the following Java statements are executed, what will be displayed?

4. If the following Java statements are executed, what will be displayed? Chapter 2 MULTIPLE CHOICE 1. To compile a program named First, use the following command a. java First.java b. javac First c. javac First.java d. compile First.javac 2. A Java program must have at least

More information

Tester vs. Controller. Elementary Programming. Learning Outcomes. Compile Time vs. Run Time

Tester vs. Controller. Elementary Programming. Learning Outcomes. Compile Time vs. Run Time Tester vs. Controller Elementary Programming EECS1022: Programming for Mobile Computing Winter 2018 CHEN-WEI WANG For effective illustrations, code examples will mostly be written in the form of a tester

More information

Entry Point of Execution: the main Method. Elementary Programming. Compile Time vs. Run Time. Learning Outcomes

Entry Point of Execution: the main Method. Elementary Programming. Compile Time vs. Run Time. Learning Outcomes Entry Point of Execution: the main Method Elementary Programming EECS2030: Advanced Object Oriented Programming Fall 2017 CHEN-WEI WANG For now, all your programming exercises will be defined within the

More information

Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e

Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e Chapter 2 MULTIPLE CHOICE 1. Which one of the following would contain the translated Java byte code for a program named Demo? a. Demo.java b. Demo.code c. Demo.class d. Demo.byte 2. To compile a program

More information

MODULE 02: BASIC COMPUTATION IN JAVA

MODULE 02: BASIC COMPUTATION IN JAVA MODULE 02: BASIC COMPUTATION IN JAVA Outline Variables Naming Conventions Data Types Primitive Data Types Review: int, double New: boolean, char The String Class Type Conversion Expressions Assignment

More information

COMP 202 Java in one week

COMP 202 Java in one week COMP 202 Java in one week... Continued CONTENTS: Return to material from previous lecture At-home programming exercises Please Do Ask Questions It's perfectly normal not to understand everything Most of

More information

Basic computer skills such as using Windows, Internet Explorer, and Microsoft Word. Chapter 1 Introduction to Computers, Programs, and Java

Basic computer skills such as using Windows, Internet Explorer, and Microsoft Word. Chapter 1 Introduction to Computers, Programs, and Java Basic computer skills such as using Windows, Internet Explorer, and Microsoft Word Chapter 1 Introduction to Computers, Programs, and Java Chapter 2 Primitive Data Types and Operations Chapter 3 Selection

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

Elementary Programming

Elementary Programming Elementary Programming EECS1022: Programming for Mobile Computing Winter 2018 CHEN-WEI WANG Learning Outcomes Learn ingredients of elementary programming: data types [numbers, characters, strings] literal

More information

Introduction to Java Applications; Input/Output and Operators

Introduction to Java Applications; Input/Output and Operators www.thestudycampus.com Introduction to Java Applications; Input/Output and Operators 2.1 Introduction 2.2 Your First Program in Java: Printing a Line of Text 2.3 Modifying Your First Java Program 2.4 Displaying

More information

Robots. Byron Weber Becker. chapter 6

Robots. Byron Weber Becker. chapter 6 Using Variables Robots Learning to Program with Java Byron Weber Becker chapter 6 Announcements (Oct 5) Chapter 6 You don t have to spend much time on graphics in Ch6 Just grasp the concept Reminder: Reading

More information

COMP 202 Java in one week

COMP 202 Java in one week CONTENTS: Basics of Programming Variables and Assignment Data Types: int, float, (string) Example: Implementing a calculator COMP 202 Java in one week The Java Programming Language A programming language

More information

Big Java. Fifth Edition. Chapter 3 Fundamental Data Types. Cay Horstmann

Big Java. Fifth Edition. Chapter 3 Fundamental Data Types. Cay Horstmann Big Java Fifth Edition Cay Horstmann Chapter 3 Fundamental Data Types Chapter Goals To understand integer and floating-point numbers To recognize the limitations of the numeric types To become aware of

More information

Starting Out with Java: From Control Structures through Data Structures 3e (Gaddis and Muganda) Chapter 2 Java Fundamentals

Starting Out with Java: From Control Structures through Data Structures 3e (Gaddis and Muganda) Chapter 2 Java Fundamentals Starting Out with Java: From Control Structures through Data Structures 3e (Gaddis and Muganda) Chapter 2 Java Fundamentals 2.1 Multiple Choice Questions 1) Which one of the following would contain the

More information

Wentworth Institute of Technology. Engineering & Technology WIT COMP1000. Java Basics

Wentworth Institute of Technology. Engineering & Technology WIT COMP1000. Java Basics WIT COMP1000 Java Basics Java Origins Java was developed by James Gosling at Sun Microsystems in the early 1990s It was derived largely from the C++ programming language with several enhancements Java

More information

2/9/2012. Chapter Four: Fundamental Data Types. Chapter Goals

2/9/2012. Chapter Four: Fundamental Data Types. Chapter Goals Chapter Four: Fundamental Data Types Chapter Goals To understand integer and floating-point numbers To recognize the limitations of the numeric types To become aware of causes for overflow and roundoff

More information