ALGORITMO QUE CALCULE EL 18 PORCENTAJE DEL MONTO TOTAL

Categoría de Estructura Condicional Simple


Escribir un programa que calcula el porcentaje de una cantidad

💻 Hacer un programa que ingrese un monto o cantidad, si el monto fuese mayor a $500 calcular y mostrar el 18%.


Análisis :

Para este ejercicio se usa una condicional simple, al preguntar si un monto ingresado es mayor que $500.


ANÁLISIS DEL CÓDIGO

VARIABLES A USAR :
num = Guarda un monto ingresado por teclado.

INGRESO : Ingresar un monto por teclado en la variable (num).
PROCESO : Si el monto es mayor a $500 sacar el 18% que es igual a (num * 18%).
SALIDA : Mostrar en 18% del monto obtenido.


Algoritmo en pseint que calcula el 18 porciento PSeInt Estricto : DESCARGA EL CÓDIGO

algoritmo que calcule el IGV

Algoritmo en pseint - short youtube
Algoritmo programacion_work 
    Definir num como Entero;
    Escribir "MOSTRAR EL 18% SI EL MONTO INGRESADO ES MAYOR A $500.";
    Escribir " ";
    Escribir Sin Saltar "INGRESE MONTO : $";
    Leer num;
    Si num > 500 Entonces
        Escribir "EL 18% ES : $", num * 0.18;
    FinSi
FinAlgoritmo
calcula el 18 porciento en pseint

código en python que obtenga el 18% Python :

print("INGRESAR UN MONTO DE DINERO Y MOSTRAR EL 18%.")
num = int(input("INGRESE MONTO : "))
if num > 500:
    print("EL 18% ES : ", num * 0.18)

código en Lenguaje C que calcule el 18 porciento Lenguaje C :

#include<stdio.h>
int main() {
    float num;
    printf("MOSTRAR EL 18 PORCIENTO.\n\n");           
    printf("Ingrese Numero : ");
    scanf("%f",&num);
    if (num >= 500) {
        printf("\nRESULTADO : $. %.0f", (num * 0.18));    
    }
    return 0;
}

código en Dev C++ para obtener el dieciocho porciento Dev C++ :

#include<iostream>
using namespace std;
int main() {
    int num;
    cout << "MOSTRAR EL 18 PORCIENTO.\n\n";
    cout << "Ingrese Numero : ";
    cin << num;
    cout << endl;
    if (num >= 500) {
        cout << "RESULTADO : $. " << (num * 0.18) << endl;
    }
    return 0;
}

código en C# que calcule el dieciocho porciento de un valor mayor a 500 C# :

using System;
using System.Collections.Generic;
using System.Text;
namespace programacion_work
{
    class calcular_18_porciento
    {
        static void Main(string[] args)
        {
            int num;
            Console.WriteLine("MOSTRAR EL 18%.\n");
            Console.Write("Ingrese Numero : ");
            num = int.Parse(Console.ReadLine());
            if (num >= 500)
            {
                Console.WriteLine("\nRESULTADO : " + (num * 0.18));
            }
            Console.ReadLine();
        }
    }
}

Programar en Java NetBeans que obtenga el 18% Java NetBeans :

package programacion_work;
import java.util.Scanner;
public class calcular_18_porciento {
    public static void main(String[] args) {
        Scanner ingreso=new Scanner(System.in);  
        int num;
        System.out.print("MOSTRAR EL 18% DE UN MONTO INGRESADO.\n\n");
        System.out.print("Ingrese Número : ");
        num = Integer.parseInt(ingreso.next());                
        if(num > 500){
          System.out.println("EL 18% ES : " + (num * 0.18));       
        }
    }   
}

mostrar el 18% en Java NetBeans Java NetBeans - FORMULARIOS [POO]:

private void jBtn_CalcularActionPerformed(java.awt.event.ActionEvent evt) {                                              
    int num;
    num = Integer.parseInt(jTxt_num.getText());
    if( num > 500 ){
        jLbl_Msg.setText("EL DESCUENTO DE 18% ES : $" + String.valueOf(num * 0.18));
    }else{
        jLbl_Msg.setText("NO HAY DESCUENTO");
    }
} 

Mostrar el el dieciocho porciento en basic Visual Basic .NET Console:

Imports System.Console
Module calcular_18_porciento
    Dim num As Integer
    Sub Main()
        WriteLine("17. SI EL MONTO INGRESADO ES MAYOR A 500 CALCULAR EL 18%.")
        WriteLine("")
        Write("Ingrese Monto : ")
        num = ReadLine()
        WriteLine("")
        If (num >= 500) Then
            WriteLine("RESULTADO : " & (num * 0.18))
        End If
        ReadLine()
    End Sub
End Module

Calcular el dieciocho porciento de un monto ingresado en Visual basic Visual Basic .NET Formularios :

Private Sub Btn_Calcular_Click(sender As Object, e As EventArgs) Handles Btn_Calcular.Click
    Dim num As Integer
    num = Txt_Monto.Text
    If (num >= 500) Then
        Lbl_msg.Text = "El 18% es : " & Math.Round((num * 0.18), 2)
    Else
        Lbl_msg.Text = "No se Cálcula el 18%"
    End If
End Sub

Mostrar el dieciocho porciento del valor de venta en VBA Excel VBA :

Sub igv()
    Dim Num As Integer
    Num = Range("C12").Value
    If (Num > 500) Then
        Range("G12").Value = Num * 0.18
    Else
        Range("G12").Value = "NO TIENE IGV"
    End If
End Sub

Programar el dieciocho porciento en excel Excel – InputBox :

Sub IGV_2()
    Dim Num As Integer
    Num = InputBox("INGRESE NÚMERO ")
    If (Num > 500) Then
        MsgBox "IGV 18% ES : " & Num * 0.18
    Else
        MsgBox "NO TIENE IGV"
    End If
End Sub

Calcular el dieciocho porciento en excel VBA – Formulario [POO] :

Private Sub btn_calcular_Click()
    Dim Num As Integer
    Num = txt_num.Text
    If (Num > 500) Then
        Label5.Caption = "EL IGV DE 18% ES :"
        txt_result.Text = Num * 0.18
    Else
        txt_result.Text = "NO TIENE IGV"
    End If
End Sub



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