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
is there an app i can use to make a picture appear in the corner of a video then disappear after being up for a second?
Nuetrik [128]
Umm i really do not know i'm sorry
7 0
3 years ago
Read 2 more answers
Jason works as an accountant in a department store. He needs to keep a daily record of all the invoices issued by the store. Whi
kotykmax [81]

Are there any options

3 0
3 years ago
Read 2 more answers
The Quick Search capability is found on which control?
choli [55]

Answer:

backstage view

Explanation:

6 0
2 years ago
Modify the list according to the following: append the smallest value at the end of the list when all numbers in the list are ne
ddd [48]

Answer:

The solution code is written in Python 3:

  1. def modifyList(listNumber):
  2.    posCount = 0
  3.    negCount = 0
  4.    for x in listNumber:
  5.        if x > 0:
  6.            posCount += 1
  7.        else:
  8.            negCount += 1
  9.    
  10.    if(posCount == len(listNumber)):
  11.        listNumber.append(max(listNumber))
  12.    
  13.    if(negCount == len(listNumber)):
  14.        listNumber.append(min(listNumber))
  15.    
  16.    print(listNumber)
  17. modifyList([-1,-99,-81])
  18. modifyList([1,99,8])
  19. modifyList([-1,99,-81])

Explanation:

The key step to solve this problem is to define two variables, posCount and negCount, to track the number of positive value and negative value from the input list (Line 2 - 3).

To track the posCount and negCount, we can traverse through the for-loop and create if else statement to check if the current number x is bigger than 0 then increment posCount by 1 otherwise increment negCount (Line 5- 9).

If all number in the list are positive, the posCount should be equal to the length of the input list and the same rule is applied to negCount. If one of them happens, the listNumber will append either the maximum number (Line 11 -12) or append the minimum number (Line 14-15).

If both posCount and negCount are not equal to the list length, the block of code Line 11 -15 will be skipped.

At last we can print the listNumber (Line 17).

If we test our function using the three sets of input list, we shall get the following results:

[-1, -99, -81, -99]

[1, 99, 8, 99]

[-1, 99, -81]

3 0
3 years ago
Write Python code to save the data to a MongoDB collection:Import json module to parse JSON dataImport MongoClient from pymongo
Zigmanuir [339]

Answer:

Explanation:

The objective of this task is to compute a program that involves the usage of Python code to save the data to MongoDB and to query  the database.

Due to the error that occur which makes me to be unable to submit this answer, I've created a word document instead and the attached file can be found below.

Thanks!

Download docx
8 0
2 years ago
Other questions:
  • Apart from confidential information, what other information does NDA help to outline?
    15·1 answer
  • Three of the most important jobs of security management are to ensure _____ are organized according to sensitivity, ensure that
    10·1 answer
  • All health information available on the internet is valid. <br> a. true <br> b. false
    6·1 answer
  • Which of the following are disadvantages of networks? Check all of the boxes that apply.
    14·1 answer
  • The elements in a long array of integers are roughly sorted in decreasing order. No more than 5 percent of the elements are out
    12·1 answer
  • 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
  • C
    5·1 answer
  • Hosts on the Internet have ________ addresses. Group of answer choices both A and B neither A nor B IP data link
    13·1 answer
  • Over the last decade, the overall energy consumption of cloud data centers worldwide has remained relatively the same. Why is th
    15·1 answer
  • you are currently logged in using the badams account. you want to view the contents of the /etc/inittab file, but you are not al
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!