SlideShare une entreprise Scribd logo
1  sur  6
SOAL KASUS
Diketahui ada 10 bilangan sebagai berikut :

50, 40, 20, 5, 100, 80, 700, 0, 85, 125

Dari data bilangan di atas saudara buat rancangan program untuk menentukan :

      a. Bilangan rata-rata dari angka tersebut !
      b. Bilangan Terkecil !
      c. Bilangan Terbesar !

      Yang harus saudara buat adalah

      1.    Tentukan Nama VAR dan tipe data !
      2.    Buat Program Flow chart !
      3.    Buat Listing Program !
      4.    Analisis dan Cek Program !




      1. NAMA VARIABEL DAN TIPE DATA YANG DIGUNAKAN


No.               Nama Variabel                 Tipe data                Keterangan
 1         Bil                                     Real           Bilangan yang dimasukan
 2         Jbil                                    Real            Jumlah Total Bilangan
 3         Jdat                                    Real           Banyak Data yang diinput
 4         rata                                    Real              Nilai Rata-rata Data
 5         max                                     Real                 Nilai Maksimal
 6         min                                     Real                 Nilai Minimal
 7         bil1                                    Real                 Bilangan Ke-1
 8         Bilx                                    Real                 Bilangan Ke-x
 9         i,n                                   Integer                    Looping




®Pamungkas Achmadi Akbar
 1200877                                                                                     1
2. FLOW CHART PROGRAM RATA-RATA, MAX, MIN



                                             START




                                    bil:=0; jbil:=0; jdat:=0;
                                    rata:=0; max:=0; min:=0;
                                    bilx:=0; bil1:=0;
                                    i:=0; n:=0;




                 write ('Banyak Bilangan yang akan dihitung: '); readln(n);



                                         jdat:=jdat+1;
                                        for i:=1 to n do



                                       FOR i:=1 to n do


                  write ('Bilangan ke- 1 yang dimasukan : '); readln (bil1);



                                         jbil:=jbil+bil1;
                                           min:=bil1;
                                           max:=bil1;


                                       FOR i:=2 to n do


                 write ('Bilangan ke-',i:2,' yang dimasukan : '); readln (bilx);



                                                2



   1
®Pamungkas Achmadi Akbar
 1200877                                                                           2
1                                             2


                                         jbil:=jbil+bilx;
                                         jdat:=jdat+1;
                                        rata:=jbil/jdat;
                                IF min < bilx THEN min := min
                                        ELSE min := bilx;
                               IF max >= bilx THEN max := max
                                        ELSE max := bilx;




                                                  OUTPUT
                  writeln ('Jumlah Total Bilangan yang dihitung : ',jbil:2:0);
                  writeln ('Banyak Data yang dihitung           : ',jdat:2:0);
                  writeln ('Nilai Rata-rata dari ',jdat:2:0,' adalah : ',rata:2:2);
                  writeln ('Nilai Minimum dari ',jdat:2:0,' adalah : ',min:2:0);
                  writeln ('Nilai Maksimum dari',jdat:2:0,' adalah : ',max:2:2);




                    TIDAK                      EOF


                                                      YA

                                               STOP




®Pamungkas Achmadi Akbar
 1200877                                                                              3
3. LISTING PROGRAM NILAI RATA-RATA, MAX, MIN



Program rata_rata_max_min;
uses wincrt;
var
bil, jbil, jdat, rata :real;
max, min, bilx, bil1 :real;
i,n : integer;

begin
bil:=0; jbil:=0; jdat:=0; rata:=0; max:=0; min:=0; bilx:=0; biln:=0;
i:=0; n:=0;

write ('Banyak Bilangan yang akan dihitung: '); readln(n);
writeln;

jdat:=jdat+1;
for i:=1 to n do

begin

write ('Bilangan ke- 1 yang dimasukan : '); readln (bil1);
jbil:=jbil+bil1;
min:=bil1;
max:=bil1;

for i:=2 to n do

begin
write ('Bilangan ke-',i:2,' yang dimasukan : '); readln (bilx);

jbil:=jbil+bilx;
jdat:=jdat+1;
rata:=jbil/jdat;
IF min < bilx THEN min := min
 ELSE min := bilx;
IF max >= bilx THEN max := max
 ELSE max := bilx;
end;
writeln;
writeln ('Jumlah Total Bilangan yang dihitung : ',jbil:2:0);
writeln ('Banyak Data yang dihitung           : ',jdat:2:0);
writeln ('Nilai Rata-rata dari ',jdat:2:0,' adalah : ',rata:2:2);
writeln ('Nilai Minimum dari ',jdat:2:0,' adalah : ',min:2:0);
writeln ('Nilai Maksimum dari ',jdat:2:0,' adalah : ',max:2:2);

®Pamungkas Achmadi Akbar
 1200877                                                               4
end;
writeln;
writeln (' ********** ALHAMDULILLAH SELESAI ********** ');
writeln ('##### COBA LAGI ? SILAHKAN RUNNING KEMBALI ##### ');
end.



   4. HASIL ANALISIS DAN CEK PROGRAM

        Berdasarkan hasil dari pengecekan dengan input 10 nilai sesuai dengan data yang
diinginkan program ini dapat disimpulkan bahwa Program yang dibuat berhasil, karena dari segi
Jumlah, Banyak data, Nilai rata-rata, Max, dan Min memiliki nilai yang tepat (Lihat Gambar 1).
Selain itu program ini juga dapat menghitung bilangan lebih dari 10 Bilangan (Lihat Gambar 2).




®Pamungkas Achmadi Akbar
 1200877                                                                                     5
***SELESAI***




®Pamungkas Achmadi Akbar
 1200877                                   6

Contenu connexe

En vedette

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

PROGKOM AVE, MAX,MIN

  • 1. SOAL KASUS Diketahui ada 10 bilangan sebagai berikut : 50, 40, 20, 5, 100, 80, 700, 0, 85, 125 Dari data bilangan di atas saudara buat rancangan program untuk menentukan : a. Bilangan rata-rata dari angka tersebut ! b. Bilangan Terkecil ! c. Bilangan Terbesar ! Yang harus saudara buat adalah 1. Tentukan Nama VAR dan tipe data ! 2. Buat Program Flow chart ! 3. Buat Listing Program ! 4. Analisis dan Cek Program ! 1. NAMA VARIABEL DAN TIPE DATA YANG DIGUNAKAN No. Nama Variabel Tipe data Keterangan 1 Bil Real Bilangan yang dimasukan 2 Jbil Real Jumlah Total Bilangan 3 Jdat Real Banyak Data yang diinput 4 rata Real Nilai Rata-rata Data 5 max Real Nilai Maksimal 6 min Real Nilai Minimal 7 bil1 Real Bilangan Ke-1 8 Bilx Real Bilangan Ke-x 9 i,n Integer Looping ®Pamungkas Achmadi Akbar 1200877 1
  • 2. 2. FLOW CHART PROGRAM RATA-RATA, MAX, MIN START bil:=0; jbil:=0; jdat:=0; rata:=0; max:=0; min:=0; bilx:=0; bil1:=0; i:=0; n:=0; write ('Banyak Bilangan yang akan dihitung: '); readln(n); jdat:=jdat+1; for i:=1 to n do FOR i:=1 to n do write ('Bilangan ke- 1 yang dimasukan : '); readln (bil1); jbil:=jbil+bil1; min:=bil1; max:=bil1; FOR i:=2 to n do write ('Bilangan ke-',i:2,' yang dimasukan : '); readln (bilx); 2 1 ®Pamungkas Achmadi Akbar 1200877 2
  • 3. 1 2 jbil:=jbil+bilx; jdat:=jdat+1; rata:=jbil/jdat; IF min < bilx THEN min := min ELSE min := bilx; IF max >= bilx THEN max := max ELSE max := bilx; OUTPUT writeln ('Jumlah Total Bilangan yang dihitung : ',jbil:2:0); writeln ('Banyak Data yang dihitung : ',jdat:2:0); writeln ('Nilai Rata-rata dari ',jdat:2:0,' adalah : ',rata:2:2); writeln ('Nilai Minimum dari ',jdat:2:0,' adalah : ',min:2:0); writeln ('Nilai Maksimum dari',jdat:2:0,' adalah : ',max:2:2); TIDAK EOF YA STOP ®Pamungkas Achmadi Akbar 1200877 3
  • 4. 3. LISTING PROGRAM NILAI RATA-RATA, MAX, MIN Program rata_rata_max_min; uses wincrt; var bil, jbil, jdat, rata :real; max, min, bilx, bil1 :real; i,n : integer; begin bil:=0; jbil:=0; jdat:=0; rata:=0; max:=0; min:=0; bilx:=0; biln:=0; i:=0; n:=0; write ('Banyak Bilangan yang akan dihitung: '); readln(n); writeln; jdat:=jdat+1; for i:=1 to n do begin write ('Bilangan ke- 1 yang dimasukan : '); readln (bil1); jbil:=jbil+bil1; min:=bil1; max:=bil1; for i:=2 to n do begin write ('Bilangan ke-',i:2,' yang dimasukan : '); readln (bilx); jbil:=jbil+bilx; jdat:=jdat+1; rata:=jbil/jdat; IF min < bilx THEN min := min ELSE min := bilx; IF max >= bilx THEN max := max ELSE max := bilx; end; writeln; writeln ('Jumlah Total Bilangan yang dihitung : ',jbil:2:0); writeln ('Banyak Data yang dihitung : ',jdat:2:0); writeln ('Nilai Rata-rata dari ',jdat:2:0,' adalah : ',rata:2:2); writeln ('Nilai Minimum dari ',jdat:2:0,' adalah : ',min:2:0); writeln ('Nilai Maksimum dari ',jdat:2:0,' adalah : ',max:2:2); ®Pamungkas Achmadi Akbar 1200877 4
  • 5. end; writeln; writeln (' ********** ALHAMDULILLAH SELESAI ********** '); writeln ('##### COBA LAGI ? SILAHKAN RUNNING KEMBALI ##### '); end. 4. HASIL ANALISIS DAN CEK PROGRAM Berdasarkan hasil dari pengecekan dengan input 10 nilai sesuai dengan data yang diinginkan program ini dapat disimpulkan bahwa Program yang dibuat berhasil, karena dari segi Jumlah, Banyak data, Nilai rata-rata, Max, dan Min memiliki nilai yang tepat (Lihat Gambar 1). Selain itu program ini juga dapat menghitung bilangan lebih dari 10 Bilangan (Lihat Gambar 2). ®Pamungkas Achmadi Akbar 1200877 5