c%2B%2B_hw1 - 2 Gravity Write a C program to compute the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Languages Issued: Feb. 9, 2008, 9:00am ENGR 101, Section 100 Due: Feb. 15, 2008, 10:00pm C++ HOMEWORK #1 1. Construct a truth table for the function f produced by the circuit of Figure 1. Also write a logical test expression that will check whether f is true based on the four x i values (Matlab syntax with variables x1, x2, x3, x4 is fine since you’ve used it for past assignments). Submit your handwritten solution in lecture Fri. Feb. 15, or submit a PDF or Word document with your solution ( logic.doc, logic,pdf ) to CTools by the 10:00pm Feb. 15 deadline. f x 1 x 2 x 3 x 4 Figure 1: A single-output logic circuit.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2. Gravity: Write a C++ program to compute the gravitational force F g acting on a mass m in a circular orbit with radius r = 100 r E , where r E is the radius of the Earth. You should ask the user to enter the mass ( m in kg) and print out the corresponding gravitational force F g . The Law of Universal Gravitation states that 2 2 1 r m m G F g = for any two masses m 1 and m 2 . Note that Earth’s mass m E = 5.9742 × 10 24 kg, Earth’s radius r E = 6378.1 km, and G =6.673× 10-11 m 3 /(kg-s). Submit your code, named gravity.cpp , to Ctools....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online