Lab5 - COSC1415/COSC1436 Chapter 5 Lab Assignment Page 1 of...

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

View Full Document Right Arrow Icon
COSC1415/COSC1436 Chapter 5 Lab Assignment Page 1 of 1 Name Chintu Patel 8001 COSC1415/COSC1436 Lab - Chapter 5 Objective: To learn how to use looping structures, especially while loops, in a program At the end of this lab you should know how to: 1. incorporate while loops in a program. 2. use selection, repetition, files and value-returning functions in a program. Remember to put a line in each program that identifies you as the programmer. Lab 5A: Write a program that reads the radius of a circle from a file ( circles.txt ). The program should use value-returning functions to calculate the area and circumference. Declare π (pi) as a constant that equals 3.1416. The program should use a priming read and a while loop that terminates when there is no more data in the file. The output should be sent to a file and include a title and be displayed ( with one decimal place ) similar to what you see below. Don’t forget to put the < your name> statement in your program. Radius Area Circumference 5.6 98.5 35.2 123.5 47877.7 775.7 Print a copy of the program and the output file. Lab 5B: Write a program that reads test scores ( four scores for each student ) from a file ( tests.txt ). The program should use value-returning functions to determine the test average. (The test average is the average of the three highest test scores.). The program should use priming read and a while loop that terminates when there is no more data in the file. The program
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 05/06/2008 for the course COSC 1436 taught by Professor May during the Spring '08 term at Dallas Colleges.

Page1 / 6

Lab5 - COSC1415/COSC1436 Chapter 5 Lab Assignment Page 1 of...

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