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
Ivenika [448]
3 years ago
7

Define a function SetTime, with int parameters hoursVal and minutesVal, that returns a struct of type TimeHrMin. The function sh

ould assign TimeHrMin's data member hours with hoursVal and minutes with minutesVal.
Computers and Technology
1 answer:
Lapatulllka [165]3 years ago
4 0

Answer:

#include <stdio.h>

typedef struct TimeHrMin_struct //struct

{

int hours;

int minutes;

} TimeHrMin;

struct TimeHrMin_struct SetTime(int hoursVal,int minutesVal) //SetTime function

{

struct TimeHrMin_struct str;

str.hours=hoursVal; //assigning the values

str.minutes=minutesVal;

return str; //returning the struct

}

int main(void)

{

TimeHrMin studentLateness;

int hours;

int minutes;

scanf("%d %d", &hours, &minutes);

studentLateness = SetTime(hours, minutes); //calling the function

printf("The student is %d hours and %d minutes late.\n", studentLateness.hours, studentLateness.minutes);

return 0;

}

Explanation:

You might be interested in
Here are the codes for producer and consumer problems.
melomori [17]

Answer:

If a switch happens during counter++ or counter--, we will get a wrong value for the counter.

Explanation:

counter++ counter--

register1 = counter register2 = counter

register1 = register1 + 1 register2 = register2 - 1

counter = register1 counter = register2

Lets consider this example, lets assume that counter=4, this simply means that there are 4 items which are produced already. Lets look at the following steps and value of counter after each step.

a) Producer process is updating counter++, this takes place at machine level, also, during that when it completed register1=counter counter=4

b) Supposing we have a context switch happen to consumer process and it is trying to update counter--, this takes place at machine level, also when it completed

register2=counter counter=4

register2=register2-1

counter=register2 counter=3

c) Lets assume that context switch happened back to producer process and it continues from where it stopped, look at step a

register1=register1+1

counter=register1 counter=5

This will make the value of counter variable to become 5. Consumption of one item is not reflected in the counter variable. To avoid this we need to allow the atomic execution of all these instructions. This implies completion of any updates on the counter, while others wait for its completion.

d) In the event a producer executes all these machine level instructions at once,then there is no inconsistency on this.

3 0
3 years ago
If you see ________________________ in a cell, it means the column is not wide enough to display the cell content. Select one: a
snow_lady [41]

the answer is c, ######

4 0
3 years ago
By using the search functionality within a twitter stream, users can filter for:
rosijanka [135]
By using the search functionality within a twitter stream, users can filter for: Tweets containing keywords and key phrases, Tweets from specific users, Tweets containing @mentions, Tweets from specific locations.  <span>The secret to using Twitter effectively is using the Twitter lists. </span>Each Twitter list you create, gives you a different Twitter stream, customized to your liking. It will only include tweets sent out by those accounts you have added to the list
6 0
3 years ago
Tech A says that gasoline vapors are lighter than air, so inspection pits do not have a fire hazard like above ground hoists. Te
Elden [556K]

Answer:

Tech B is correct.

Explanation:

First, It is international best practice never to exceed the lifting capacity of any hoist. To do so would expose those involved to risks that may prove to be fatal.

Second, research has shown that gasoline vapors, as well as vapor from almost all other flammable or ignitable liquids or substances, are heavier than air.

More specifically, Gasoline produces flammable vapors that are heavier than air by 3 to 4 times. This means they can travel for great distances along the ground. Worst still, inspection pits are must be kept free from gas vapors because they tend to accumulate in low or enclosed spaces.

Both technicians should and must observe all occupational, health, and safety rules and guidelines stipulated and required for their industry/practice.

Cheers

4 0
2 years ago
Write a line of code to convert time to hours. Remember there are 60 minutes in an hour. Then write a line of code to calculate
DaniilM [7]

Answer:

float time_hourly=(time_min/60);

float speed_mph=(distance_mil/time_hourly);

Explanation:

I have taken a float variable time_hourly to convert the time given in minutes in hours.We need to divide the time in minutes by sixty since there are 60 minutes in an hour.

I have taken a float variable speed_mph to calculate the speed.Since we know the speed is distance/time and provided the distance is in miles and the time is in hours.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Write a paragraph on the orgin or development of ONE of the following elementss of the Internet:
    15·1 answer
  • If you want an app to reach the largest possible audience, which two platforms should you use?
    7·1 answer
  • "what are the problems with tcp over wireless network?"
    15·1 answer
  • You are testing a web application for sql injection vulnerabilities. you send various sql statements which return results on the
    5·1 answer
  • What are the names of the four major varnas in the caste system?​
    9·2 answers
  • What are the OSHA construction standards also called ?
    10·1 answer
  • A network administrator determines who may access network resources by assigning users
    10·1 answer
  • How is information processed within a<br> motherboard between the hard drive, CPU and RAM,
    12·1 answer
  • What is the core function of an enterprise platform
    12·2 answers
  • Which statement best describes the computers all around us?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!