Capture1.PNG @ 8 Q Q Capture2.PNG Edt Program Appearance 門 目 Tools Help Larges index 8 Integer Smalestindex Temp Values (Values Th Output "The index of the largest Largester LargestIndex (Integer Array Values Integer) Integer NDEX NDEX- 1-01-1 Return Integer NDEX Values NDEX-Values) 48% Θ ☐ Х 田 الحا Capture3.PNG File Edit Program Appearance Window Tools Help 合區 ·造 ☐ ☑ Capture4.PNG Smalles index B Θ PrintArray (Integer Array Values, Integer num) Integer i Output "PrintArray Execute/ Next 1-010-1 Dene Smalestindex (Integer Array Values Integer Integer INDEX INDEX-0 Next 1-0 to Num-1 Dene Output Values/ False Values(NDEX-Values Return Integer INDEX ☐ ㅁ INDEX-i Capture5.PNG File Edit Program Appearance Window 門 - Capture6.PNG ☑ File Edit Program Appearance Window Tools Help 合區 Swap 目 Θ Swap Integer Temp Temp = Values[Index] Valuesindex1] Values[Index] Valuesindex2] Temp PrintArray(Values, Size) End Swap Integer Temp Temp Values ndex] Values[index] Values Variable Not Declared ☐ ☐ Х About: Before you can store or read data from a variable, it must first be declared. Cause: The variable 'Temp' was not declared Steps: -Define a function PrintArray that takes an array and its size and prints the values stored in the array. The function does not return anything. -Use the function Index, as an example, to define: - A function MaxValueIndex that takes an array and its size and returns the index(position) of the largest element (greatest value) in the array. -A function MinValueIndex that takes an array and its size and returns the index (position) of the smallest element in the array. -Write a function Swap that takes an array, its size and the indexes of two elements and swap their values. Call the function PrintArray from within Swap to print the array after swapping.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello, can you please help me. The program tells me I'm missing the variable 'temp' but I don't know how to do it. Can you please help me correct this, please explain in a clear way how to make this work, this is new to me. I'm using a program called Flowgorithm. I attached a pic of my program and a pic of the instructions.

Capture1.PNG
@
8 Q Q
Capture2.PNG
Edt Program Appearance
門
目
Tools Help
Larges index 8
Integer Smalestindex
Temp Values
(Values
Th
Output "The index of the largest
Largester
LargestIndex
(Integer Array Values Integer)
Integer NDEX
NDEX-
1-01-1
Return Integer NDEX
Values NDEX-Values)
48%
Θ
☐
Х
田
الحا
Capture3.PNG
File Edit Program Appearance Window Tools Help
合區
·造
☐
☑
Capture4.PNG
Smalles index
B
Θ
PrintArray
(Integer Array Values, Integer num)
Integer i
Output "PrintArray Execute/
Next
1-010-1
Dene
Smalestindex
(Integer Array Values Integer
Integer INDEX
INDEX-0
Next
1-0 to Num-1
Dene
Output Values/
False
Values(NDEX-Values
Return Integer INDEX
☐
ㅁ
INDEX-i
Capture5.PNG
File Edit Program
Appearance Window
門
-
Capture6.PNG
☑
File Edit Program Appearance Window Tools Help
合區
Swap
目
Θ
Swap
Integer Temp
Temp = Values[Index]
Valuesindex1] Values[Index]
Valuesindex2] Temp
PrintArray(Values, Size)
End
Swap
Integer Temp
Temp Values ndex]
Values[index] Values
Variable Not Declared
☐
☐
Х
About:
Before you can store or read data from a variable, it must first be declared.
Cause:
The variable 'Temp' was not declared
Transcribed Image Text:Capture1.PNG @ 8 Q Q Capture2.PNG Edt Program Appearance 門 目 Tools Help Larges index 8 Integer Smalestindex Temp Values (Values Th Output "The index of the largest Largester LargestIndex (Integer Array Values Integer) Integer NDEX NDEX- 1-01-1 Return Integer NDEX Values NDEX-Values) 48% Θ ☐ Х 田 الحا Capture3.PNG File Edit Program Appearance Window Tools Help 合區 ·造 ☐ ☑ Capture4.PNG Smalles index B Θ PrintArray (Integer Array Values, Integer num) Integer i Output "PrintArray Execute/ Next 1-010-1 Dene Smalestindex (Integer Array Values Integer Integer INDEX INDEX-0 Next 1-0 to Num-1 Dene Output Values/ False Values(NDEX-Values Return Integer INDEX ☐ ㅁ INDEX-i Capture5.PNG File Edit Program Appearance Window 門 - Capture6.PNG ☑ File Edit Program Appearance Window Tools Help 合區 Swap 目 Θ Swap Integer Temp Temp = Values[Index] Valuesindex1] Values[Index] Valuesindex2] Temp PrintArray(Values, Size) End Swap Integer Temp Temp Values ndex] Values[index] Values Variable Not Declared ☐ ☐ Х About: Before you can store or read data from a variable, it must first be declared. Cause: The variable 'Temp' was not declared
Steps:
-Define a function PrintArray that takes an array and its size and prints the values stored in the array.
The function does not return anything.
-Use the function Index, as an example, to define:
- A function MaxValueIndex that takes an array and its size and returns the index(position) of the largest
element (greatest value) in the array.
-A function MinValueIndex that takes an array and its size and returns the index (position) of the
smallest element in the array.
-Write a function Swap that takes an array, its size and the indexes of two elements and swap their
values.
Call the function PrintArray from within Swap to print the array after swapping.
Transcribed Image Text:Steps: -Define a function PrintArray that takes an array and its size and prints the values stored in the array. The function does not return anything. -Use the function Index, as an example, to define: - A function MaxValueIndex that takes an array and its size and returns the index(position) of the largest element (greatest value) in the array. -A function MinValueIndex that takes an array and its size and returns the index (position) of the smallest element in the array. -Write a function Swap that takes an array, its size and the indexes of two elements and swap their values. Call the function PrintArray from within Swap to print the array after swapping.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education