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
Ira Lisetskai [31]
3 years ago
11

True/False: If a function is legally prototyped to return an integer value, it can return a structure member that is an integer

data type.
Computers and Technology
1 answer:
sdas [7]3 years ago
5 0
#1) If a function is legally prototyped to return an integer value, it can return a structure member that is an integer data type.
Answer: True. Any method that is not declared void must contain a return statement with a corresponding return value. The data type of the return value must match the method's declared return type; you can't return an integer value from a method declared to return a boolean.
You might be interested in
(5 points) Create a user-defined data structure (i.e., struct) called Point that represents a two-dimensional Cartesian coordina
Harlamova29_29 [7]

Answer:

Here is the C++ program:

#include<iostream>  //to use input output functions

#include <math.h>  //to use sqrt and pow function

#include<iomanip>  //to use setprecision

using namespace std;   //to identify objects cin cout

struct Point  {  // structure name

float x,y;  // member variables

};  

float calculateDistance (Point a, Point b)  {  //function that that takes two parameters of type Point

float distance;  //stores the distance between two points

distance=sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));  //formula to compute distance between two points

return distance;  }  //returns the computed distance

int main()  {  //start of main function

Point p1,p2;  //creates objects of Point

cout<<"Enter point 1 coordinates: "<<endl;  //prompts user to enter the value for coordinates of first point

cin>>p1.x;  //reads input value of x coordinate of point 1 (p1)

cin>>p1.y;  //reads y coordinate of point 1 (p1)

cout<<"Enter point 2 coordinates: "<<endl;  //prompts user to enter the value for coordinates of second point

cin>>p2.x;  //reads input value of x coordinate of point 2 (p2)

cin>>p2.y;  //reads y coordinate of point 2 (p2)

cout<<"The distance between two points is "<<fixed<<setprecision(2)<<calculateDistance(p1,p2);} //calls function by passing p1 and p2 to compute the distance between p1 and p2 and display the result (distance) up to 2 decimal places

Explanation:

The program has a structure named Point that represents a two-dimensional Cartesian coordinate (x, y). The member variables of this struct are x and y, which are both floating-point values. A function called calculateDistance takes two parameters, a and b of type Pointer and returns the distance between the two given points using formula:

\sqrt{(x_{2}-x_{1} )^{2} +(y_{2}-y_{1} )^{2}  }

It uses pow function to compute the power of 2 and sqrt function to compute the square root.

Then in main() method the program prompts the user to enter coordinates for two points and calls calculateDistance method to compute the distance between two points and display the result up to 2 decimal places using setprecision(2).

The program along with the output is attached in a screenshot.

6 0
3 years ago
(true or false) One of the difficult things about working in game design is that while there are many different roles, most of t
patriot [66]
Tbh I think it’s False because most of them don’t match
8 0
3 years ago
Read 2 more answers
Assume that name is a variable of type string that has been assigned a value . write an expression whose value is the first char
4vir4ik [10]

For the first question, you would just add the parenthesis to the string mutation1:

String word = "sadly";

String mutation1 = "(" + word + ")";

For the second you need the method substring from the String class:

It is defined as String.substring(begining, ending);

String name = "Smith";

String firstCharacter = name.substring(0, 1);

0 is considered the beginning of the string, then you get the next 1 characters.

7 0
3 years ago
IF ANSWER I WILL BE REALLY HAPPY
butalik [34]

Answer:

C.

Explanation:

7 0
3 years ago
Read 2 more answers
A web application starts when a client sends _______ to a server?
vovangra [49]
A web application starts when a client sends a request to a server
6 0
3 years ago
Other questions:
  • A block level element begins on a new line and some space is usually added before and after it - True or False?
    13·1 answer
  • What is the output of the following program segment? int main() { int num = 5; cout &lt;&lt; num &lt;&lt;" "; change(num); cout
    8·1 answer
  • In this​ video, Samir describes how business executives use a BI application to drill down and see​ _____ data, the detail in th
    7·1 answer
  • If an individual receives 1.8 mGy while standing 4 ft from a source of radiation for 2 minutes, which of the following option(s)
    9·1 answer
  • True or False. A geosynchronous satellite changes its area in the sky each day.
    5·2 answers
  • Difference between second and third generation of computer<br>​
    14·1 answer
  • Ismael is examining a report in Access. He needs to access a view that will be used to examine and change the structure of the r
    9·2 answers
  • How to add a legend to a graph in excel?
    7·2 answers
  • Select the correct term to complete the sentence.
    8·1 answer
  • AUPs ensure that an organization’s network and internet are not abused. Select 3 options that describe AUPs.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!