ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Estructuras de Control Repetitiva, Menú de Opciones, Contador y Acumulador


Enviado por   •  11 de Diciembre de 2022  •  Documentos de Investigación  •  1.865 Palabras (8 Páginas)  •  261 Visitas

Página 1 de 8

PA 02 Fundamentos Programacion (1)

Taller de programacion

[pic 1][pic 3][pic 2]

[pic 4][pic 5][pic 7][pic 6]

ESCUELA ACADEMICO PROFESIONAL DE INGENIERIA CIVIL

FUNDAMENTOS DE PROGRAMACION

Estructuras de Control Repetitiva, Menú de Opciones, Contador y Acumulador.

Producto Académico No 02: Tarea

PRESENTADO POR:

SUSEL RAMOS LUNA

CUSCO 2022

  1. | P á g i n a

1        0

[pic 8][pic 9][pic 10][pic 11]

  1. Elaborar el programa para: Usar MENÚ, Validar con DO – WHILE y Contador-Acumulador en:
  1. La empresa Ssonny tiene una tienda en Cusco con tres productos: Productos:        TV: stock – 200 unid. y precio – 3500 soles, Celulares: stock

-1500 unid. y precio -2500 soles y Equipos: stock -150 unid. y precio-1600 soles.

Descuento:  TV: 10%, Celulares: 20% y Equipos: 15%

#include<iostream> using namespace std;

int main() {

int cantidad_clientes; float desccel;

float descequip; float  desctv; string evaluar; float mbcelulares; float mbequip; float mbtv;

float mfcel; float mfequip; float mftv;

float precio_celulares; float pricecel;

float priceequip; float pricetv;

int producto; int  stockcel; int stockequip;

int stockfincelulares;

  1. | P á g i n a

1        0

[pic 12][pic 13][pic 14][pic 15]

int stockfinequip; int stockfintv;

int stocktv; float variable;

cout << "BIENVENIDOS AL MODULO DE VENTAS DE LA EMPRESA SSONNY" << endl;

cantidad_clientes = 0;

pricetv = 3500;

precio_celulares = 2500;

priceequip = 1600;

stocktv = 200;

stockcel = 1500;

stockequip = 150;

stockfintv = 0;

stockfincelulares = 0;

stockfinequip = 0;

desccel = 0;

mftv = 0;

mfcel = 0;

mfequip = 0;

cout << "TENEMOS LOS SIGUIENTES PRODUCTOS:" << endl;

cout << "1.- TV" << endl;

cout << "2.- CELULARES" << endl;

cout << "3.- EQUIPOS" << endl;

cout << "¿DESEA REALIZAR LA COMPRA?,INDIQUE SI O NO" << endl;

cin >> evaluar;

if (evaluar=="SI") { do {

cantidad_clientes = (cantidad_clientes)+(1);

  1. | P á g i n a

1        0

[pic 16][pic 17][pic 18][pic 19]

cout << "¿CUAL DE LOS PRODUCTOS DESEA COMPRAR? (1,2,3)" <<

endl;

cin >> producto; switch (producto) { case 1:

cout << "¿CUANTOS TELEVISORES DESEA?" << endl;

cin >> variable;

if (variable<stocktv) {

stocktv = (stocktv)-(variable); stockfintv = (stockfintv)+(variable); mbtv  =  (pricetv)*(variable); desctv = (mbtv)*(0.10);

mftv = (mftv)+((mbtv)-(desctv));

} else {

cout << "NO CONTAMOS CON ESE STOCK" << endl; cout << "¿DESEA ACTUALIZAR EL STOCK?" << endl;

cin >> evaluar;

if (evaluar=="SI") {

cout        <<        "INGRESE        EL        NUEVO        STOCK        DE

TELEVISORES" << endl;

cin >> stocktv;

} else {

cout << "OK" << endl;

}

}

break;

case 2:

cout << "¿CUANTOS CELULARES DESEA?" << endl;

cin >> variable;

if (variable<stockcel) {

  1. | P á g i n a

1        0

[pic 20][pic 21][pic 22][pic 23]

stockcel  =  (stockcel)-(variable); stockfincelulares = (stockfincelulares)+(variable); mbcelulares = (precio_celulares)*(variable); desccel = (desccel)+((mbcelulares)*(0.20)); mfcel = (mfcel)+((mbcelulares)-(desccel));

} else {

cout << "NO CONTAMOS CON ESE STOCK" << endl; cout << "¿DESEA ACTUALIZAR EL STOCK?" << endl;

cin >> evaluar;

if (evaluar=="SI") {

cout        <<        "INGRESE        EL        NUEVO        STOCK        DE

TELEVISORES" << endl;

cin >> stockcel;

} else {

cout << "OK" << endl;

}

}

break;

case 3:

cout << "¿CUANTOS EQUIPOS DESEA?" << endl;

cin >> variable;

if (variable<stockequip) {

...

Descargar como (para miembros actualizados)  txt (12.4 Kb)   pdf (481.8 Kb)   docx (464.6 Kb)  
Leer 7 páginas más »
Disponible sólo en Clubensayos.com