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
liberstina [14]
3 years ago
8

3. Write a function elapsed_time that takes as its arguments two time structures and returns a time structure that represents th

e elapsed time (in hours, minutes, and seconds) between the two times. So the call
elapsed_time (time1, time2)
where time1 represents 3:45:15 and time2 represents 9:44:03, should return a time structure that represents 5 hours, 58 minutes, and 48 seconds. Be careful with times that cross midnight
Computers and Technology
1 answer:
kumpel [21]3 years ago
3 0
Pseudocode for the function

time elapse_time(time time1, time time2)
{
/* hour */
if (time2.hr >= time1.hr) then
elapse_time.hr = time2.hr - time1.hr;
else /* pass mid night */
elapse_time.hr = 24 + time2.hr - time1.hr;
endif
/* min */
if (time2.min >= time1.min) then
elapse_time.min = time2.min - time1.min;
else
elapse_time.hr = elapse_time.hr -1;
elapse_time.min = 60 + time2.min - time1.min;
endif
/* sec */
if (time2.sec >= time1.sec) then
elapse_time.sec = time2.sec - time1.sec;
else
elapse_time.min = elapse_time.min -1;
elapse_time.sec = 60 + time2.sec - time1.sec;
endif
return elapse_time;
}
You might be interested in
The body element is where you provide browsers with information about the document
Yuliya22 [10]

The answer is False

The description above is the function of the head or the title element. The title element is used to identify the contents of an entire document. The title element may only appear once. On the other hand, the body element contains all of the content of an HTML document.


8 0
3 years ago
You often insert your company's logo into documents you create. One way to make it easier for you to quickly insert it is to sav
quester [9]
It would be building block.
8 0
3 years ago
Given a one dimensional array arr, what is the correct way ofgetting the number of elements in arr
SVETLANKA909090 [29]

Answer:

The answer is option 1 arr.length.

Explanation:

In java arr.length gives the correct number of elements in the array.The length is function is only applicable for arrays.

The length() method is applicable for strings.

arr.length-1 will give 1 element less.

There is no .size for arrays in java.

So we conclude that arr.length is correct way of getting the number of elements in one dimensional array arr.

3 0
4 years ago
During the system investigation stage, __________ studies are done to determine if the hardware, software, and communications co
oksano4ka [1.4K]

Answer:

The correct answer is "Technical Feasibility".

Explanation:

System investigation is used to Review that whether the system is feasible or not for the proposal that they will design or creating.in the system investigation stage, we do the technical feasibility. The technical feasibility is used to check technical resources like hardware, software, etc in the organization.

The  Technical Feasibility in the System investigation  is used to solve the problem of business

6 0
4 years ago
g Write a program that allows a user to input any text in your program. Using the tools that we have discussed, your program sho
Paladinen [302]

Answer:

Explanation:

The following function/program is written in Java. It asks the user for a sentence as an input and then splits that sentence into an array of words. Then it creates an arrayList for all of the unique words, comparing each word in the sentence with all of those in the ArrayList. If a word is found in the ArrayList it cancels the loop and moves on the next word in the sentence. Finally, it counts all of the unique words in the ArrayList and prints that total to the screen.

public static void uniqueWords() {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a sentence:");

       String sentence = in.nextLine();

       String words[] = sentence.split(" ");

       ArrayList<String> uniqueWords = new ArrayList<>();

       for (int x = 0; x < words.length; x++) {

           boolean exists = false;

           for (int i = 0; i < uniqueWords.size(); i++) {

               if (words[x].equals(uniqueWords.get(i))) {

                   exists = true;

                   break;

               }

           }

           if (exists == false) {

               uniqueWords.add(words[x]);

           }

       }

       System.out.println(uniqueWords.size());

   }

5 0
3 years ago
Other questions:
  • Paulene is using this table in Word,and she started with the cursor in the box that read “Flavor”. she then hits Alt+End,The the
    7·1 answer
  • What is the maximum data transfer rate of an ieee 1394a device?
    5·1 answer
  • The it department is reporting that a company web server is receiving an abnormally high number of web page requests from differ
    13·1 answer
  • How to format an APA paper set it up
    15·1 answer
  • C++ Proagram
    7·1 answer
  • During side show mode, hitting the B key will do which one of these?
    7·1 answer
  • 4. Write technical term for the following statements
    15·2 answers
  • Select the correct answer from each drop-down menu.
    8·2 answers
  • Explain why the local disc of a computer start from C and not A​
    6·1 answer
  • .WAP to enter monthly sale of Salesman and give him commission i.E. If the monthly sale is more than 500000 then commision will
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!