--> Average 3 (beeCrowd- 1040) URI 1040 solution C, Python | Alpha Codist

Search This Blog

Average 3 (beeCrowd- 1040) URI 1040 solution C, Python

Average 3 beeCrowd 1040 URI solution C Python programming alpha codist solved problem bee all easy weights formula aluno approvado how to calculate ?

Average 3

Average 3 beeCrowd 1040 URI solution C Python programming alpha codist solved problem bee all easy weights formula aluno approvado how to calculate ?


The formula is:

  1. Take input. 
  2. Get the average of n1,n2,n3, and n4 with the formula: (n1*2+n2*3+n3*4+n4*1)/10 (Her 2,3,4 and 1 multiplied with the numbers are weights.
  3. Print the value of media.
  4. Check and print the conditions for "Aluno aprovado." and "Aluno reprovado.". Then check the conditions for In exam students.
  5. If the student is in an exam, print "Aluno em exame." then take another input and calculate the average again. This time just add media and e1 and divide that by 2.
  6. Now again check the conditions for In exam student and print "Aluno aprovado." or "Aluno reprovado" accordingly.

The solution in C:


#include <stdio.h>
 
int main() {
 
    double n1,n2,n3,n4,e1;
    scanf("%lf %lf %lf %lf",&n1,&n2,&n3,&n4);
    
    double media = (n1*2+n2*3+n3*4+n4*1)/10;
    printf("Media: %0.1f\n",media);
    if(media>=7.0) printf("\n");
    else if(media<5.0) printf("Aluno reprovado.\n");
    else if(5.0<=media<=6.9){
        printf("Aluno em exame.\n");
        scanf("%lf",&e1);
        
        printf("Nota do exame: %0.1f\n",e1);
        
        double media_final = (media+e1)/2;
        
        if(media_final>=5.0){
            printf("Aluno aprovado.\n");
        } else if(media_final<5){
            printf("Aluno reprovado\n");
        }
        printf("Media final: %0.1f\n",media_final);
    }
 
    return 0;
}


The solution in Python:


n1,n2,n3,n4 = map(float, input().split())
media = (n1*2+n2*3+n3*4+n4*1)/10;

print("Media: %0.1f"%media);

if media>=7.0:
    print("Aluno aprovado.")
elif media<5.0:
    print("Aluno reprovado.")
elif 5.0<=media<=6.9:
    print("Aluno em exame.")
    e1 = float(input())
    
    print("Nota do exame: %0.1f"%e1)
    
    media_final = (media+e1)/2
    
    if media_final>=5.0:
        print("Aluno aprovado.")
    elif media_final<5:
        print("Aluno reprovado")
        
    print("Media final: %0.1f"%media_final)

COMMENTS

Name

beeCrowd,11,C,10,Computer,9,Downloads,3,HTML,1,My Creation,2,Python,24,Python-Soft,1,Shooting,2,
ltr
item
Alpha Codist: Average 3 (beeCrowd- 1040) URI 1040 solution C, Python
Average 3 (beeCrowd- 1040) URI 1040 solution C, Python
Average 3 beeCrowd 1040 URI solution C Python programming alpha codist solved problem bee all easy weights formula aluno approvado how to calculate ?
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRTbDGuAlhd1MPnNVzhuW1JgTyhat8vP3Wk3oyWYAdtBOBgFeshXFCp7m3wQ-11DToHyn9aHjzNg3DvbOHTJmJp7MgbZ3_dC50A0wIgnHXyaf1Z_YckqEXzc2QqE3v2dty41SvutxBH8D1Kie3nd-cJPFvAMbS8aktVeSVP4XlC9707F0Wl_DwY_DmJw/w640-h422/1040.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRTbDGuAlhd1MPnNVzhuW1JgTyhat8vP3Wk3oyWYAdtBOBgFeshXFCp7m3wQ-11DToHyn9aHjzNg3DvbOHTJmJp7MgbZ3_dC50A0wIgnHXyaf1Z_YckqEXzc2QqE3v2dty41SvutxBH8D1Kie3nd-cJPFvAMbS8aktVeSVP4XlC9707F0Wl_DwY_DmJw/s72-w640-c-h422/1040.png
Alpha Codist
https://alphacodist.blogspot.com/2022/12/average3.html
https://alphacodist.blogspot.com/
https://alphacodist.blogspot.com/
https://alphacodist.blogspot.com/2022/12/average3.html
true
7547834254111195316
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content