# Algoritmos

Páginas: 2 (359 palabras) Publicado: 14 de marzo de 2012
Algorithms – Activity 8
Read the following problems and create an algorithm and a flowchart for each one.
INPUT-PROCESS-OUTPUT Algorithms
EXAMPLE: Apollo I used 167 days to go from Earth to Mars,that is 34’900,000 miles away from the Earth. Make an algorithm to calculate the days that it would need to go to Jupiter that is 864’875,457 miles away from Earth.
START
1. Set constants.TtM=167, DtM=34, 900, 000, DtJ= 864, 875, 457
2. Set variables= Diad= 0, TtJ=0
5. Print= the time to go to Jupiter is “TtJ” “days”
END

6. The formulato convert kilograms to pounds is P=K*2.2, where P is pounds and K is Kilograms. Make an algorithm that converts any amount of Kilograms to pounds.
START
1. Set constants. P=K*2.2
2. Setvariables= P= pounds, K= kilograms, Answer=0
END
7. A student makes 4 exams. Make an algorithm to calculate and show the average of its grades.
START
1.Set variables= A,B,C,D, SUM=0, AVG=0, NoE=4
2. SUM= A+B+C+D
3. AVG= SUM/NoE
4. Show average
END
8. The temperature is the measure of concentration or intensity of heating energy in abody. There are 4 scales to measure temperature: Fahrenheit, Celsius, Kelvin and Rankine. Many labs experiments require the conversion from one scale to other. For example, to convert from Fahrenheitto Celsius, you sustract 32 to Fahrenheit temperature and the difference is multiplied by 5/9; to convert from Celsius to Kelvin, you add 273 degrees to the temperature in Celsius; and for convertingfrom Fahrenheit to Rankine, you add 460 degrees to the temperature in Fahrenheit. Make an algorithm that calculates and prints the given temperature in Fahrenheit (F) in the other 3 Measures.
START1. Set variables (Fahrenheit, Celsius, Kelvin, Rankine, T=0)
2. Celsius=( Fahrenheit-32)*(5/9)
3. Kelvin= Celsius+273
4. Rankine= Fahrenheit+460
5. Show= T in Celsius= Celsius, T...

Regístrate para leer el documento completo.