1
Assignment # 3
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 3
Due Date: Monday February 7, 2011, 12:00 noon
1. Items sold in a certain small store are placed in 5 categories, A, B, C, D, E depending on the
price of t

1
Assignment # 2
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 2
Due Date: Monday January 24, 2011, 12:00 noon
1. Write a program to compute the dot and cross products of two vectors in three dimensions. If
the vectors

/* Question 1 source code */
/* File twovector.c
To compute the dot and cross products of two vectors in three dimensions
Programmer: Date: 01/18/2011
*/
#include <stdio.h>
#include <stdlib.h>
int main(void)
cfw_
float u1,u2,u3,v1,v2,v3,dot,c1,c2,c3;

Assignment # 1
1
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 1
Due Date: Monday January 17, 2011, 12:00 noon
1. Here is part of a program that begins by having the user input two integers:
/* File twoint.c
Compute the

/* Question 1 source file */
/* File: revenue.c
This program reads from a file giving the id, quantity and price of
items sold and computes the total revenue and the item which generates
the most revenue.
Programmer: Date: 02/15/2011
*/
#include<std

1
Assignment # 5
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 5
Due Date: Monday February 28, 2011, 12:00 noon
1. The le revenue.in, shown below, contains a series of lines, each giving the identication
number, quantit

/* Question 1 source code */
/* File: craps.c
This program simulates playing a game of craps a large number of times.
The percentage of games won is printed.
Programmer: Date: 03/08/2011
*/
#include <stdio.h>
#include <stdlib.h>
int menu(void);
int rol

1
Assignment # 4
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 4
Due Date: Monday February 14, 2011, 12:00noon
1. When assessing the quality of indoor air in oce buildings, three types of pollutants are of concern; Tota

/* Question 1 source code */
/* File: smogf.c
Programmer: Date: 03/01/2011
*/
#include<stdio.h>
#include<stdlib.h>
int sl(float,float,float);
int main()
cfw_
int l;
float o,n,c;
FILE*fout=fopen("smogf.out","w");
printf("Enter the value of ozone

/* Question 1 source code */
/* File twoint.c
Compute the sum and product of two integers entered by the user
Programmer: Date: 01/13/2011
*/
#include <stdio.h>
#include <stdlib.h>
int main(void)
cfw_
int a, b, sum, product;
printf("Input two integers

/* Question 1 source code */
/* File: category.c
This is a program which reads a price from the keyboard and prints the category of the price.
Programmer: Date:02/05/2011
*/
#include <stdio.h>
#include <stdlib.h>
int main(void)
cfw_
float p;
char c;

1
Assignment # 6
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 6
Due Date: Monday March 7, 2011, 12:00 noon
1. (See Assignment 3 question 4) Los Angeles sometimes has very smoggy conditions. These
conditions are largely

/* Question 1 source file */
/* File: convert.c
driver program for the function convert which converts each
occurrence of "eg" in a string to "EG"
Programmer: Date: 03/29/2011
*/
#include<stdlib.h>
#include<stdio.h>
void convert(char*s);
int main()
cfw

1
Assignment # 9
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 9
Due Date: Monday March 28, 2011, 12:00 noon
1. Change the length.c program from assignment 8 so that the array is dynamically allocated.
Call the new prog

1
Assignment # 8
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 8
Due Date: Monday March 21, 2011, 12:00 noon
1. If we have a (mathematical) array xi , for i = 0, 1, n 1, then the elements of the array
can be thought of

Assignment # 10
1
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 10
Due Date: Monday April 4, 2011, 12:00 noon
For these questions you are not allowed to use the string functions in string.h
1. Write a program which decl

/* File: costcall.c
*/
#include <stdio.h>
int main(void)
cfw_
int start, duration, day;
float cost;
/* read in the starting time, call duration, and day of the week */
printf("Enter the start time, duration and day of the week: ");
scanf("0 0 0",

ENGM2081: Sample Test #4
2011: pg 1
Sample Test #4
When trying this practice test DO NOT use the computer (except to check your results after
youve written them). Print out the test and write your answers in the places provided.
This is a sample closed-bo

ENGM2081: Sample Test #5
Winter 2011: pg 1
Sample Test #5
When trying this practice test DO NOT use the computer (except to check your results after
youve written them). Print out the test and write your answers in the places provided.
This is a sample cl

ENGM2081 Test #4
Mar 25, 2011 pg 1/2
Name:
ID:
This is a 50 minute closed book test. Write your solutions in the space provided on these
pages. Summary pages will be provided. You may use the backs of the pages if necessary.
The value of each question is

ENGM2081: Sample Test #2
Winter 2011: pg 1
Sample Test #2
When trying this practice test DO NOT use the computer (except to check your results after
youve written them). Print out the test and write your answers in the places provided.
This is a 50 minute

1
Assignment # 7
DEPARTMENT OF ENGINEERING MATHEMATICS
COMPUTER PROGRAMMING
ENGM 2081
ASSIGNMENT # 7
Due Date: Monday March 14, 2011, 12:00 noon
Notes:
Keep in mind the following rules about function arguments:
If a function must use (but not change) the

Assignment 9
1
Department of Engineering Mathematics and Internetworking
COMPUTER PROGRAMMING
ENGM 1081
ASSIGNMENT 9
Due Date: Monday, November 23, 2015, 10:00 am
1. If we have a system of masses mi at points (xi , yi ), i = 1, 2, . . . , n, in the plane,