Professional Documents
Culture Documents
2. Computer the area and circumference of the circle with known radius
3. Write a program that reads three numbers from the command line: a, b, c. Then
compute area of the triangle
p = (a+b+c):2
4. Compute oscillated cycle
l is length of the band that hangs oscillate (meter)
g is gravitational acceleration = 9.18 m/s2
5. The formula for resistors connected in parallel is a little more complex. Given two
resistors with resistances R1 and R2 connected in parallel the equivalent resistance
is given by the inverse of the sum of the inverses. If there are more than two
resistors you continue to invert the sum of their inverses. Write a program that
calculates the resistance of three resistors arranged in parallel
****************************************************************
Fullname : ĐỖ THỊ LAN
Class : CMU CS 303 BIS - DIS
Department : CMU
School year : 2018-2019
***** *
***** **
***** ***
***** *****
11. Write a program that enters from keyboard and displays integer, double, float, string
12. Write a program that converts a lower character to upper character (a-z to A-Z)
13. Sales tax in New York City is 8.25%. Write a program that accepts a price on the
command line and prints out the appropriate tax and total purchase price.
14. There are exactly 2.54 centimeters to an inch. Write a program that takes a number
of inches from the command line and converts it to centimeters
15. There are 454 grams in a pound and 1000 grams in a kilogram. Write programs that
convert pounds to kilograms and kilograms to pounds. Read the number to be
converted from the command line. Can you make this one program instead of two?