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
Which value can be entered to cause the following code segment to display the message "That number is acceptable."
AnnZ [28]

Answer:

We can give the any  integer value between 10 to 100 then it display the message "That number is acceptable."

Explanation:

In the given code the "number" variable takes an user input via cin .After taking user input it check the condition of if block that the user input is between the range of 10 to 100 .if this condition is true then the statement of if block will be executed i.e  That number is acceptable otherwise else block will be executed That number is not acceptable.

following are the code in c++

#include <iostream> // header file

using namespace std;

int main() // main

{  

   int number; // variable

cin >> number; // taking input

if (number > 10 && number < 100) // if block

cout << "That number is acceptable.";

else

cout << "That number is not acceptable.";

return 0;

}

Output:

66

That number is acceptable.

456

That number is not acceptable.

8 0
4 years ago
What is the file extension for an impress file??
gogolik [260]
<span>In this resource, files created in OOo Impress will be referred to as ODP files and Impress Files.</span>
6 0
3 years ago
The spoken version of your company's purpose is called
beks73 [17]

Answer:

The answer to this question is given below in the explanation section. The correct answer is A

Explanation:

The spoken version of the company's purpose is also called an elevator pitch. because it has to be short enough to fit into a conversation that takes place on an elevator.

however the other options are not correct that tells the purpose of a company, because the vision statement shows what you will be at what stage in next coming year (in terms of growth, product /services etc). Your values are about what uniqueness you have in your product/service etc that you are providing to your customers/clients. While differentiation is not a spoken version of your company.

7 0
4 years ago
Sequential and direct access are two methods to locate data in memory. Discuss why major devices now a days use direct access? H
djverab [1.8K]

Answer:

Direct data access reduces the speed of retrieving data from memory or storage. Retrieving data and storing it in a cache memory provides direct access to data in the storage.

Explanation:

Sequential memory access, as the name implies, goes through the memory length location in search of the specified data. Direct memory access, provides a memory location index for direct retrieval of data.

Examples of direct and sequential memory access are RAM and tapes respectively. Data in sequential memory access can be access directly by getting data in advance and storing them in cache memory for direct access by the processor.

3 0
3 years ago
How can we work together to fix problems with our websites
Virty [35]
Add a Value Proposition. ...
Website Navigation. ...
Call to Action Text. ...
Call to Action Colors. ...
Try The 10-Foot Test. ...
Carousels. ...
Social Proof. ...
Testimonial Pages.
8 0
3 years ago
Other questions:
  • Ignorance of policy is a legal excuse for an employee. TRUE or FALSE
    11·1 answer
  • Data owners ensure that only the access that is needed to perform day-to-day operations is granted and that duties are separated
    10·1 answer
  • Data are sent through a network on bundles called _______. select one:
    8·2 answers
  • What is the primary purpose of source code editor features such as keyword hi lighting and auto-completion A.to speed up the cod
    7·1 answer
  • ______ view is generally used for creating, formatting and designing slide​
    13·1 answer
  • Assessment
    12·1 answer
  • The red dot says ‘you tried to read records from a table called “Netflix Content” but that table doesn’t exist in this’
    7·1 answer
  • Problem 8 - Recursive Divisible by 3 and 5 Complete the divBy3And5 function which accepts a list of integers. The function shoul
    13·1 answer
  • Why are digital computers more popular these days?​
    14·2 answers
  • Show the B-tree that results when inserting R,Y,F,X,A,M,C,D,E,T,H,V,L,W,G (in that order)branching factor oft= 3. You need only
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!