
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Can anyone help me with these coding questions please

Transcribed Image Text:# Functions with Value Parameters
Use program **BoxesWithFunction** for Exercises 3-4. Program **BoxesWithFunction** is the shell of a program that prompts the user to enter an integer number. When completed, this number is read and passed to function Print as parameter `numSigns`. The function prints a box of dollar signs on the screen that is `numSigns` by `(numSigns / 2)` in dimension. For example, if `numSigns` is 10, the following box is printed on the screen:
```
$$$$$$$$$$
$ $
$ $
$$$$$$$$$$
```
Note the interior dimensions are `(numSigns – 2)` by `(numSigns / 2 – 2)`.
```cpp
// Program BoxesWithFunction prompts for the number of dollar signs
// for the top of the box. That number / 2 - 2 lines are
// printed with dollar signs on the sides.
#include <iostream>
using namespace std;
void Print(int numSigns);
int main ()
{
int number;
cout << "Enter the number of dollar signs for the top; "
<< "press return.";
cout << "Enter a negative number to quit."<endl;
cin >> number;
while (number>=0)
{
/* FILL IN call to Print */
cout << "Enter the number of dollar signs for the top; "
<< "press return.";
cout << "Enter a negative number to quit."<endl;
cin >> number;
}
return 0;
}
//*****************************************************
void Print(int numSigns)
// FILL IN documentation.
{
/* FILL IN code to print numSigns $'s */
/* FILL IN code to print (numSigns / 2) -2 lines with */
/* $'s lining up under the left-most and right-most */
/* $ ones on the top line. */
/* FILL IN code to print numSigns $'s */
}
```
## Exercise 3
Fill in the missing code in function `Print` and the invoking statement in function `main`. Compile and run your program using 4, 10, and 7 as input data. Don’t forget to fill in documentation for the function.
## Exercise 4
Rewrite your solution to Exercise 3 so that the symbol used as the border is also read as data and passed to function `Print` as
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 4 images

Knowledge Booster
Similar questions
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education