
Concept explainers
// main module
Function main()
// Local variables
Declare numbers[] // declare array & initialize
Declare high =0
Declare low=0
Declare average=0
Declare total=0
// Get numbers
For index = 0 to 5 // 5 for testing purposes
Display “Enter number : “
Input numbers[index]
End For
// Get statistics
For index = 0 to 5
If index == 0 Then
Set high = numbers [index]
Set low = numbers [index]
End If
If high < numbers [index] Then
Set high = numbers [index]
End If
If low > numbers [index] Then
Set low = numbers [index]
End If
Set total = total + numbers [index]
End For
Set average = total/(index + 1)
// multiple ways of executing line above
// Show statistics
Call showStats(high, low, total, average)
End Function main()
// The showStats module shows high, low, average number
Function showStats(Integer high, low, total, average)
Display “High number is: ”, high
Display “Low number is: ”, low
Display “Total of numbers is: ”, total
Display “Average of numbers is: ”, average
End Function showstats()
finish the pseudocode

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 2 images

- C++ Use 2 D arrays String and float Make simplearrow_forwardc++ language using addition, not get_sum function with this pseudocode: Function Main Declare Integer Array ages [ ] Declare integer total assign numbers = [ ] assign total = sum(ages) output "Sum: " & total end fucntion sum(Integer Array array) declare integer total declare integer index assign total = 0 for index = 0 to size(array) -1 assign total = total + array[ ] end return integer totalarrow_forwardCreate Array of Random Dates In this task you are required to write a function that will generate a column array (a variable called dates) containing N random dates. N is an integer (whole number) entered by the user and will indicate to the function how many random dates the user requires. The dates array will be structured as follows: • The array shall have two columns; column 1 will contain numbers indicating the day of each month (1-31) and column 2 will contain numbers indicating the month (Jan 1, Feb=2, Mar = 3.... Dec = 12). . Each day must be randomly generated (using the randi() function) taking into account the maximum number of days in each month (i.e. Jan, Mar, May, Jul, Aug. Oct and Dec have 31 days, Apr. Jun, Sep and Nov have 30 days and Feb will have 28 days). You must use an if-elseif-else statement to decide this. • We are assuming no leap years (e. February can only have days between 1-28). For example, the output from calling the function: output = dategen (3) could…arrow_forward
- C++ Coding: ArraysTrue and False Code function definitions for eoNum() and output(): Both eoNum() and output() are recursive functions. output() stores the even/odd value in an array. Store 0 if the element in the data array is even and store 1 if the element in the data array is odd. eoNum() displays all the values in an array to the console.arrow_forwardc++ code Screenshot and code is mustarrow_forwardSorted Names Problem Assume that you already have the bubbleSort () and the svap() modules. Use pseudocode to design the main() program that allows the user to enter 20 names into a String array. Sort the array in ascending (alphabetical) order and display its contents. // The bubbleSort module accepts an array of Strings and array size // and sorts array in ascending order Module bubbleSort(String Ref array[], integer arraySize) Declare Integer index1, index2 // bubblesort scores For index1 = arraySize – 1 to 0 Step -1 For index2 = 0 to index1 – 1 If array[index2] > array[index2 + 1] Then Call swapS(array[index2], array[index2 + 1) End If End For End For End Module // The swapS module accepts two String elements and swaps their contents Module swapS(String ref a, String ref b) Declare String temp // Swap a and b Set temp = a Set a = b Set b = temp End Modulearrow_forward
- Visual basic 6.0arrow_forwardWhat should a programmer be especially aware of when programming with arrays? Syntax errors If-then-else statements Modularization Using an Out of Bounds array subscriptarrow_forwardC++ Coding: Arrays Implement a two-dimensional character array. Use a nested loop to store a 12x6 flag. 5 x 2 stars as * Alternate = and – to represent stripe colors Use a nested loop to output the character array to the console.arrow_forward
- C++ Array Expander -Just do everything in main and make sure you comment each step Use Pointer Notation for the function and within the function. Use a main function and return the pointer from the ArrayExpander function to mainarrow_forwardSubmerging is the phenomenon wherein the pointer vanishes when you move it too quickly.arrow_forwardFYI: Please write the code in Pseudocode (no programming language please) 1. Write a pseudocode that outputs the contents of parallel arrays. You do NOT have to write the entire program. The first array will hold phone numbers The second array will hold company names You do NOT need to load the arrays. Your code can assume they are already loaded with data. arrays are named phone[] and company[]arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





