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.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter6: Using Arrays
Section: Chapter Questions
Problem 5E
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
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning