NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

# include <stdio.h>
int main (void)
{
int i,qstao,opcao,linha=0,clna=0;
int numeroAprovados=0;
int matric[50];
int nota[50];
char nome[50][30];
char resp[50][10];

//vc pode inserir os valores desde modo quando cria as variáveis;
char gab[10] = {'c','e','d','c','a','d','e','c','a','e'};

//Zerar o vetor de notas para receber os valores
for(i=0; i<50; i++)
{
nota[i]=0;
}

/*
gab[0]='c';
gab[1]='e';
gab[2]='d';
gab[3]='c';
gab[4]='a';
gab[5]='c';
gab[6]='e';
gab[7]='c';
gab[8]='a';
gab[9]='e';
*/
do
{
printf("nn");
printf(" n ___________________________________________________n");
printf("|Programa para calcular a provas de multipla Escolha|n");
printf("|___________________________________________________|nn");
printf("+-------+------+------+-----+-------+-------+------+------+");
printf("n| . - 1 Calcular a nota . |");
printf("n| :: - 2 Mostra o nome e a matric dos aprovados :: |");
printf("n|::: - 3 Mostra o nome e a matric dos reprovados :::|");
printf("n| - 0 Sair |n");
printf("+-------+------+------+-----+-------+-------+------+------+");
printf("n Opcao Escolhida:");
scanf("%d",&opcao);
switch(opcao)
{
case 1:
printf("n");
printf("n+------------------------+n");
printf ("| Informe o nome do Aluno|r");
printf("n+------------------------+n");
scanf ("%s",nome[linha]);
printf("+----------------+n");
printf ("| Matricula: |n");
printf("+----------------+n");
scanf ("%d",&matric[linha]);

for(clna=0; clna<10; clna++)
{
printf("+-------------+n");
printf ("| Questao %d: |n",clna+1);
printf("+-------------+n");
getchar();
scanf("%c",&resp[linha][clna]);

printf("Gabarito:%cnResposta:%c ",gab[clna],resp[linha][clna]);

if(resp[linha][clna] == gab[clna])
{
nota[linha] += 1;
printf(" nResultado: CERTO!nn");
}
else
{
printf(" nResultado: ERRADO!nn");
}

}
//Em cada linha do vetor nota é somado o valor total correspondente ao aluno
printf("n Nota do Aluno: %d pontos",nota[linha]);

if(nota[linha]>=5)
{
numeroAprovados++;
}
linha++;
//Esta linha calcula a percentagem de aprovados
printf("nAprovados:%d/NumeroPessoas:%d => %.2f%%",numeroAprovados,linha,(float)(numeroAprovados/linha * 100));




break;
case 2:
//vai ter que percorrer o vetor mostrando somente os que possuem nota[linha]>=5

break;
case 3:
//vai ter que percorrer o vetor mostrando somente os que possuem nota[linha]< 5
break;
}
}
while(opcao!=0);



return 0;
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.