SlideShare a Scribd company logo
FACULTY OF ELECTRICAL AND
       ELECTRONIC ENGINEERING




      COMPUTER PROGRAMMING
           LABORATORY




   LABORATORY INSTRUCTION SHEET

Subject’s Code       :   DEE 2112/DAE20102
Course’s Code        :   2 DEE/DET/DAE
No. of Experiment    :   5
Experiment’s Title   :   Array
Faculty of Electrical and Electronic
                                                                       Page          2
                       Engineering

                       Department of Computer Engineering              Session    2010/2011

                       Experiment’s Title:
                                                                       Semester       I
                       #5 Array



AIM: Understand the implementation of arrays in C programming.



1.0    OBJECTIVES
       After completing this unit, students should be able to :
       •     Understand how to initialize, read and modified an element of an array at
             runtime.
       •     Implements arrays in C programming.



2.0    THEORY

       Refer to Chapter Arrays.


3.0    EQUIPMENT LIST
       Personal Computer with Microsoft Visual C++.


4.0    INSTRUCTION
       (i) Short Report: Refer section 5.0


5.0    Short Report (Submit During Laboratory Session)

       5.1        Submit your handwritten report before end of laboratory session. Late
                  submission after 10 minutes additional time will be penalized by deducting
                  10 marks.

       5.2        The report must consists of the following details:
                  Problem Statement 1: You need to provide;
                   o source code of modified program
                   o output of the modified program.

                  Problem Statement 2: You need to provide;
                   o flowchart / pseudo code
                   o source code,
                   o testing, and
                   o verification

                  Discussion, and conclusion
c




                     Faculty of Electrical and Electronic
                                                                                   Page           3
                     Engineering

                     Department of Computer Engineering                            Session    2010/2011

                     Experiment’s Title:
                                                                                   Semester       I
                     #5 Array


Case Study#1: The mean or average value is defined as the sum of all elements divided by
the number of elements. The equation for calculation of the mean value for n elements is as
follows.
                                        n −1

                                        ∑m     i
                                                       m0 + m1 + m2 + ... + mn−1
                            meanval =   i =0
                                                   =
                                           n                      n

Figure1 illustrates how the mean value for n elements is calculated using repetition
structure. The variable sum is first set to zero. A for loop is then used to read the value of
elements, and perform additional operations of all elements received by variable m. The
variable meanval contains the mean value.


Figure1 The PS_arrays.c containing a program to calculate the mean value for n elements

Problem Statement 1:In this experiment, modify the above source code by applying an
   array. The modified program should receive the value of each element and stored in
   array m. The modified program should perform the same operations; calculating and
   displaying the mean value for n elements, and produces the same output as given
   program in Figure1.

Execute the modified source code and report the findings.

Problem Statement 2:Design a program to calculate and display the effective inductance
   (L) of two coils arranged in (i) serial OR (ii) parallel. The user should provide connection
   of coils, inductance of L1, inductance of L2 and mutual inductance (M). This program
   should repeat 5 times. Use array L1, L2, M and conn to save all the inputs and array L
   to save all the outputs.

More Related Content

What's hot

Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
Dr.YNM
 
Learning C and C++
Learning C and C++Learning C and C++
Learning C and C++
Pagal Bacha
 
Lesson 14. Pattern 6. Changing an array's type
Lesson 14. Pattern 6. Changing an array's typeLesson 14. Pattern 6. Changing an array's type
Lesson 14. Pattern 6. Changing an array's type
PVS-Studio
 
Esg111 midterm review
Esg111 midterm reviewEsg111 midterm review
Esg111 midterm review
mickeynickey1
 
Com Ed 6 Prelim
Com Ed 6 PrelimCom Ed 6 Prelim
Com Ed 6 Prelim
bluejayjunior
 
VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments
Dr.YNM
 
Com Ed 6 Prelim
Com Ed 6 PrelimCom Ed 6 Prelim
Com Ed 6 Prelim
bluejayjunior
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
Keroles karam khalil
 
175035 cse lab 01
175035 cse lab 01175035 cse lab 01
175035 cse lab 01
Mahbubay Rabbani Mim
 
Ocs752 unit 3
Ocs752   unit 3Ocs752   unit 3
Ocs752 unit 3
mgrameshmail
 
C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
manjurkts
 
Fortran 90 Basics
Fortran 90 BasicsFortran 90 Basics
Fortran 90 Basics
Tariqul Dipu
 

What's hot (12)

Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
 
Learning C and C++
Learning C and C++Learning C and C++
Learning C and C++
 
Lesson 14. Pattern 6. Changing an array's type
Lesson 14. Pattern 6. Changing an array's typeLesson 14. Pattern 6. Changing an array's type
Lesson 14. Pattern 6. Changing an array's type
 
Esg111 midterm review
Esg111 midterm reviewEsg111 midterm review
Esg111 midterm review
 
Com Ed 6 Prelim
Com Ed 6 PrelimCom Ed 6 Prelim
Com Ed 6 Prelim
 
VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments
 
Com Ed 6 Prelim
Com Ed 6 PrelimCom Ed 6 Prelim
Com Ed 6 Prelim
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
 
175035 cse lab 01
175035 cse lab 01175035 cse lab 01
175035 cse lab 01
 
Ocs752 unit 3
Ocs752   unit 3Ocs752   unit 3
Ocs752 unit 3
 
C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
 
Fortran 90 Basics
Fortran 90 BasicsFortran 90 Basics
Fortran 90 Basics
 

Viewers also liked

Array in c language
Array in c languageArray in c language
Array in c languagehome
 
Arrays
ArraysArrays
Array in c language
Array in c languageArray in c language
Array in c language
sanjay joshi
 
Array in C
Array in CArray in C
Array in C
adityas29
 
Array in C
Array in CArray in C
Array in C
Kamal Acharya
 
Lab exp declaring arrays)
Lab exp declaring arrays)Lab exp declaring arrays)
Lab exp declaring arrays)
Daman Toor
 
Lecture#2 Computer languages computer system and Programming EC-105
Lecture#2 Computer languages computer system and Programming EC-105Lecture#2 Computer languages computer system and Programming EC-105
Lecture#2 Computer languages computer system and Programming EC-105
NUST Stuff
 
Program Logic Formulation - Ohio State University
Program Logic Formulation - Ohio State UniversityProgram Logic Formulation - Ohio State University
Program Logic Formulation - Ohio State University
Reggie Niccolo Santos
 
C++ for beginners
C++ for beginnersC++ for beginners
C++ for beginners
Salahaddin University-Erbil
 
Lecture 19 matlab_script&function_files06
Lecture 19 matlab_script&function_files06Lecture 19 matlab_script&function_files06
Lecture 19 matlab_script&function_files06Aman kazmi
 
Computer programming
Computer programmingComputer programming
Computer programming
Sujay Raj
 
C++0x :: Introduction to some amazing features
C++0x :: Introduction to some amazing featuresC++0x :: Introduction to some amazing features
C++0x :: Introduction to some amazing features
Christian Perone
 
Array in c
Array in cArray in c
Array in c
Ravi Gelani
 
Apt programming
Apt programmingApt programming
Apt programming
Vemulapalli Das
 
Array in c
Array in cArray in c
Array in c
AnIsh Kumar
 
Use of computer programming in animal diet formulation
Use of computer programming in animal diet formulationUse of computer programming in animal diet formulation
Use of computer programming in animal diet formulation
Milling and Grain magazine
 
DISE - Programming Concepts
DISE - Programming ConceptsDISE - Programming Concepts
DISE - Programming Concepts
Rasan Samarasinghe
 
Types of lamps
Types of lampsTypes of lamps
Types of lamps
Poonam Sarawgi
 
NC Programming
NC ProgrammingNC Programming
NC Programming
Vishnuvardhan Reddy S
 

Viewers also liked (20)

Array in c language
Array in c languageArray in c language
Array in c language
 
Array in c
Array in cArray in c
Array in c
 
Arrays
ArraysArrays
Arrays
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Array in C
Array in CArray in C
Array in C
 
Array in C
Array in CArray in C
Array in C
 
Lab exp declaring arrays)
Lab exp declaring arrays)Lab exp declaring arrays)
Lab exp declaring arrays)
 
Lecture#2 Computer languages computer system and Programming EC-105
Lecture#2 Computer languages computer system and Programming EC-105Lecture#2 Computer languages computer system and Programming EC-105
Lecture#2 Computer languages computer system and Programming EC-105
 
Program Logic Formulation - Ohio State University
Program Logic Formulation - Ohio State UniversityProgram Logic Formulation - Ohio State University
Program Logic Formulation - Ohio State University
 
C++ for beginners
C++ for beginnersC++ for beginners
C++ for beginners
 
Lecture 19 matlab_script&function_files06
Lecture 19 matlab_script&function_files06Lecture 19 matlab_script&function_files06
Lecture 19 matlab_script&function_files06
 
Computer programming
Computer programmingComputer programming
Computer programming
 
C++0x :: Introduction to some amazing features
C++0x :: Introduction to some amazing featuresC++0x :: Introduction to some amazing features
C++0x :: Introduction to some amazing features
 
Array in c
Array in cArray in c
Array in c
 
Apt programming
Apt programmingApt programming
Apt programming
 
Array in c
Array in cArray in c
Array in c
 
Use of computer programming in animal diet formulation
Use of computer programming in animal diet formulationUse of computer programming in animal diet formulation
Use of computer programming in animal diet formulation
 
DISE - Programming Concepts
DISE - Programming ConceptsDISE - Programming Concepts
DISE - Programming Concepts
 
Types of lamps
Types of lampsTypes of lamps
Types of lamps
 
NC Programming
NC ProgrammingNC Programming
NC Programming
 

Similar to Lab 5 array

Lab manual uoh_ee370
Lab manual uoh_ee370Lab manual uoh_ee370
Lab manual uoh_ee370slatano
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
ANJALAI AMMAL MAHALINGAM ENGINEERING COLLEGE
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
manjurkts
 
Object Oriented Programming OOP Lab Manual.docx
Object Oriented Programming OOP Lab Manual.docxObject Oriented Programming OOP Lab Manual.docx
Object Oriented Programming OOP Lab Manual.docx
RashidFaridChishti
 
From programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides availableFrom programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides available
Celso Martins
 
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docxENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
YASHU40
 
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docxELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
jack60216
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
Anil Bishnoi
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
Ankit Dubey
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
Ankit Dubey
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
Ankit Dubey
 
Analog communications lab
Analog communications labAnalog communications lab
Analog communications labVishal kakade
 
PEEC based electromagnetic simulator
PEEC based electromagnetic simulator PEEC based electromagnetic simulator
PEEC based electromagnetic simulator
Swapnil Gaul
 
CSE-503 coursepack (1).doc
CSE-503 coursepack (1).docCSE-503 coursepack (1).doc
CSE-503 coursepack (1).doc
SZahidNabiDar
 
Problem 7PurposeBreak apart a complicated system.ConstantsC7C13.docx
Problem 7PurposeBreak apart a complicated system.ConstantsC7C13.docxProblem 7PurposeBreak apart a complicated system.ConstantsC7C13.docx
Problem 7PurposeBreak apart a complicated system.ConstantsC7C13.docx
LacieKlineeb
 
IRJET- Stress – Strain Field Analysis of Mild Steel Component using Finite El...
IRJET- Stress – Strain Field Analysis of Mild Steel Component using Finite El...IRJET- Stress – Strain Field Analysis of Mild Steel Component using Finite El...
IRJET- Stress – Strain Field Analysis of Mild Steel Component using Finite El...
IRJET Journal
 
Cp manual final
Cp manual finalCp manual final
Cp manual final
itprasad1237
 

Similar to Lab 5 array (20)

Lab manual uoh_ee370
Lab manual uoh_ee370Lab manual uoh_ee370
Lab manual uoh_ee370
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
 
Book
BookBook
Book
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
 
Object Oriented Programming OOP Lab Manual.docx
Object Oriented Programming OOP Lab Manual.docxObject Oriented Programming OOP Lab Manual.docx
Object Oriented Programming OOP Lab Manual.docx
 
From programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides availableFrom programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides available
 
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docxENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
 
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docxELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
Analog communications lab
Analog communications labAnalog communications lab
Analog communications lab
 
LMmanual.pdf
LMmanual.pdfLMmanual.pdf
LMmanual.pdf
 
PEEC based electromagnetic simulator
PEEC based electromagnetic simulator PEEC based electromagnetic simulator
PEEC based electromagnetic simulator
 
CSE-503 coursepack (1).doc
CSE-503 coursepack (1).docCSE-503 coursepack (1).doc
CSE-503 coursepack (1).doc
 
Problem 7PurposeBreak apart a complicated system.ConstantsC7C13.docx
Problem 7PurposeBreak apart a complicated system.ConstantsC7C13.docxProblem 7PurposeBreak apart a complicated system.ConstantsC7C13.docx
Problem 7PurposeBreak apart a complicated system.ConstantsC7C13.docx
 
IRJET- Stress – Strain Field Analysis of Mild Steel Component using Finite El...
IRJET- Stress – Strain Field Analysis of Mild Steel Component using Finite El...IRJET- Stress – Strain Field Analysis of Mild Steel Component using Finite El...
IRJET- Stress – Strain Field Analysis of Mild Steel Component using Finite El...
 
Cp manual final
Cp manual finalCp manual final
Cp manual final
 
BE-DIP-Lab-Manual.pdf
BE-DIP-Lab-Manual.pdfBE-DIP-Lab-Manual.pdf
BE-DIP-Lab-Manual.pdf
 

More from mkazree

Coal Fired Power Plant
Coal Fired Power PlantCoal Fired Power Plant
Coal Fired Power Plant
mkazree
 
Contoh kertas kerja program
Contoh kertas kerja programContoh kertas kerja program
Contoh kertas kerja program
mkazree
 
Foster-seely and Ratio Detector (Discriminator )
Foster-seely and Ratio Detector (Discriminator )Foster-seely and Ratio Detector (Discriminator )
Foster-seely and Ratio Detector (Discriminator )
mkazree
 
Communication Engineering - Chapter 6 - Noise
Communication Engineering - Chapter 6 - NoiseCommunication Engineering - Chapter 6 - Noise
Communication Engineering - Chapter 6 - Noisemkazree
 
Chapter 5 fm receivers
Chapter 5  fm receiversChapter 5  fm receivers
Chapter 5 fm receivers
mkazree
 
The Electronic Hobby Kit
The Electronic Hobby KitThe Electronic Hobby Kit
The Electronic Hobby Kit
mkazree
 
Tutorial chapter 2 robotic
Tutorial chapter 2 roboticTutorial chapter 2 robotic
Tutorial chapter 2 roboticmkazree
 
Dek3223 chapter 2 robotic
Dek3223 chapter 2 roboticDek3223 chapter 2 robotic
Dek3223 chapter 2 roboticmkazree
 
Chapter 3 am receivers
Chapter 3 am receiversChapter 3 am receivers
Chapter 3 am receiversmkazree
 
Dek3223 chapter 3 industrial robotic
Dek3223 chapter 3 industrial roboticDek3223 chapter 3 industrial robotic
Dek3223 chapter 3 industrial roboticmkazree
 
Tutorial chapter 3 robotic
Tutorial chapter 3 roboticTutorial chapter 3 robotic
Tutorial chapter 3 roboticmkazree
 
Tutorial 2 amplitude modulation
Tutorial 2 amplitude  modulationTutorial 2 amplitude  modulation
Tutorial 2 amplitude modulationmkazree
 
Chapter 3 am receivers
Chapter 3 am receiversChapter 3 am receivers
Chapter 3 am receiversmkazree
 
Comm introduction
Comm introductionComm introduction
Comm introductionmkazree
 
Chapter2 cont
Chapter2 contChapter2 cont
Chapter2 contmkazree
 
Chapter 2 amplitude_modulation
Chapter 2 amplitude_modulationChapter 2 amplitude_modulation
Chapter 2 amplitude_modulationmkazree
 
Chapter5 dek 3143 dae 32303 9 (nota tambahan)
Chapter5 dek 3143 dae 32303 9 (nota tambahan)Chapter5 dek 3143 dae 32303 9 (nota tambahan)
Chapter5 dek 3143 dae 32303 9 (nota tambahan)mkazree
 
120102011
120102011120102011
120102011mkazree
 
Ii20102011
Ii20102011Ii20102011
Ii20102011mkazree
 
Chapter 4 synchronous machine
Chapter 4 synchronous machineChapter 4 synchronous machine
Chapter 4 synchronous machinemkazree
 

More from mkazree (20)

Coal Fired Power Plant
Coal Fired Power PlantCoal Fired Power Plant
Coal Fired Power Plant
 
Contoh kertas kerja program
Contoh kertas kerja programContoh kertas kerja program
Contoh kertas kerja program
 
Foster-seely and Ratio Detector (Discriminator )
Foster-seely and Ratio Detector (Discriminator )Foster-seely and Ratio Detector (Discriminator )
Foster-seely and Ratio Detector (Discriminator )
 
Communication Engineering - Chapter 6 - Noise
Communication Engineering - Chapter 6 - NoiseCommunication Engineering - Chapter 6 - Noise
Communication Engineering - Chapter 6 - Noise
 
Chapter 5 fm receivers
Chapter 5  fm receiversChapter 5  fm receivers
Chapter 5 fm receivers
 
The Electronic Hobby Kit
The Electronic Hobby KitThe Electronic Hobby Kit
The Electronic Hobby Kit
 
Tutorial chapter 2 robotic
Tutorial chapter 2 roboticTutorial chapter 2 robotic
Tutorial chapter 2 robotic
 
Dek3223 chapter 2 robotic
Dek3223 chapter 2 roboticDek3223 chapter 2 robotic
Dek3223 chapter 2 robotic
 
Chapter 3 am receivers
Chapter 3 am receiversChapter 3 am receivers
Chapter 3 am receivers
 
Dek3223 chapter 3 industrial robotic
Dek3223 chapter 3 industrial roboticDek3223 chapter 3 industrial robotic
Dek3223 chapter 3 industrial robotic
 
Tutorial chapter 3 robotic
Tutorial chapter 3 roboticTutorial chapter 3 robotic
Tutorial chapter 3 robotic
 
Tutorial 2 amplitude modulation
Tutorial 2 amplitude  modulationTutorial 2 amplitude  modulation
Tutorial 2 amplitude modulation
 
Chapter 3 am receivers
Chapter 3 am receiversChapter 3 am receivers
Chapter 3 am receivers
 
Comm introduction
Comm introductionComm introduction
Comm introduction
 
Chapter2 cont
Chapter2 contChapter2 cont
Chapter2 cont
 
Chapter 2 amplitude_modulation
Chapter 2 amplitude_modulationChapter 2 amplitude_modulation
Chapter 2 amplitude_modulation
 
Chapter5 dek 3143 dae 32303 9 (nota tambahan)
Chapter5 dek 3143 dae 32303 9 (nota tambahan)Chapter5 dek 3143 dae 32303 9 (nota tambahan)
Chapter5 dek 3143 dae 32303 9 (nota tambahan)
 
120102011
120102011120102011
120102011
 
Ii20102011
Ii20102011Ii20102011
Ii20102011
 
Chapter 4 synchronous machine
Chapter 4 synchronous machineChapter 4 synchronous machine
Chapter 4 synchronous machine
 

Lab 5 array

  • 1. FACULTY OF ELECTRICAL AND ELECTRONIC ENGINEERING COMPUTER PROGRAMMING LABORATORY LABORATORY INSTRUCTION SHEET Subject’s Code : DEE 2112/DAE20102 Course’s Code : 2 DEE/DET/DAE No. of Experiment : 5 Experiment’s Title : Array
  • 2. Faculty of Electrical and Electronic Page 2 Engineering Department of Computer Engineering Session 2010/2011 Experiment’s Title: Semester I #5 Array AIM: Understand the implementation of arrays in C programming. 1.0 OBJECTIVES After completing this unit, students should be able to : • Understand how to initialize, read and modified an element of an array at runtime. • Implements arrays in C programming. 2.0 THEORY Refer to Chapter Arrays. 3.0 EQUIPMENT LIST Personal Computer with Microsoft Visual C++. 4.0 INSTRUCTION (i) Short Report: Refer section 5.0 5.0 Short Report (Submit During Laboratory Session) 5.1 Submit your handwritten report before end of laboratory session. Late submission after 10 minutes additional time will be penalized by deducting 10 marks. 5.2 The report must consists of the following details:  Problem Statement 1: You need to provide; o source code of modified program o output of the modified program.  Problem Statement 2: You need to provide; o flowchart / pseudo code o source code, o testing, and o verification  Discussion, and conclusion
  • 3. c Faculty of Electrical and Electronic Page 3 Engineering Department of Computer Engineering Session 2010/2011 Experiment’s Title: Semester I #5 Array Case Study#1: The mean or average value is defined as the sum of all elements divided by the number of elements. The equation for calculation of the mean value for n elements is as follows. n −1 ∑m i m0 + m1 + m2 + ... + mn−1 meanval = i =0 = n n Figure1 illustrates how the mean value for n elements is calculated using repetition structure. The variable sum is first set to zero. A for loop is then used to read the value of elements, and perform additional operations of all elements received by variable m. The variable meanval contains the mean value. Figure1 The PS_arrays.c containing a program to calculate the mean value for n elements Problem Statement 1:In this experiment, modify the above source code by applying an array. The modified program should receive the value of each element and stored in array m. The modified program should perform the same operations; calculating and displaying the mean value for n elements, and produces the same output as given program in Figure1. Execute the modified source code and report the findings. Problem Statement 2:Design a program to calculate and display the effective inductance (L) of two coils arranged in (i) serial OR (ii) parallel. The user should provide connection of coils, inductance of L1, inductance of L2 and mutual inductance (M). This program should repeat 5 times. Use array L1, L2, M and conn to save all the inputs and array L to save all the outputs.