0% found this document useful (0 votes)
17 views1 page

Lab 1

Uploaded by

Wanjiru randolph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Lab 1

Uploaded by

Wanjiru randolph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

MAE 2360 Num. Analysis and Prog.

Homework #1 Feb 9, 2021 1

Write the required C and/or Matlab programs for each of the following problems. Compile
and execute the programs. Copy and paste the outputs into an .doc/.docx file. Upload all
original program files and the output document to Canvas.

Required:

1. Include comments in your code giving your name, the date, a code description, and
the problem number.

2. Whenever printing a value to the screen, also print a statement defining the value and
any units. Example: Do “the distance x is 23 meters”; Don’t “23”.

Problem 1 [10]
Write C and Matlab programs that print to the screen three sentences of your choosing. The
sentences must be double spaced when printed.

Problem 2 [35]
Write C and Matlab programs that compute the following quantities and prints each of them
to the screen on separate lines:

• 6sin(2.5) Note: trig functions by default expect radian inputs

• 4cos(11)
−2
• tan−1 ( ) Note: use the function atan2(y,x) for four-quadrant inverse tangent
0
• 212 Note: in C, use the function pow(x,y)

• e1.3 Note: use the function exp(x)

Problem 3 [20]
Write a C program that asks for your height in inches and prints your height in meters.

Problem 4 [35]
Write a C program that accepts inputs for floating numbers ω, t, and φ. Use these quantities
to calculate and print to the screen this quantity:

A = 6sin(ωt + φ)

You might also like