TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

Programação Estruturada

Por:   •  25/9/2016  •  Trabalho acadêmico  •  777 Palavras (4 Páginas)  •  225 Visualizações

Página 1 de 4

[pic 1]

...............................................................................................................................

SISTEMAS DA INFORMAÇÃO – PROGRAMAÇÃO DE SISTEMAS

ANDERSON PEREIRA DA SILVA RA: 281332014

PORTFÓLIO

Programação Estruturada

...............................................................................................................................

Guarulhos

2016

ANDERSON PEREIRA DA SILVA

PORTFÓLIO

Programação Estruturada

Trabalho apresentado ao Curso Sistemas da Informação  da Faculdade ENIAC para a disciplina  Programação Estruturada.

Prof.  Cao Ji Kan

Guarulhos

2016

[pic 2]

Respostas

.............................................................................................................

  1. Tarifa Estacionamento (exercicio 5.9).

#include

#include

#include

float calcularTaxa(int veic, float tempo) {

        float valorMin = 2, valorHora = 0.5, valoMax = 10, taxa;

        if(tempo <= 3){

                taxa = valorMin;

        }

        else if(tempo > 3){

                while(tempo > 3){

                        taxa = taxa + valorHora;

                        tempo--;

                }

                taxa = taxa + valorMin;

                if(taxa > 10){

                        taxa = 10;

                }

        }

        return (taxa);        

}

int main(){

        float vTemp[4],vTaxa[4],totalTemp,totalTaxa;

        int vVeic[4],i=1;

        for(i=1;i<=3;i++){        

                printf("Digite tempo carro[%d]: \n",i);

                scanf("%f",&vTemp[i]);

                vVeic[i] = i;

                vTaxa[i] = calcularTaxa(vVeic[i],vTemp[i]);

        }

        printf("Carro \t Horas \t Taxa \t \n");

        for(i=1;i<=3;i++){        

                printf("%d \t %f \t %f \n", vVeic[i],vTemp[i],vTaxa[i]);

                totalTemp = totalTemp + vTemp[i];

                totalTaxa = totalTaxa + vTaxa[i];

        }

        printf("Total \t %f \t %f \t",totalTemp,totalTaxa);

        system("pause");

        return 0;

}

  1. Inverter numeros (exercicio 5.28).

#include

#include

#include

int main(){

    char num[100];

    int i,tam;

    printf("Informe um Numero: \n");

    gets(num);

    tam = strlen(num);

    printf("Numero invertido: \n");

...

Baixar como (para membros premium)  txt (3.2 Kb)   pdf (108.9 Kb)   docx (52.3 Kb)  
Continuar por mais 3 páginas »
Disponível apenas no TrabalhosGratuitos.com