HW_3 - CS 31: INTRODUCTION TO COMPUTER SCIENCE I Computer...

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

View Full Document Right Arrow Icon
CS 31: INTRODUCTION TO COMPUTER SCIENCE I Computer Science Department University of California, Los Angeles Dr. John A. Rohr February 17, 2010 HOMEWORK 3 Objective : Practice evaluating real numbers using C Strings read from an input file. Assignment : Write a program to read C-strings holding real numbers from an input file, evaluate the numbers, and display the values stored as numbers. A skeleton program is provided that initializes the files and output, reads input lines, calls the number evaluation function, displays numerical results, and terminates the files and output. All that must be added to the skeleton is the completion of the implementation of the evaluation function. The function initially evaluates the number using the atof() function. The function must then evaluate the number using one or two additional approaches. First, the integer part of the number must be evaluated character-by-character. Then, if there are fractional digits, the fraction must be evaluated in two
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2010 for the course COM SCI 31 taught by Professor Kinsey during the Spring '98 term at UCLA.

Page1 / 2

HW_3 - CS 31: INTRODUCTION TO COMPUTER SCIENCE I Computer...

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

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