0% found this document useful (0 votes)
17 views2 pages

Mi Primera Programacion

The document contains a Java program that calculates the total value of a purchase based on the purchase value, quantity, and time of purchase. The program takes in user input for purchase value, quantity, and time and calculates the total using different formulas depending on the time.

Uploaded by

Deivyd Gomez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Mi Primera Programacion

The document contains a Java program that calculates the total value of a purchase based on the purchase value, quantity, and time of purchase. The program takes in user input for purchase value, quantity, and time and calculates the total using different formulas depending on the time.

Uploaded by

Deivyd Gomez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

package david;

import java.util.*;
public class carniceria1 {

public static void main(String[] args) {


Scanner leer = new Scanner(System.in);
double num1,num2,num3;
System.out.println("bienvenidos a carnes finas el rey");

System.out.println("ingrese valor de compra V");


Double V = leer.nextDouble() ;
System.out.println("ingrese valor de compra K");
Double K = leer.nextDouble() ;
System.out.println(V*K);
System.out.println("ingrese hora de compra T");
Double T = leer.nextDouble() ;

System.out.println("Valor total de compra VT");


System.out.println(T<10);

System.out.println("ingrese hora de compra VT");≤


Double VT = leer.nextDouble() ;Dauble VT=(V*(

Double Aux VT=((t<10)=v);((T≥10<12)=(V*0.10)+V));(T>12)=(V*0.10)-v)


Double Aux2 VT=((T≥10<12)=(V*0.10)+V))
Double Aux3 VT=(T>12)=(V*0.10)-v

Double Aux ()
Double Aux2 [8:00;14:00]

V = leer.nextDouble () ;
int []=leer.nextDouble() ;
System.out.println(V*K)

package david;
import java.util.*;
public class carniceria1 {

public static void main(String[] args) {


Scanner leer = new Scanner(System.in);
double num1,num2,num3;
System.out.println("bienvenidos a carnes finas el rey");

System.out.println("ingrese valor de compra V");


V = leer.nextDouble() ;
System.out.println("ingrese valor de compra K");
K = leer.nextDouble() ;
System.out.println(V*K);
System.out.println("ingrese hora de compra T");
T = leer.nextDouble() ;

if ( T >= 10 && T <= 12 ) {


V = (V*K) + (V*0.1)
}
else if ( T < 10 && T > 8 ) {
V=(V*K) ;
}
else if ( T >12 && T < 14 ) {
V = (V*K) - (V*0.1) ;
}
System.out.println("VALOR A PAGAR : " + V );

You might also like