1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
umka21 [38]
3 years ago
13

4. Compose a C function named getSpeed that uses a reference parameter variable named speed to accept an integer argument. The f

unction should prompt the user to enter a number in the range of 20 through 70. Set the parameter variable to zero if the user enters a number outside the range of 20 through 70.
Computers and Technology
1 answer:
Pachacha [2.7K]3 years ago
6 0

Answer:

void getSpeed(int& speed)  

//the function with reference parameter speed and & denote a reference

{  //prompts user to enter a number

 cout << "Enter a number in the range of 20 through 70: ";

 cin >> speed;  //reads the value entered by user

 if(speed < 20 || speed> 70)  

// if value of speed entered by user is outside the given range

 {

   speed = 0;  // speed is set to 0

 } }

Explanation:

In order to check how this function works you can write a main function and print the value of speed as following:

int main()

{ int speed;

   getSpeed(speed); //calls getSpeed function

   cout<<"speed is "<<speed; } //displays value of speed

Output:

Enter a number in the range of 20 through 70: 50

speed is 50

Output for if condition:

Enter a number in the range of 20 through 70: 80

speed is 0

You might be interested in
What are characteristics of the Advanced Calendar options in Outlook? Check all that apply.
anzhelika [568]

Answer:

Free/busy settings can be enabled.

One extra time zone can be created.

Display and theme settings can be changed.

Options are accessed through the Backstage view.

Explanation:

Just took it

7 0
4 years ago
Suppose we wish to put a set of names in alphabetical order. We call the act of doing so sorting. One algorithm that can accompl
Sergeeva-Olga [200]

Answer:

See explaination

Explanation:

We refer to a compiler as a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses. Typically, a programmer writes language statements in a language such as Pascal or C one line at a time using an editor.

Please kindly check attachment for the step by step solution

3 0
3 years ago
Now let's create a memo. The memo should include all parts of a memo, and these parts should appear in the correct order. In you
netineya [11]

Answer:

MEMORANDUM

TO: Stacy Shoe, Allen Sock, and Emma Johnson.

FROM: Department of Information

DATE: 20th of December, 2019

SUBJECT: Computer Operations

The following is an illustration of how to start a computer and how to open an existing word processing document. For clarity and ease of understanding, this will be divided into two subheadings. All questions should be directed to the department of information.

START A COMPUTER

Step 1: Press the start button on the CPU tower.

Step 2: Wait while the computer boots. When the computer has finished booting, it will show a dialogue box that will ask for a user name and password.

Step 3: Enter your user name and password, then click

"OK."

Step 4: Your computer is now ready to use.

OPENING A WORD PROCESSING DOCUMENT

To open any word processing documents, you can use any of the options below.

1. Double-click file

In some cases, you can double-click a file to open it in Microsoft Word. However, the file will only open in Microsoft Word if that file type is associated with Microsoft Word. Word documents, like .doc and .docx files, are associated with Microsoft Word by default. However, web page files, text, and rich text format files are often not associated with Word by default, so double-clicking on these files may open in another program.

2. Right-click file and select program

For any file, you can choose the program to open a file with, including Microsoft Word.

Step 1: Right-click the file you want to open.

Step 2: In the pop-up menu, select the Open with option.

Step 3: If available, choose the Microsoft Word program option in the Open with menu. If Microsoft Word is not listed, select the Choose other app or Choose default program option, depending on the

Step 4: In the window that opens, find Microsoft Word in the program list and select that option. Microsoft Word should open and the file opened within Word.

3. Open within Microsoft Word

Follow the steps below to open a file from within Microsoft Word.

Step 1: Open the Microsoft Word program.

Step 2: Click the File tab on the Ribbon and click the Open option.

Step 3: If the Open window does not appear, click the Browse option to open that window.

Step 4: In the Open window, find and select the file you want to open in Microsoft Word. You may need to click the drop-down list next to the File name text field to change the file type to that of the file you want to select and open.

Step 5: Click the Open button at the bottom right of the Open window.

As stated above, all questions are to be directed to the department of information.

Thanks.

Explanation:

5 0
3 years ago
A field whose data type is ____ can store text that can be used as a hyperlink address
olya-2409 [2.1K]
A field whose data type is URL address data can store text that can be used as a hyperlink address.
8 0
4 years ago
If an occupation is projected to decline by 7% over the next 10 years, how would you rate the job outlook?
Helen [10]
Steady sounds like the best answer but that’s tough
5 0
3 years ago
Other questions:
  • When a dynamic array with a class for a base type is declared, which constructor is called?
    5·1 answer
  • 13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
    15·1 answer
  • Which of the following is NOT essential for individuals to have to build their own web page?
    9·1 answer
  • Operational feasibility, which refers to user acceptance and support, as well as management acceptance and support, is also know
    9·1 answer
  • A number of LC-3 instructions have an "evaluate address" step in the instruction cycle, in which a 16-bit address is constructed
    6·1 answer
  • If Asa changes the text to bold, he has changed the style. True False
    8·2 answers
  • You are given the task of reading in n numbers and then printing them out in sorted order. Suppose you have access to a balanced
    12·1 answer
  • Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, y
    14·1 answer
  • Help me pls, thank you
    12·2 answers
  • Activity 1.1.4 What is Technology?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!