Write code that calls the PutGraph function, passing dataList as an argument. Function PutGraph(integer array(?) dataRows) returns
Fantastic news! We've Found the answer you've been seeking!
Question:
- Write code that calls the PutGraph function, passing dataList as an argument.
Function PutGraph(integer array(?) dataRows) returns nothing
integer i
integer numStars
for i = 0; i < dataRows.size; i = i + 1
for numStars = 0; numStars < dataRows[i]; numStars = numStars + 1
Put "*" to output
Put "\n" to output
Function Main() returns nothing
integer array(3) dataList
integer i
for i = 0; i < dataList.size; i = i + 1
dataList[i] = Get next input
// Your solution goes here
2. Type the programs output
Function OutVs(integer array(?) vs, integer x) returns nothing
integer i
integer newScore
for i = 0; i < vs.size; i = i + 1
newScore = vs[i] + x
Put newScore to output
Put " " to output
Function Main() returns nothing
integer array(3) examScores
integer addPoints
examScores[0] = 31
examScores[1] = 27
examScores[2] = 34
addPoints = 2
OutVs(examScores, addPoints)
3. Write statement that calls the function PrintStudentAge.
Function PrintStudentAge() returns nothing
integer studentAge
studentAge = Get next input
Put "He is " to output
Put studentAge to output
Put " years old." to output
Function Main() returns nothing
Put "Student: " to output
// Your solution goes here
4. Write code in the function PutGreeting that puts "This is awesome!" to output.
Function PutGreeting() returns nothing
Put "Greeting: " to output
// Your solution goes here
Function Main() returns nothing
PutGreeting()
everything in coral please!
Related Book For
Discrete and Combinatorial Mathematics An Applied Introduction
ISBN: 978-0201726343
5th edition
Authors: Ralph P. Grimaldi
Posted Date: