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
alisha [4.7K]
4 years ago
6

Define a function setheight, with int parameters feetval and inchesval, that returns a struct of type heightftin. the function s

hould assign heightftin's data member feet with feetval and inches with inchesval.
Computers and Technology
1 answer:
devlian [24]4 years ago
4 0

It is given that the feetVal and inchesVal are parameters of the SetHeight() function. Since the return type of the function is structute, so we need to define a structure.

After that, we need to create a structure variable within the function definition. Now, assign the feet and inches with the feetVal and inchesVal respectively. Finally return the structure variable.

Further explanation:

#include<stdio.h>

//define the structure

typedef struct HeightFtIn_struct {

int feet;

int inches;

} HeightFtIn;

//define the function

HeightFtIn SetHeight(int feetVal, int inchesVal)

{

HeightFtIn Htft; //creating a structure variable of type HeightFtIn

//assign the value of feetVal

Htft.feet = feetVal;  

Htft.inches = inchesVal; //assigning the value of inchesval

//return the structure variable

return Htft;

}

int main(void) {

HeightFtIn studentHeight;

int feet;

 int inches;

printf("Enter the values of feet and the inches: ");

scanf("%d %d", &feet, &inches);

studentHeight = SetHeight(feet, inches);

printf("The student's height is %d feet and %d inches.\n", studentHeight.feet, studentHeight.inches);

return 0;

}

Output:

Enter the values of feet and the inches: 5 9

The student's height is 5 feet and 9 inches.

Learn more:

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011  

2. How does coding work on computers?  brainly.com/question/2257971 

Answer details:

Grade: College Engineering

Subject: Computer Science

Chapter: C  Programming

Keyword:

C++, input, output, programming, statements,  loops, if, else, statements, firstname, lastname, base class, derive class, vector, print

You might be interested in
Derek has an interest in designing video games. What requirements should he fulfill to be a game designer? To be a game designer
4vir4ik [10]

Answer:

2. Marketing, communication or advertising

Explanation:

5 0
3 years ago
Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
slavikrds [6]

Answer:

Here are the for loop for the given question.

 for (i = 0; i < NUM_VALS; i++)  // for loop

       {

         /* check if the value of i is equal to NUM_VALS or not.If it is

         equal then just print the value without comma.*/

       if(i==(NUM_VALS-1))  // if block

       System.out.print(hourlyTemp[i]);

  /* if i is not equal then just print the value with comma.*/

       else   // else block

       System.out.print(hourlyTemp[i] + ", ");

       }

Explanation:

In this we iterating the for loop  and check the condition

check if the value of i is equal to NUM_VALS or not.If it is  equal then just print the value without comma

If i is not equal then just print the value with comma .

Output:

90,92,94,95

3 0
3 years ago
_________values are stored as the number of seconds since the unix epoch (35 POINTS)
Nataly_w [17]

Answer:

he Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).

Explanation:

The answer above is from a secure website

3 0
3 years ago
What is stand-alone LDAP server?
FinnZ [79.3K]

Answer:

A stand-alone LDAP server is defined as to remove the load from a server that does multi function tasks. It is more efficient when we use one or more LDAP configurations .

Light weight Directory Access Protocol (LDAP) is a client and server protocol used for accessing directory data. It  helps in reading and editing the directories over IP networks and runs directly over Transmission control protocol and internet protocol used simple string format for transferring of data.

8 0
3 years ago
Two employees are unable to access any websites on the internet, but can still access servers on the local network, including th
Reika [66]

Answer:

In the Internet Options, define the name of the proxy server and the port number.

Explanation:

If the two staff  in the company are unable to reach the websites on the internet also  they are  able to access servers on the local area network also the Other staff members don't encounter the problem and they have to face the same problem because they do not define the name of the proxy server and the port number in the internet option.

If they do not define the proxy server and the post they have not accessing the website so to able the accessing it must properly define the proxy server and the port number.

6 0
3 years ago
Other questions:
  • How do you mark somebody the brainliest?
    14·2 answers
  • 1. How do you answer questions that require you to draw inferences? (1 point)
    7·2 answers
  • In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.
    8·1 answer
  • The Color Picker tool enables you to work with color selections. Which of the following color models are used by the Color Picke
    11·1 answer
  • In apersuasive message, opposing ideas should be:
    13·1 answer
  • A successful web-based strategy that helps a business spread the word about its website and products is called:
    15·1 answer
  • Given the following class: Create a class MyGenerator that can be used in the below main method.
    8·1 answer
  • Describing Report Viewing
    5·1 answer
  • ((Excel)) please help, 100 points, and brain crown thingy, not only that, i will make several of these so you can get several hu
    12·1 answer
  • ____ takes care of the transport between machines. but it is unreliable, and there is no guarantee that any given packet will ar
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!