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
Evgesh-ka [11]
4 years ago
5

Complete the function ConvertToFeetAndInches to convert totalInches to feet and inches. Return feet and inches using the HeightF

tIn struct. Ex: 14 inches is 2 feet and 2 inches.
#include


typedef struct HeightFtIn_struct {

int feet;

int inches;

} HeightFtIn;


HeightFtIn ConvertToFeetAndInches(int totalInches) {

HeightFtIn tempVal;


/* Your solution goes here */


}


int main(void) {

HeightFtIn studentHeight;

int totalInches;


scanf("%d", &totalInches);

studentHeight = ConvertToFeetAndInches(totalInches);

printf("%d feet and %d inches\n", studentHeight.feet, studentHeight.inches);


return 0;

}
Computers and Technology
1 answer:
MrRa [10]4 years ago
7 0

Answer:

  The solution to this question with code explaination is given below in explanation section.              

Explanation:

#include <iostream>

typedef struct HeightFtIn_struct {// declaring struct for feet and inches

int feet;  

int inches;

} HeightFtIn;

HeightFtIn ConvertToFeetAndInches(int totalInches) {// function to convert to feet and in inches from total inches

   

int inches = totalInches;// declare inches local variable in ConvertToFeetAndInches function.

int feet = inches/12;// convert total inches into feet;

int leftInches = inches%12;// remaining inches after converting total inches into feet

HeightFtIn tempVal;// declare HeightFtIn_struct variable to store the value of inches and feets.

tempVal.feet = feet;// store feet value

tempVal.inches = leftInches;// store remaining inches after converting totalInches into feet

return tempVal;// return feets and inches.

/* Your solution goes here */

}

int main(void) {

HeightFtIn studentHeight; // declare HeightFtIn_struct variable studentHeight;

int totalInches;// declaring totalInches variable.

scanf("%d", &totalInches);// prompt user to enter totalInches;

studentHeight = ConvertToFeetAndInches(totalInches);// ConvertToFeetAndInches

printf("%d feet and %d inches\n", studentHeight.feet, studentHeight.inches);//display converted feet and inches from totalInches;

return 0;

}

You might be interested in
WHAT BIRD IS SHOWN ON THE ARM OF BLOODHOUND?
ruslelena [56]

Answer:

Looks like a raven to me

Explanation:

4 0
4 years ago
Read 2 more answers
What is the practice of distributing responsibility among multiple people so that no one person has full control of
Sholpan [36]

Answer:

If the responsibilities are distributed ,the disputes amongst people wont take place because their wont be any partiality, everyone would be equal. Moreover it is difficult for one person to control everything at once and multiple people would help the work to be organized as everyone will have their own part of work which is supposed to be fulfilled.

8 0
3 years ago
Does anyone play fortnite i want to be gifted vbucks please my epic is Springtrap_locks thx means a lot to me
Paladinen [302]

Answer:

This is not what this platform is supposed to be used for

Explanation:

Fortnite isnt a real game lol get a life

3 0
3 years ago
True or False. When clicking the button, the program displays OK1 OK2. When clicking the button, the program displays OK1. When
zaharov [31]

Answer:

False, The program has no compile error.

Explanation:

import javafx.application.Application;

import javafx.scene.Scene;

import javafx.scene.control.Button;

import javafx.stage.Stage;

public class Test extends Application {

 @Override // Override the start method in the Application class

 public void start(Stage primaryStage) {

   // Create a button and place it in the scene

   Button btOK = new Button("OK");

   btOK.setOnAction(e -> System.out.println("OK 1"));

   btOK.setOnAction(e -> System.out.println("OK 2"));

   Scene scene = new Scene(btOK, 200, 250);

   primaryStage.setTitle("MyJavaFX"); // Set the stage title

   primaryStage.setScene(scene); // Place the scene in the stage

   primaryStage.show(); // Display the stage

 }

 public static void main(String[] args) {

   launch(args);

 }

}

Java has an inline compiler, so if the line of code for an event is repeated twice and they both are not segmented, they will be compiled consecutively.

8 0
3 years ago
Which section is optional in a resume?
suter [353]

<em>Career Objectives </em>are pointless in a resume, Things like experience, Contact details, education and skills, help the company decide whether to take you or not, in accordance with their needs. They don't need to know why you want the job as opposed to how you could help them.

7 0
3 years ago
Other questions:
  • I need help pls, in this code if add row for example :
    8·1 answer
  • When the minnesota timberwolves encouraged facebook fans to post a great shot of a dunk onto its pinterest page for a chance to
    6·1 answer
  • 2 ways to assign a value to a variable
    6·1 answer
  • When you want to avoid sending email that a recipient may feel their privacy has been invaded, how would you fill in the (To) bo
    13·1 answer
  • PLEASE HELP !!!! WILL UPVOTE
    5·2 answers
  • One software license model allows software to be freely distributed, downloaded, and installed without paying a license fee but
    15·1 answer
  • What is your favourite video game??​
    5·2 answers
  • Produce definition in computer
    9·2 answers
  • Write a program that reads the balance and annual percentage interest rate and displays the interest for the next month. Python
    12·1 answer
  • ______ lets people access their stored data from a device that can access the Internet.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!