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
svetlana [45]
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:
ehidna [41]3 years ago
6 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
After 4th collision in ethernet, find the maximum time that the adapter waits until sensing the channel again for a 100 mbps bro
VARVARA [1.3K]

Waiting time for a 100 Mbps broadcast channel is 0.512 ms

Recall that with the CSMA/CD protocol, the adapter waits K * 512 bit times after a collision,

where K is drawn randomly. For K = 100,

The one bit time for 10 Mbps is 1/10000000 s = 0.0001 ms

The one bit time for 100 Mbps is 1/100000000 s = 0.00001 ms

Waiting time for a 10 Mbps broadcast channel is K*512*0.0001= 5.12 ms

Waiting time for a 100 Mbps broadcast channel is K*512*0.00001= 0.512 ms

<h3>What is a collision in Ethernet?</h3>
  • A collision happens on a half-duplex Ethernet network when two devices on the same network attempt to communicate data at the exact same time.
  • The two transmitted packets are "collapsed" by the network, which results in the network discarding both of them.
  • On Ethernets, collisions are unavoidable.
  • A collision is a momentary interaction between two bodies or more than two bodies at once that modifies the motion of the bodies involved as a result of the internal forces at work.
  • Collisions entail the application of force (there is a change in velocity).

Learn more about collision in Ethernet: brainly.com/question/14123270

#SPJ4

3 0
2 years ago
14. Which commercial RDBMS product was the first to hit the market and is the biggest?
schepotkina [342]

The answer is definitely (A. SQL server) it was released back in 2010 and is huge!

Let us know if there is anything else you need to know.

Mark brainlest :)

3 0
3 years ago
What must be done before using ArrayLists?<br><br> (This is Java Programming btw)
Viktor [21]

Answer:

to create an ArrayList , you declare an Arraylist variable and call the ArrayList constructor to instantiate and ArrayList object and assign it to the variable

5 0
3 years ago
When entering a formula or function into a cell, most spreadsheet programs require that you begin with some type of symbol, usua
olga_2 [115]
This is a false statement, if that's the question.
4 0
3 years ago
Help me with this please, it is for tech
Sonbull [250]
I believe it’s dsl.
5 0
4 years ago
Other questions:
  • Which company is credited with solving a problem by creating a program that could work on all computers?
    11·1 answer
  • A coworker asks your opinion about how to minimize ActiveX attacks while she browses the Internet using Internet Explorer. The c
    14·1 answer
  • Which hypervisor works on older pcs without hardware virtualization support?
    9·2 answers
  • PLEASE HELP ON TECHNOLOGY
    8·1 answer
  • The GeForce GTX 1060 graphics card requires 120 W of power. You plan to install it in a PCIe 3.0 ×16 slot. Will you need to also
    13·1 answer
  • If you have an equipment failure while driving on an expressway, you should
    8·1 answer
  • 1. Who was able to complete the puzzle the fastest in Trial 1?
    15·1 answer
  • Which of these is an example of output?
    13·2 answers
  • Visit on social networking site and look for the site's privacy policy.The link is typically found at the bottom of the page and
    9·1 answer
  • WHO WANT P O I N T S.................................................
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!