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
A company ABC asked you to design a simple payroll program that calculates and employee's weekly gross pay, including any overti
julsineya [31]

Answer:

<em>C++.</em>

#include <iostream>

using namespace std;

////////////////////////////////////////////////////////////////

int main() {

   int weekly_hours = 0;

   int hourly_rate;

   float gross_pay = 0;

   cout<<"Enter weekly hours worked: ";

   cin>>weekly_hours;

   

   cout<<"Enter hourly rate: ";

   cin>>hourly_rate;

   

   cout<<endl;

   ////////////////////////////////////////////////

   if (weekly_hours > 40) {

       gross_pay = (weekly_hours*hourly_rate) + ((weekly_hours*hourly_rate)*0.5);

   }

   else

       gross_pay = weekly_hours*hourly_rate;

       

   cout<<"Weekly gross pay: $"<<gross_pay;

   ////////////////////////////////////////////////

   return 0;

}

3 0
3 years ago
You used a website to learn about the child-rearing practices in China. Your study is related most to which aspect
ozzi

Answer:

c. culture

Explanation:

I think your study is related to their culture

5 0
3 years ago
Read 2 more answers
Mi laptop dice the computer restarted unexpectedly or encountered an unexpected error.Windows installation cannot procced.To ins
borishaifa [10]

Answer:

Explanation:

There are two reasons as to what could have happened with your laptop. The first one is that your laptop was installing a critical windows update which got corrupted when the laptop's battery died causing windows itself to become corrupted. In this case, you would need to format the hard drive and reinstall windows. The second reason could be that your hard drive is failing and not allowing Windows to load or properly be installed on it. In this second scenario you would need to buy and replace the hard drive.

4 0
3 years ago
Research and discuss the similarities and differences between cloud computing and client-server computing. Discuss the pros and
harkovskaia [24]

Answer:

Cloud computing as a virtual hosting tool, is much more theoretical. Both servers, applications, and communications are hosted in the cloud, off property, rather than being available via computer machine whereas In computing client/server, a controller gets client requests mainframes and needs to share its services, programs and/or data of one sometimes more client systems on the internet, and a client would be a portable platform that specific portions with a server and make use of a finite resource.

Explanation:

<u>Similar to cloud computing and client-server computing: - </u>

  • The cloud computing and client-server networking underpinning principles are the same. That is contact between client and server.
  • Throughout networking and client-server networking, user nodes can communicate (queries) with databases that live locally or are located in many other networks.

<u>Difference between computing and client-server computing: </u><u>- </u>

Resources: -

  • In computing client-server, the corporation or association controls the tools.
  • The services are offered in cloud computing by third parties or other businesses.

<u>The purpose of cloud computing and client-server computing is different:- </u>

  • Client-server computing is targeted at use. In computation, client-server clients request a product from the cloud. The operating system runs the test, then returns it.
  • Cloud computing is a sort of system in which the IT-related services are leased to the clients as a contract.

<u>Pros and cons of Cloud Computing:- </u>

The Pros:-

  • Lower costs for business:-The cloud is saving a lot of money for a medium-sized or small enterprise.
  • Better Reliability:- A dedicated group of experts performs all programming with such a cloud computing alternative.

The Cons:-

  • Limited Control:- When a firm stores cloud data, they have very limited control of it.
  • There have been security issues. The cloud isn't too attuned for every company to position some information on even a cloud.

<u>Pros and cons of client-server computing:- </u>

The Pros:-

  • Improved data sharing:- Data stored via the normal business method and processed on a server is available over an approved connection for the intended users.
  • Security:- Database has stronger access control and methods to ensure data could only be accessed or abused by approved clients.

The Cons:-

  • Overloaded Servers:- When multiple simultaneous requests from the client are made, the server is significantly overloaded, causing congestion in traffic.
  • Impact of centralized architecture:- Because it is centralized if a vital server fails to satisfy customer requests, the client-server then lacks good network robustness.

5 0
3 years ago
You're installing two new hard drives into your network attached storage device. Your director asks that they be put into a RAID
bekas [8.4K]

Answer:

d. RAID 6

Explanation:

RAID is a data storage technology that combines multiple physical disk drive components into a single logical unit. The functions of RAID is to provide performance and redundancy.

RAID 0 provides data stripping but it does not offer data stripping.

RAID 1 increases performance to about 2x but it limits the disk capacity to about 50%

RAID 5 provides redundancy and increased perfomance but it is limited to small disk drive.

RAID 6 also provides redundancy but it slows performance

RAID 10 increases performance and data protection.

RAID 6 is the best drive that offers redundancy over performance.

8 0
3 years ago
Other questions:
  • Describe an application where a parallel circuit might work better than a series circuit
    15·2 answers
  • Which partitioning method must you use for a 4-tb hard drive?
    13·1 answer
  • Because log-on procedures may be cumbersome and tedious, users often store log-on sequences in their personal computers and invo
    6·1 answer
  • What tasks does google do?
    5·1 answer
  • To share a document in my online electronic journal, I should select the option to _____.
    14·1 answer
  • The blue bar across the top of the screen informs you of the Screen Title, or what step you are on.
    5·1 answer
  • PLEASE ANSWER THIS IM IN A QUIZ
    15·2 answers
  • Question 1
    13·1 answer
  • Assignment 10 - 1/0 Streams and Files Create a C++ a program that will compute the average word length (average number of charac
    13·1 answer
  • Which of the following lines of code would reduce the player’s gold by 100 coins?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!