Question

CHALLENGE ACTIVITY 6.5.3: Calling functions. > Jump to level 1 - > Write code that assigns resultinches with the value returnCHALLENGE ACTIVITY 6.5.4: Defining functions. Jump to level 1 Write code in GetRecArea that assigns recArea with the multipliCHALLENGE ACTIVITY 6.6.2: Writing functions with array parameters. Jump to level 1 D 0-0-00 Write code that calls the PutBarsuse coral language please

question 1

Function ConvertFeetToInches(integer feetToConvert) returns integer resultInches
resultInches = feetToConvert * 12

Function Main() returns nothing
integer resultInches
integer feetToConvert

feetToConvert = Get next input

// Your solution goes here

Put feetToConvert to output
Put " feet are " to output
Put resultInches to output
Put " inches." to output

question 2

Function GetRecArea(float recHeight, float recWidth) returns float recArea

// Calculate recArea:
recArea = 0


Function Main() returns nothing
float userHeight
float userWidth

userHeight = Get next input
userWidth = Get next input

Put GetRecArea(userHeight, userWidth) to output

question 3

Function PutBars(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) userNums
integer i

for i = 0; i < userNums.size; i = i + 1
userNums[i] = Get next input

// Your solution goes here

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Soltion:

Q1:

 Function ConvertFeetToInches(integer feetToConvert) returns integer resultInches resultInches = feetToConvert * 12 Function Main() returns nothing integer resultInches integer feetToConvert feetToConvert = Get next input // Your solution goes here resultInches = ConvertFeetToInches (feetToConvert) Put feetToConvert to output Put " feet are " to output Put resultInches to output Put " inches." to output

Q2:

 Function GetRecArea(float recHeight, float recWidth) returns float recArea // Calculate recArea: recArea = 0 recArea = recHeight * recWidth Function Main() returns nothing float userHeight float userWidth userHeight = Get next input userWidth = Get next input Put GetRecArea(userHeight, userWidth) to output

Q3:

 Function PutBars(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) userNums integer i for i = 0; i < userNums.size; i = i + 1 userNums[i] = Get next input // Your solution goes here PutBars(userNums)
Add a comment
Know the answer?
Add Answer to:
use coral language please question 1 Function ConvertFeetToInches(integer feetToConvert) returns integer resultInches resultInches = feetToConvert *...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please use python 3 programming language Write a function that gets a string representing a file...

    Please use python 3 programming language Write a function that gets a string representing a file name and a list. The function writes the content of the list to the file. Each item in the list is written on one line. Name the function WriteList. If all goes well the function returns true, otherwise it returns false. Write another function, RandomRange that takes an integer then it returns a list of length n, where n is an integer passed as...

  • Given an array of integer, please complete a function multiply(). The function accepts the first memory...

    Given an array of integer, please complete a function multiply(). The function accepts the first memory address of an array and the size of an array as parameters and returns the multiplication of all the elements. In order to get a full score, the function must use a loop to iterate through each element of an array. Pseudo code example:   multiply([ 1, 2, 3], 3) → 6   multiply([1, 1, 4 ,2], 4) → 8   multiply([7, 0, 0, 7, 0, 7],...

  • Finish the MARIE assembly language code below to determine the largest integer, the smallest integer, and...

    Finish the MARIE assembly language code below to determine the largest integer, the smallest integer, and the sum of integers for a sequence of 5 signed integers. The program already calculates the largest integer, just need it to calculate the smallest integer and the sum of the integers. The 5 integers should first be entered by the user via the input device. Your program is then assembled and run to determine the largest integer, the smallest integer, and the sum...

  • C++ please use only easy code and stdio.h because im just a beginner Description Write the...

    C++ please use only easy code and stdio.h because im just a beginner Description Write the program that can manage the information of students as follows: S 1. This program has two phase; the input phase and the output phase. 2. In an input phase, a teacher inputs the information (name, score, and department) for each student. The total number of students who can be inputted should be defined as a NUM OF_STUDENT constant value. In this example, the value...

  • I ONLY NEED A FLOWCHART [USE A LOOP], NO CODE PLEASE. PLEASE IF YOU DON'T KNOW...

    I ONLY NEED A FLOWCHART [USE A LOOP], NO CODE PLEASE. PLEASE IF YOU DON'T KNOW THE ANSWER DON'T JUST PUT WHATERVER HERE DRAW A FLOWCHART for a program that executes the following equation: f[i] = s *(z2[i] + z[i] +r) where N < 64, z is an input array of N elements, s = 0.25, and r is an integer constant.

  • LOGIC TUI Computer Program CHALLENGE ACTIVITY 2.9.2: Code basics See Coral: Code basics for solution help....

    LOGIC TUI Computer Program CHALLENGE ACTIVITY 2.9.2: Code basics See Coral: Code basics for solution help. Jump to level 1 Write code that outputs: A3 G7 TOUS: Home 3.6. Variables/Assignments: Driving costs My library > PRG 211: Algorithms & Logic for Computer Programming home > 6: Variables/Assignments: Driving costs zyBooks catalog He Start Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles,...

  • if it is possible help me with the code in C language and I could learn...

    if it is possible help me with the code in C language and I could learn it, thanks ! Write a function that computes the integer mean of an array of integers. For example, the integer mean of -1, 4, 2 is (-1 + 4 + 2)/3 = 5/3 = 1, where/des integer division. The function should implement the following specification:/* Computes the integer mean of an array and stores it * where mn references. Returns -1 for erroneous input...

  • Using C++ Question#1: isPalíndrome Write the following function: bool isPalindrome(int) takes an integer and returns true...

    Using C++ Question#1: isPalíndrome Write the following function: bool isPalindrome(int) takes an integer and returns true if that integer is palindrome, otherwise it returns false. The function also prints the digits of the integer in reverse order in which they were found. Write a main) function that reads an integer, calls the function is whether the integer is a palindrome or not. Palindrome), and prints Sample input/output: nter an integer: 23434 nter an integer 23432 3434 is not a palindrome...

  • 1. Write code for a function that receives two parameters (a,and b) by value and two...

    1. Write code for a function that receives two parameters (a,and b) by value and two more parameters (c and d) by reference. All parameters are double. The function works by assigning c to (a/b) and assigning d to (a*b). The function has no return value. From main, use scanf to get two numbers, then call the function, and then display both outcome values to the output in a printf statement. 2. After part 1 is completed, write code to...

  • Please upload screenshots of the code. Thank you! P1 - Circle Area and Circumference functions.cpp, functions.h,...

    Please upload screenshots of the code. Thank you! P1 - Circle Area and Circumference functions.cpp, functions.h, P1.cpp The user enters 3 floating-pointer numbers which correspond to 3 radi. Store these numbers in an array. Then, define and prototype a function void area and cireffloat* area, float circumference, float array) which takes as input the array of circumferences of circles with the input radii. Think about why we need to pass pointers for both the area and the circumference variables. radii...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT