Function Prototypes and Conditional Expressions - Assignment | CSCE 150A, Assignments of Computer Science

Material Type: Assignment; Class: PRBLM SOLVNG:COMPUTR; Subject: Computer Science and Engineering ; University: University of Nebraska - Lincoln; Term: Spring 2009;

Typology: Assignments

Pre 2010

Uploaded on 08/30/2009

koofers-user-s7k
koofers-user-s7k 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCE 150A - Problem Solving Using Computers Laboratory - Spring 2009
Lab Assignment 4 - 02/05/2009
Name:
Section: 8:00 11:00 12:30 6:30
Problem 1: Function Prototypes and Conditional Expressions
The following table has each row describe a function of certain inputs and output types or a description
of a conditional expression. For functions, write a prototype. For conditionals, write the code expression.
Type Description Code
Func. biggest takes three integers and outputs the
largest.
Func. average takes three integers and outputs the
average of the values, which may not be an
integer.
Func. outputPowers takes a double band an integer
pand prints the powers of bfrom 0 to pto the
screen. Does not return anything.
Cond. ais smaller than band is also bigger than c
Cond. ais not bigger than bor is the same as c
Cond. ais equal to band bis not equal to c
Problem 2: Programming Conditional Functions
Download conditional.zip from the lecture outline. Expand it into your Z: drive and open conditional.c.
Implement the functions biggestNumber,smallestNumber, and allEqual, which are currently given as pro-
totypes.
int biggestNumber(int a, int b, int c) returns the largest number between a,b, and c.
int smallestNumber(int a, int b, int c) returns the smallest number between a,b, and c.
char allEqual(int a, int b, int c) returns ’T’ if all inputs are equal and ’F’ if any are different.
To check your work, type the command make and show the instructor.

Partial preview of the text

Download Function Prototypes and Conditional Expressions - Assignment | CSCE 150A and more Assignments Computer Science in PDF only on Docsity!

CSCE 150A - Problem Solving Using Computers Laboratory - Spring 2009

Lab Assignment 4 - 02/05/

Name:

Section: 8:00 11:00 12:30 6:

Problem 1: Function Prototypes and Conditional Expressions

The following table has each row describe a function of certain inputs and output types or a description of a conditional expression. For functions, write a prototype. For conditionals, write the code expression.

Type Description Code

Func. biggest takes three integers and outputs the largest.

Func. average takes three integers and outputs the average of the values, which may not be an integer.

Func. outputPowers takes a double b and an integer p and prints the powers of b from 0 to p to the screen. Does not return anything.

Cond. a is smaller than b and is also bigger than c

Cond. a is not bigger than b or is the same as c

Cond. a is equal to b and b is not equal to c

Problem 2: Programming Conditional Functions

Download conditional.zip from the lecture outline. Expand it into your Z: drive and open conditional.c. Implement the functions biggestNumber, smallestNumber, and allEqual, which are currently given as pro- totypes.

  • int biggestNumber(int a, int b, int c) returns the largest number between a, b, and c.
  • int smallestNumber(int a, int b, int c) returns the smallest number between a, b, and c.
  • char allEqual(int a, int b, int c) returns ’T’ if all inputs are equal and ’F’ if any are different.

To check your work, type the command make and show the instructor.