09-feb18

09-feb18 - COMP110 MoreLoopsandStrings TabithaPeckM.S....

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP 110 More Loops and Strings Tabitha Peck M.S. February 18, 2008 MWF 3-3:50 pm Philips 367 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Announcements Programs START EARLY!!!! Should take 10-15 hours Should NOT take 20+ hours Get help if you are stumped Office hours are helpful Read Instructions 2
Background image of page 2
Announcements Program 2 Format to 2 decimal places Convert floating point numbers to integers for modular arithmetic String parsing Comments and pseudocode 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Program 2 Grades 101% - 110% 9 90% - 100% 13 80% - 89% 5 70% - 79% 2 0% - 69% 2
Background image of page 4
Formatting Decimals (Jan 30) import java.text.*; DecimalFormat df = new DecimalFormat( "0.00" ); df.format(myVariable); Example code on class website 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
import java.text.DecimalFormat; public class DecFormat { public static void main(String[] args) { DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat df2 = new DecimalFormat("0.0000"); double d = 12.345678; System.out.println("my double with two decimal places: " + df.format(d)); System.out.println("my double with four decimal places: " + df2.format(d)); } } 6
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/02/2009 for the course COMP 110 taught by Professor Stotts during the Spring '08 term at UNC.

Page1 / 19

09-feb18 - COMP110 MoreLoopsandStrings TabithaPeckM.S....

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online