ALGORITMO SOBRE GANANCIAS DE UNA GARITA DE CONTROL

Categoría de Estructura Repetitiva Para


Calcular las ganancias de una garita de control en PSeInt

💻 Una garita cobra por el paso de vehículos. El cobro se realiza de acuerdo al vehículo; hay tres tipos de vehículos Ómnibus, Minivan y micro que su tarifa es de 13, 10, 8 soles respectivamente, ingrese el tipo de vehículo y el turno (Mañana, Noche).

Desarrollar un algoritmo que permita: Ingresar datos: La cantidad de vehículos, de cada vehículo se debe ingresar el tipo y el turno (Mañana, Noche).

A. Ingreso de datos.
B. Calculo del importe total recaudado en cada turno.
C. Calculo del importe total recaudado por cada tipo de vehículo.


Algoritmo en pseint para conocer la ganacia de una garita de control PSeInt Estricto : DESCARGA EL CÓDIGO

Ganancia de una garita de control en youtube VER EL CÓDIGO

Algoritmo que muestra ganacia de una garita de control

Algoritmo programacion_work
    Definir man, noc, cont, tipo, cantidad, bus, van, micro como Entero;
    Definir tarifa como Real;
    Definir turno como Caracter;
    tarifa <- 0;
    bus <- 0;
    van <- 0;
    micro <- 0;
    man <- 0;
    noc <- 0;
    Escribir "31. GANANCIAS DE UNA GARITA DE CONTROL.";
    Escribir Sin Saltar "CANTIDAD DE VEHICULOS ";
    Leer cantidad;   
    Escribir " ";
    Para cont <- 1 Hasta  cantidad con paso 1 Hacer
        Escribir ">> TIPO DE VEHÍCULO Nro ", cont, "/",cantidad, " : ";
        Escribir "1. Ómnibus";
        Escribir "2. Minivan";
        Escribir "3. Micro";
        Escribir Sin Saltar "OPC : ";   
        Leer tipo;      
        Segun (tipo) Hacer
            1: tarifa <- 13;
                bus <- bus + tarifa;            
            2: tarifa <- 10;
                van <- van + tarifa;            
            3: tarifa <- 8;
                micro <- micro + tarifa;
        FinSegun      
        Escribir Sin Saltar "TURNO (M/N): ";
        Leer turno;      
        Si (turno == "M") Entonces
            man <- man + tarifa;
        SiNo
            noc <- noc + tarifa;
        FinSi   
        Escribir " ";      
    FinPara
    Escribir " ";
    Escribir "IMPORTE DE TURNO MAÑANA :", man;
    Escribir "IMPORTE DE TURNO NOCHE :", noc;
    Escribir " ";
    Escribir "IMPORTE DE ÓMNIBUS :", bus;
    Escribir "IMPORTE DE MINIVAN :", van;
    Escribir "IMPORTE DE MICRO :", micro;
FinAlgoritmo
Algoritmo en pseint para conocer la ganacia de una garita de control


código en python que muestre cuanto gana una garita de control Python :

print("COSTO TOTAL POR TIPO DE VEHÍCULO.")
bus=0
van=0
micro=0
man=0
noc=0
cantidad = int(input("\nCANTIDAD DE VEHICULOS : "))
for cont in range(0,cantidad):
    print("\n1. Ómnibus")
    print("2. Minivan")
    print("3. Micro")
    tipo = int(input("OPCIÓN : "))
    if tipo == 1:
        tarifa = 13
        bus = bus + tarifa
    elif tipo == 2:
        tarifa = 10
        van = van + tarifa
    elif tipo == 3:
        tarifa = 8
        micro = micro + tarifa
    turno = input("TURNO M/N : ")
    if turno.upper() == "M":
        man = man + tarifa
    else :
        noc = noc + tarifa
print("\nIMPORTE DE TURNO MAÑANA : S/.", man)
print("IMPORTE DE TURNO NOCHE  : S/.", noc)
print("IMPORTE DE ÓMNIBUS      : S/.", bus)
print("IMPORTE DE MINIVAN      : S/.", van)
print("IMPORTE DE MICRO        : S/.", micro)

código en Lenguaje C que muestre la ganancia de una garita de control LENGUAJE C :

#include<stdio.h>
#include<string.h>
#define MAX_STRLEN 256
int main() {   
    int man=0, noc=0, tipo, cantidad, bus=0, van=0, micro=0;
    double tarifa=0;	
    char turno[MAX_STRLEN];
    printf("CANTIDAD DE EMPLEADOS : ");
    scanf("%d",&cantidad);     	
    for(int cont=1; cont <= cantidad; cont++){
        printf("\nTIPO DE VEHICULO Nro.  %d/%d :",cont,cantidad);    	
        printf("\n1. Omnibus");
        printf("\n2. Minivan");	
        printf("\n3. Micro");
        printf("\nOPCION : ");
        scanf("%d",&tipo);
        switch(tipo){
            case 1: tarifa=13; bus+=tarifa; break;
            case 2: tarifa=10; van+=tarifa; break;
            case 3: tarifa=8; micro+=tarifa; break;
        }   
        printf("TURNO [M/N] : ");
        scanf("%s",&turno);    	
        if(strcmp(turno,"M")==0){
            man += tarifa;
        }else{
            noc += tarifa;
        }    		
    }	
    printf("\nIMPORTE DE TURNO MANANA : S/.%d", man);
    printf("\nIMPORTE DE TURNO NOCHE  : S/.%d", noc);	
    printf("\n\nIMPORTE DE OMNIBUS      : S/.%d", bus);
    printf("\nIMPORTE DE MINIVAN      : S/.%d", van);
    printf("\nIMPORTE DE MICRO        : S/.%d", micro);			
    return 0;    
}

código en Dev C++ que muestre la ganacia de una garita Dev C++ :

#include<iostream>
using namespace std;
int main() {    	
    int man=0, noc=0, tipo, cantidad, bus=0, van=0, micro=0;
    double tarifa=0;
    string turno;		
    cout << "CANTIDAD DE EMPLEADOS : ";
    cin >> cantidad;
    cout << endl;    
    for(int cont=1; cont <= cantidad; cont++){
        cout << "TIPO DE VEHICULO Nro. " << cont <<"/"<< cantidad << " : " << endl;
        cout << "1. Omnibus" << endl;
        cout << "2. Minivan" << endl;    	
        cout << "3. Micro" << endl;
        cout << "OPCION : ";
        cin >> tipo;
        switch(tipo){
            case 1: tarifa=13; bus+=tarifa; break;
            case 2: tarifa=10; van+=tarifa; break;
            case 3: tarifa=8; micro+=tarifa; break;
        }		
        cout << "TURNO [M/N] : ";
        cin >> turno;
        if(turno == "M"){
            man += tarifa;
        }else{
            noc += tarifa;
        }
        cout << endl;
    }
    cout << "IMPORTE DE TURNO MANANA : S/." << man << endl;
    cout << "IMPORTE DE TURNO NOCHE  : S/." << noc << endl;
    cout << endl;
    cout << "IMPORTE DE OMNIBUS      : S/." << bus << endl;
    cout << "IMPORTE DE MINIVAN      : S/." << van << endl;
    cout << "IMPORTE DE MICRO        : S/." << micro << endl;
    return 0;
}


Facebook de www.programacion.work. Canal de Youtube de www.programacion.work. Twitter de www.programacion.work. TikTok de www.programacion.work.


Política de cookies

Política de Privacidad

Aviso Legal y Términos De Uso