Concept explainers
// main module
Module main()
// Local variables
Declare Integer number
// Get number
Call getNumber(number)
// display Roman numeral
Select number
Case 1:
Display “I”
Case 2:
Display “II”
Case 3:
Display “III”
Case 4:
Display “IV”
Case 5:
Display “V”
Case 6:
Display “VI”
Case 7:
Display “VII”
Case 8:
Display “VIII”
Case 9:
Display “IX”
Case 10:
Display “X”
Default:
Display “Error: Invalid Number”
End Select
End Module
// The getNumber module gets wall space and stores it
// in the number reference variable.
Module getNumber (Integer Ref number)
Display “Enter an integer from 1 to 10: ”
Input number
End Module
I want flowchart and pseudocode please
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 4 images
- Module main() // Local variables Constant Integer SIZE = 18 Declare Integer numbers[SIZE] = 5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 8080152, 4562555, 5552012, 5050552, 7825877, 1250255, 1005231, 6545231, 3852085, 7576651, 7881200, 4581002 Declare Integer inputNumber, found = 0 // Get number Display “Enter number to validate: “ Input inputNumber // Validate number For index = 0 to SIZE – 1 If inputNumber == numbers[index] Then Set found = 1 Set index = SIZE End If End For // Show if valid If found == 1 Then Display “Number is valid.” Else Display “Number is not valid.” End If End Module Flowchart pleasearrow_forwardTrue or False In C#, there are three types of comments: line comments, block comments, and documentation comments.arrow_forwardA 3x3 design means that there are 3 ____ variables to be considered.arrow_forward
- The parameter option to use when the module that the variable is to be shared with is to have its own copy of the variable ByVal ByRef This is Always Done Can’t be Donearrow_forwardChoose below any component that a variable has : value Opointer Cidentifier/name address memory type statementarrow_forwardModule main() // Local variables Declare Integer gramsFat, calories // Get fat grams Set gramsFat = getFat() // Get calories Set calories = getCalories(gramsFat) // Show percent calories from fat Call showPercent(gramsFat, calories) End Module // The getFat function gets grams of fat Function Integer getFat () Declare Integer inputAmount // enter count Display “Enter grams of fat: “ Input inputAmount // validate rate While inputAmount < 0 Display “Quantity must not be less than 0!” Display “Enter a valid quantity.” Input inputAmount End While return inputAmount End Function // The getCalories function gets number of calories Function Integer getCalories(gramsFat) Declare Integer inputAmount, maxCalories Set maxCalories = gramsFat * 9 // enter count Display “Enter number of calories: “…arrow_forward
- Module main() // Local variables Declare Real width, length, area // Get the rectangle's width and length. getRectangleSides(width, length) // Get the rectangle's area. Set area = calcArea(width, length) // Display the area. Display "The rectangle's area is ", areaEnd Module// The getRectangleSides module prompts the user for// a rectangle's width and length. The values are// stored in the reference parameters.Module getRectangleSides(Real Ref width, Real Ref length) // Get the rectangle's width. Display "Enter the rectangle's width." Input width // Get the rectangle's length. Display "Enter the rectangle's length." Input lengthEnd Module// The calcArea function accepts a rectangle's// width and length as arguments, and returns// the rectangle's area.Function Real calcArea(Real width, Real length) Return width * lengthEnd Function flowchart pleasearrow_forwardA module can contain one or more definitions of other modules. Select one: OTrue OFalsearrow_forwardModule main() // Local variables Declare Real budget, spent = 0, amount // Get budgeted amount Call getBudget(budget) // Get amount spent Call getAmount(spent) // display values Call showSpending(budget, spent) End Module // The getBudget module gets amount budgeted for the month Module getBudget(Real Ref inputBudget) Display “Enter amount budgeted for the month: “ Input inputBudget End Module // The getAmount module gets amounts actually spent // terminates on entry of amount = 0 Module getAmount(Real Ref spent) Declare Real inputAmount Do Display “Enter an amount spent: “ Input inputAmount Set spent = spent + inputAmount Until inputAmount == 0 End Module // The showSpending module accepts budget and spent and tells // if over or under budget Module showSpending(Real budget, spent) Display "Budgeted: $", budget Display "Spent: $", spent If budget > spent then Display "Spending less than budget. VERY GOOD!” Else…arrow_forward
- Module main() // Local variables Declare Integer feet // Get feet Call getFeet(feet) // display inches Call showInches(feet) End Module // The getFeet mount module gets number of feet Module getFeet(Integer Ref inputFeet) Display “Enter number of feet: “ Input inputFeet End Module // The showInches module displays feet to inches Module showInches(Integer feet) Declare Integer inches Set inches = calcInches(feet) Display "Feet to inches: ", inches End Module // The calcInches function accepts feet and returns inches. Function Integer calcInches(Integer feet) Declare Integer result Set result = feet * 12 Return result End Function flowchart for this pleasearrow_forwardC language only Part 3. firstname Program 3 would print out your first name which is passed in as an argument on the command line in mixed case. This would go to the screen. Usage would be: firstname yourfirstnamearrow_forwardModule main() // Local variables Constant Integer SIZE = 12 Declare String month[SIZE] = “January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December” Declare Integer rain[SIZE], index, high, low, average, total = 0 // Get monthly rainfall For index = 0 to SIZE - 1 Display “Enter rainfall for “, month[index], “: “ Input rain[index] End For // Get statistics For index = 0 to SIZE – 1 Set total = total + rain[index] If index == 0 Then Set high = rain[index] Set low = rain[index] End If If high < rain[index] Then Set high = rain[index] End If If low > rain[index] Then Set low = rain[index] End If End For Set average = total / SIZE // Show statistics Call showStats(high, low, total, average) End Module // The showStats module shows high, low, average rainfall Module showStats(Integer high, low, total,…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education