Quiz5

Quiz5 - /* MAE 9: Quiz #5, Fall 2006 Due on Friday,...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: /* MAE 9: Quiz #5, Fall 2006 Due on Friday, December 1, before 9:00 pm */ /*** Copy this file as "quiz5.c": cp quiz5.txt quiz5.c and give you the write permission: chmod u+rwx quiz5.c ****/ /* During Quiz 5, you are not allowed to exchange any information or files related to test problems with others. If you violate the above instructions or work on problems in other versions your name will be reported to the Academic Integrity Coordinator. */ /* Use the program skeleton below (starting with #include <stdio.h>) as the starting point for quiz5.c. Add the necessary code to the functions prob1() through prob3(), and add the other functions, as described in the text below. You do not need to change anything in main().*/ /* Program skeleton for quiz5.c */ #include <stdio.h> #include <math.h> /* Function prototypes */ void prob1(void); void prob2(void); void prob3(void); int main(void) { int menu; printf("There are 3 functions: prob1()-prob3().\n"); printf("Enter the function number to execute (1, 2, 3):"); scanf("%d", &menu); /* form a switch to execute one function */ switch(menu){ case 1: prob1(); break; case 2: prob2(); break; case 3: prob3(); break; default: printf("prob%d() does not exist.\n", menu); } exit(0); } /* In void prob1() a) write void gauss_3pt(double gauss[3], double weight[3]) to define the Gauss coordinates g0, g1, g2 and corresponding weights w0, w1, w2. Their coordinates are g2= -g0= sqrt(3/5), g1=0 and...
View Full Document

This note was uploaded on 05/22/2008 for the course MAE 9 taught by Professor Lubarda during the Fall '07 term at UCSD.

Page1 / 5

Quiz5 - /* MAE 9: Quiz #5, Fall 2006 Due on Friday,...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online