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
any one that owns a chrome book there is a new update there is new features and there is a game on settings where you see what y
timama [110]

Answer:

THANK YOU SO MUCH! I AM ON MY CHROME BOOK RIGHT NOW AND WAS HESITATING TO DOWNLOAD THE UPDATE!

Explanation:

4 0
2 years ago
Read 2 more answers
A combination lock has the following basic properties:
fomenos

Answer:

public class CombinationLock {

   

    private int combinationNumber1 = 0;

    private int combinationNumber2 = 0;

    private int combinationNumber3 = 0;

   

   CombinationLock(int combinationNumber1, int combinationNumber2, int combinationNumber3){

       this.combinationNumber1 = combinationNumber1;

       this.combinationNumber2 = combinationNumber2;

       this.combinationNumber3 = combinationNumber3;

   }

   

   public boolean open(int number1, int number2, int number3){

       if(number1 == combinationNumber1 && number2 == combinationNumber2 && number3 == combinationNumber3)

           return true;

       else

           return false;

   }

   

   public boolean changeCombo(int number1, int number2, int number3, int newNumber1, int newNumber2, int newNumber3){

       

       if (open(number1, number2, number3)){

           combinationNumber1 = newNumber1;

           combinationNumber2 = newNumber2;

           combinationNumber3 = newNumber3;

           return true;

       }else

           return false;

   }

}

Explanation:

- <em>Three variables</em> are created to hold the combination.

- A <em>constructor</em> is created to set the combination.

- A boolean method called <em>open</em> is created to check if the given numbers are correct, and <u>returns true</u> (<u>otherwise returns false</u>).

- A boolean method method called <em>changeCombo</em> is created to check if given numbers are correct. If they are correct, it assigns new values for the combination and <u>returns true</u> (<u>otherwise returns false</u>).

5 0
2 years ago
Jacek has just started a new job as a sales clerk, and his first task is to create a new sales invoice. Which Microsoft software
g100num [7]

Answer:

Microsoft Excel

Explanation:

Microsoft Excel is a Microsoft application package. It is a spreadsheet application used to analyse and manipulate data. It has columns which are referred to fields and rows also known as records.There are various features in excel that used to create statistical and graphical esctasies and data presentations.

It can be used to create template for CVs/resumes, Bank draft, receipts and invoice etc.

5 0
2 years ago
Under which reflection(s) is the image of line m also a line?
lubasha [3.4K]

Answer:

c

Explanation:

5 0
3 years ago
Read 2 more answers
The element of website design that refers to the website's aesthetic appeal and the functional look and feel of the site's layou
zzz [600]

The element of website design that refers to the website's aesthetic appeal and the functional look and feel of the site's layout and visual design is known as context.

<h3>What is webpage context?</h3>

The web page context is known to be a kind of special ID that is is formed with all the new page load event.

The context of a website is known to be the point or place where a person can show their visitors that one care. It gives a kind of website's aesthetic appeal and the functional look.

Learn more about website design from

brainly.com/question/25941596

6 0
1 year ago
Other questions:
  • What is a nonlinear presentation
    9·2 answers
  • What are the most popular/up-and-coming social media applications?
    10·2 answers
  • Design a method for representing the state of a tic-tac-toe board in computer memory. can you fit your representation into three
    12·2 answers
  • Select four programs that make up system software.Select four programs that make up system software.
    8·1 answer
  • _____ are special combinations of keys that tell a computer to perform a command.
    9·2 answers
  • How do graphic designers showcase their work?
    14·2 answers
  • The 7-bit ASCII code for the character ‘&amp;’ is: 0100110 An odd parity check bit is now added to this code so 8 bits are trans
    12·1 answer
  • What two windows security updates do most organizations always patch?
    7·1 answer
  • For this activity, you will practice being both proactive and reactive to bugs. Both are necessary to get rid of errors in code.
    5·1 answer
  • Ok so I’m using a word document and towards the bottom of the page it stops me from moving my text box any further down even tho
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!