Fall2009-assignment1

# Fall2009-assignment1 - Programming Systems Design CSCI 455...

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

Programming Systems Design CSCI 455 FALL 2009 Dr. K. Narayanaswamy Programming Assignment # 1 Due Date: 9/13/2009 (11:59:59 p.m.) Goal This assignment will require you to understand C++ iteration statements (like “while”), the “if” statement, and how to read input from and write output to text files. Task A Fibonacci sequence consists of a series of numbers where each number is the sum of the previous two numbers. A number that appears in a Fibonacci sequence is called a Fibonacci number. To start the sequence, the first Fibonacci number is 0 and the second Fibonacci number is 1. So, for example, the first 10 Fibonacci numbers are as follows: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 Your program must first prompt the user for the name of an input file and the name of an output file. The input file contains a set of integer numbers. You may assume the input consists only of integer numbers. The program should open the input file and read each individual number from the input file. For each number “n” read from the input file, the program should write out the first “n” Fibonacci numbers to the output file . Specifically, your program should do the following: a) For each input number “n”, write out that number to the output file on a separate line b) Write out the first “n” Fibonacci numbers on line following the line above of the output file

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/08/2009 for the course CSCI 455X taught by Professor Bono during the Fall '08 term at USC.

### Page1 / 3

Fall2009-assignment1 - Programming Systems Design CSCI 455...

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

View Full Document
Ask a homework question - tutors are online