Last active
January 22, 2018 17:28
-
-
Save folksilva/6539260 to your computer and use it in GitHub Desktop.
iPedreiro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define AREA_TIJOLO 0.08; | |
#define TIJOLO 0.7; | |
#define MAO_DE_OBRA 12.5; | |
int main(void) { | |
float tamanho_parede, qtd_tijolos, custo_tijolos, custo_mao_de_obra, total; | |
printf("Bem vindo ao iPedreiro!\n"); | |
printf("Qual o tamanho do muro que quer construir?\n__________ metros quadrados\r"); | |
scanf("%f", &tamanho_parede); | |
qtd_tijolos = tamanho_parede / AREA_TIJOLO; | |
custo_tijolos = qtd_tijolos * TIJOLO; | |
custo_mao_de_obra = tamanho_parede * MAO_DE_OBRA; | |
total = custo_tijolos + custo_mao_de_obra; | |
printf("Veja o orcamento para sua parede:\n\n"); | |
printf("\tQtd de tijolos: %.1f\n", qtd_tijolos); | |
printf("\tCusto dos tijolos: R$%.2f\n", custo_tijolos); | |
printf("\tCusto de mao de obra: R$%.2f\n", custo_mao_de_obra); | |
printf("\tCUSTO TOTAL: R$%.2f\n", total); | |
printf("\n\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment