Informática, pregunta formulada por Daiana010, hace 2 días

En c++

SE COMPRA EN UNA MUEBLERIA UN MUEBLE x, SI EL MUEBLE CUESTA DE 1-2000 SE
REALIZA DESCUENTO DEL 10%, SI EL MUEBLE CUESTA DE 2001-4000 SE REALIZA
DESCUENTO DEL 20% Y SI EL MUEBLE CUESTA DE 4001- EEN ADELANTE SE REALIZA
DESCUENTO DEL 40%,
EL COMPRADOR PUEDE LLEVAR 1, 2, O 3 DEL ATICULO DESEADO, LA CANTIDAD NO
IMPORTA PARA EL DESCUENTO.
A) SOLICITA ELPRECIO
B) SOLICITA LA CANTODAD
C) MUESTRA EL TOTAL DE COMPRA SIN DESCUENTO
D) MUESTRA ELL DESCUENTO QUE SE LE REALIZA
E) MUESTRA EL TOTAL DE COMPRA CON DESCUENTO

Respuestas a la pregunta

Contestado por flavio62
0

Respuesta:

mueble descuento en C++

Explicación:

#include<iostream>

using namespace std;

int main() {

float cantidadmuebles;

float descuento;

string descuenton="";  

float muebleprecio;

cout << "Precio del mueble:" << endl;

cin >> muebleprecio;

cout << "Cantidad de muebles:" << endl;

cin >> cantidadmuebles;

muebleprecio = muebleprecio*cantidadmuebles;

if (muebleprecio>=1 && muebleprecio<=2000) {

 descuento = muebleprecio-(muebleprecio*0.10);

 descuenton = "10%";

}

else if (muebleprecio>=2001 && muebleprecio<=4000)

 {

 descuento = muebleprecio-(muebleprecio*0.20);

 descuenton = "20%";

}

else if (muebleprecio>=4001)  

{  

 descuento = muebleprecio-(muebleprecio*0.40);

 descuenton = "40%";

}  

else {

 }  

cout << "Total sin descuento:" << muebleprecio << endl;

cout << "Descuento de " << descuenton << endl;

cout << "Total con descuento:" << descuento << endl;

return 0;

}

Adjuntos:
Otras preguntas