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]
3 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]3 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
The association between a UCS and a CS can be extended to include more stimuli (more stimuli related to the CS can elicit the CR
almond37 [142]

Answer:

The answer is Stimulus generalization

Explanation:

Stimulus generalization is an example of classical condition. Classical conditioning takes a stimulus that does not cause a particular response (neutral stimulus) and then pairs it repeatedly with an unconditioned stimulus that will cause an unconditioned response. In the case of Stimulus generalization, I will give an example of a subject presenting food to a dog once they ring a bell. Lets say that you have taught a dog to salivate every time it hears a bell ring. If you took another bell that has a similar sound and rang it, the dog would still salivate and come pick its food. This is a perfect example of Stimulus generalization. The dog has responded to a new stimulus as if it was the initial conditioned stimulus.

5 0
3 years ago
Select the correct answer.
Dvinal [7]

Answer:

A

Explanation:

because when you make a presentation so you are already use technology

4 0
3 years ago
Mike needs to write the primary objectives of a project in a project plan. In which section should he write them?
Advocard [28]

Mike needs to write the primary objectives of a project in a project plan. He should write this under the SCOPE section of the project plan.

Explanation:

  • Project scope is the part of project planning that involves determining and documenting a list of specific project goals, deliverables, features, functions, tasks, deadlines, and ultimately costs.
  • It is what needs to be achieved and the work that must be done to deliver a project.
  • The Scope of Work (SOW) is the area in an agreement where the work to be performed is described.
  • The SOW should contain any milestones, reports, deliverables, and end products that are expected to be provided by the performing party. The SOW should also contain a time line for all deliverables.
  • The scope is simply all the work that needs to be done in order to achieve a projects objectives.
  • A project scope, or project scope statement, is a tool used to describe the major deliverables of a project including the key milestones, high level requirements, assumptions, and constraints.

7 0
3 years ago
Answer to this if you have apex legends on either pc xbox one or PS4 for the one that answers and does gets brainliest please do
weqwewe [10]

Answer:

I got it on Ps4

3 0
3 years ago
Read 2 more answers
There are four ways to create a macro? FALSE OR TRUE
Murljashka [212]

Answer: True

Explanation:

There are actually four ways to create a macro. You would want to use %let.

7 0
2 years ago
Read 2 more answers
Other questions:
  • Julie bought a house for $315,000 and has a $285,000 mortgage. she claims she has $315,000 in equity. is she correct? if not, ho
    12·2 answers
  • What is the service provided by a third party (such as an ISP) that enables you to connect another cloud directly to your Google
    15·1 answer
  • A properYour customer has connected a 1000-watt microwave oven and a 600-watt mixer to a 15-amp branch service line for the kitc
    11·2 answers
  • If a user receives a message whose tone and terminology seems intended to invoke a panic or sense of urgency, it may be a(n) ___
    13·1 answer
  • Create a function (prob3_6) that will do the following: Input a positive scalar integer x. If x is odd, multiply it by 3 and add
    15·1 answer
  • What is a benefit of naming cells and ranges?
    8·2 answers
  • Write a c program using loops to generate following output.
    11·1 answer
  • If you would like to give another user permissions on your mailbox or to particular folders within your mailbox, which role shou
    13·2 answers
  • Pls help will mark brainliest as soon as u awnser
    15·1 answer
  • The retention of encoded information over time refers to
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!