Flowcharts and Pseudocode for Algorithms
Flowcharts and Pseudocode for Algorithms
1 Create a flowchart and pseudocode that represent the algorithm to obtain the
area of a triangle.
1start
2 enter Base and Height.
3 to do Area = (Base * Height) / 2.
4 write Area
5 fin
Start
Base=
Altura=
Area=
End
2.2 An importing company wants to determine how many dollars it can acquire with X
amount of Mexican money. Create a flowchart and pseudocode that represent the
algorithm for such purpose.
1 start
2 read exchange rate, Mexican pesos.
3 if Mexican pesos >= the exchange price. Then
Dólares= pesos mexicanos*precio de cambio
you can acquire Dollars
If not
We do not show that Mexican pesos are not enough to buy a dollar.
4 fin
Start
Exchange rate=
Mexican pesos
yes no
Pesos
Mexicans >= Price of
change
Dolar=
End
A company that hires staff needs to determine the age of the people who apply.
They work, but when they are interviewed, they are only asked the year they were born.
Create the flowchart and pseudocode that represent the algorithm to solve this.
problem.
1 start
4 write Age
5 fin
Start
Año de Nacimiento=
Current year=
Edad=
Fin
2.4 A parking lot needs to determine the charge it should apply to the people who use it.
they use. Consider that the charge is based on the hours they have available and that the fractions of
hours are considered complete and I made a flowchart and pseudocode that represent the
algorithm that allows determining the charge.
1 Start
2 read hour, minute and cost per hour
3 if minutes is = 0 then
total cost = hours * cost per hour
if not
horas= hora+1
total cost = hours * cost per hour
5 write 'total to pay' total cost
6 fin
Start
Hora=
Minutos=
Costo de horas=
yes no
Minutos = 0
write 'total to
pay total cost
End
2.5 Paintings 'The thick brush' needs to determine how much to charge for painting jobs.
Consider that payment is charged per square meter and create a flow diagram and pseudocode that represent the
algorithm that allows you to generate budgets for each client.
1 start
2 square meters to paint, price per square meter
5 fin
Start
M2 to the peak=
Precio del M2=
End
2.6 It is required to determine the hypotenuse of a right triangle. What would the diagram be like?
flow and the pseudocode that represent the algorithm to obtain it? Remember that according to Pythagoras
Set that: C2 = A2 + B2.
1 start
5 fin
Start
Cateto1=
Cateto2=
hipotenusa= SQRT(Cateto1^2+Cateto2^2)
End
2.7 The bus company 'La curva loca' needs to determine the cost of the ticket.
from a simple trip, this based on the kilometers to be traveled and the cost per kilometer. Make
a flowchart and pseudocode that represent the algorithm for that purpose.
1 start
5 fin
Start
km recorrido=
costo km=
boleto=km recorrido*costo km
km
End
2.8 It is required to determine the time it takes for a person to travel from one city to another in
bicycle, considering that it moves at a constant speed. Create a flow diagram and
pseudocode that represents the algorithm for that purpose.
1 inico
2 read speed and distance
3 time = distance / speed
4 write 'the time I took is:' time
5 fin
Start
km recorrido=
costo km=
End
2.9 It is necessary to determine the cost of making a phone call based on the
duration of the call and the cost per minute. Create a flowchart and pseudocode
that represent the algorithm for this purpose.
1 start
2 read minimum cost and duration
5 fin
Start
Minimum cost=
Duracion=
End
2.10 The CONAGUA needs to determine the payment that a person must make for the total of
cubic meters of water consumed. Create a flowchart and pseudocode that
represent the algorithm that allows to determine that payment.
1 start
5 fin
Start
cost Metrocubo =
Metrocube
consumido =
End
2.11 The company of light and shadows (CLS) needs to determine the payment it must make.
person for electricity consumption, which is measured in kilowatts (KW). Carry out a
flowchart and pseudocode that represent the algorithm that allows determining that payment.
1 start
2 read costKW, EnergyConsumption
3 make Pay = costKW * EnergyConsumption
Total to pay: Pay
5 fin
Start
costoKW =
ConsumoEnergia =
End
2.12 Create a flowchart and pseudocode that represent the algorithm to determine
how much will a person finally pay for a certain item, considering that they have a
20% discount, and must pay 15% VAT (must show the price with discount and the price
final).
1 start
2 read ValueArticle, Name
3 hacer PrecioDescuento= ValorArtculo -( (ValorArtculo *20)/100)
PrecioConIVA= PrecioDescuento +(( PrecioDescuento*15)/100)
4 Write "the discounted price is: "DiscountedPrice" and the final price is: "PriceWithVAT
5 fin
Start
ValorArtculo =
Nombre=
End
2.13 Create a flowchart and pseudocode that represent the algorithm to determine
How much money does a person save in a year if they consider saving 15% of their income every week?
salary (consider four weeks per month and that the salary does not change).
1 indication
2 read Salary
3 make QuinceSemana = ((Salary.15) / 100)
Dineroxaño=Quincesemana*48
Money saved per year: "MoneyYear
5 fin
Start
Salario=
QuinceSemana=((Salario.15)/100)
Dineroxaño=Quincesemana*48
End
2.14 A company wishes to determine the amount of a check that it must provide to one of its
empleados que tendrá que ir por equis número de días a la ciudad de Monterrey; los gastos que
the company's coverage includes: hotel, food, and 100.00 pesos daily for other expenses. The amount must be
broken down for each concept. Create a flowchart and pseudocode that represent the
algorithm that determines the amount of the check.
1 start
2 read HotelCost, FoodCost, Days
3 Make TotalHotel=HotelCost*Days
TotalComida=CostoComida*Dias
TotalOtrosGastos=100*Dias
CostPerDay=Days*(HotelCost+FoodCost+100)
4 Write 'the total spending on food is: 'TotalFood.
The total expenditure for the hotel is: TotalHotel.
The total of other expenses is: TotalOtherExpenses.
Total Check Amount: CostXDay
5 Fin
Start
CostoHotel=
CostoComida=
Dias =
TotalHotel=CostoHote*Dias
TotalComida=CostoComida*Dias
TotalOtrosGastos=100*Dias
CostPerDay=Days*(HotelCost+FoodCost+100)
End
2.15 The electrical power of the circuit in figure 2.6 is to be calculated. Create a flowchart.
and the pseudocode that represents the algorithm to solve the problem. Consider that: P = V * I
y V = R*I.
1 start
2 read AlternatingCurrent
3 make Voltage=4*AlternatingCurrent
Power = Voltage * Alternating Current
The electrical power of the circuit is: Power
5 Fin
Start
CorrienteAlterna=
Voltage=4*AlternatingCurrent
Power = Voltage * Alternating Current
End
2.16 Create pseudocode and flowchart that represent the algorithm to prepare a
[Link]://[Link]/[Link]
1 Start
2 ingredients
2 Ingredients 500 grams of butter = (M) 5
1 kilogramo de azúcar=(Az )9
1 kilogram of prepared flour = (Hp)
8 units of eggs = ( Hu)
1 liter of milk = (Le)
1 teaspoon of vanilla = (Va)
Utensils
Horno=0
MixingContainer1
3 to do
----
RecipienteMescla1=M+Az
Blanquecino= RecipienteMescla1
If MixingContainer1 <> Whitish
Make ContainerMix1=M+Az
If not
Make MixingContainer1 = MixingContainer1 + 1
----
Make MixingContainer2 = MixingContainer1 + Hu + Hp + Le
Homogénea= RecipienteMescla2
If MixingContainer2 <> Homogeneous
Make MixingContainer2 = MixingContainer1 + Hu + Hp + Le
If not
Make MixingContainer2 = MixingContainer2 + Va
-----
ContainerMix3 = (ContainerMix3 + m) + ContainerMix2
----
If oven<>150
Oven=Oven+1
If not
Oven=Oven+ MixtureContainer3
Tiempo=45
If Time<>0
Make Time=tempo-1
If not
To do
ContainerMix3 = ContainerMix3 + 1
Horno=Horno- RecipienteMezcla3
4 Write ContainerMix3
5 Fin
start
RecipienteMescla1=M+Az
Blanquecino= RecipienteMescla1
Yes
Recipient
Mix1
<>
I whitened
no
RecipienteMescla1=M+Az RecipienteMescla1=
MixingContainer1+1
Make ContainerMix2=
MixContainer1+Hu+Hp+Le
Homogénea= RecipienteMescla2
Yes
Recipient
eBlend1
<>
I whitened
no
RecipienteMescla1=M+Az RecipienteMescla1=
ContainerMix1+1
Create the flowchart and pseudocode that represent the algorithm to find the area
of a square. Area = (diagonal^2)/2
1 Start
2 empty diagonal
3 Area = (diagonal^2)/2
4 Write "the diagonal is: " Area
5 Fin
Start
Diagonal=
Area = (diagonal^2) / 2
End
2.20 Create the flowchart and pseudocode that represent the algorithm to determine the
average that a student will obtain considering that they take three exams, of which the
The first and the second have a weighting of 25%, while the third has 50%.
1 Home
2 read Note1, Note2, Note3
3 make Note1=Note1*1.25/5
Grade2=Grade2*1.25/5
Nota3=Nota3*2.5/5
NotaTotal=Nota1+Nota2+Nota3
Average is: TotalScore
5 fin
Start
End
2.21 Create a flowchart and pseudocode that represent the algorithm to determine
approximately how many months, weeks, days, and hours has a person lived.
1 Start
Who
Make LessMonth = CurrentMonth - BirthMonth
--
Who
--
Who
--
Years*12=Months - LessMonth=TotalMonths
4*TotalMonths=Weeks
24*TotalDays=TotalHours
4 Escribir MesesTotal,Semanas,DiasTotales,HorasTotales
5 Fin
Start
TiempoLlamada, CostoMinuto
CostoTotal= TiempoLlamada*CostoMinuto
End
2.23 The hotel 'Cama Arena' needs to determine what it should charge a guest for their
stay in one of its rooms. Create a flowchart and pseudocode that represent
the algorithm to determine that charge.
1 Inico
2 Read Consumption, CostRoom, Days
3 make Charge = (Consumption + RoomCost) * Days
The total charge is:
5 fin
Start
Consumo, CostoCuarto,Dias
Cobro=( Consumo+CostoCuarto)*Dias
End