Week07 - n > 0. b. partitions the interval [a,b] in n...

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

View Full Document Right Arrow Icon
ENEE 140: Introduction to Programming Concepts for Engineers [email protected] © Gang Qu Spring 2010 Week 7 Problem Solving by Programming Lab report: No lab report due this week. Work on the project. Lab 11: Monday March 22 Lab 12: Monday March 24 This week’s questions are all directly related to the project. 1. file I/O: revisit week05_1.c 2. formatted output: revisit week05_3.c, particularly the example and part c. 3. formatted output: implement the UNIX cal function in a. type the following UNIX command and see the output cal 3 2010 c a l 2 0 1 0 m a n c a l Question: do you know which day of the week Jan. 1, 1 was? b. Write a program that prints out the following (which is the output when you type in cal 3 2010 in UNIX). You will need to use loop and % operator. March 2010 S M Tu W Th F S 1 2 3 4 5
Background image of page 1

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

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

Unformatted text preview: n > 0. b. partitions the interval [a,b] in n subintervals of equal length. The last subinterval may be smaller. (See the examples below). c. prints out the end points of each subinterval (see examples below) Example: I n p u t : 1 8 2 O u t p u t : 1 4 5 8 ENEE 140: Introduction to Programming Concepts for Engineers [email protected] © Gang Qu Spring 2010 Input: 1 10 3 O u t p u t : 1 4 5 8 9 10 I n p u t :-5 1 5 4 O u t p u t :-5 0 1 6 7 12 13 15 5. Write a C program that a. reads in a positive integer k b. prints out the 10’s digit k c. prints out the number of digits in k Example: I n p u t : 1 8 O u t p u t : 2 1 I n p u t : 1 3 8 O u t p u t : 4 0 I n p u t : 9 8 1 O u t p u t : 3 8 Lecture 6 Outline: 1. more on program selection (switch statement) 2. more on loops (while, do-while statements) 3. programming examples 4. questions about the project...
View Full Document

This note was uploaded on 10/11/2010 for the course ENEE 140 taught by Professor Staff during the Fall '08 term at Maryland.

Page1 / 2

Week07 - n > 0. b. partitions the interval [a,b] in n...

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