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
Basile [38]
3 years ago
7

Suppose you have a 12-hour clock on a very fancy chair (noon is 12 PM and midnight is 12 AM). Write a C++ program that reads in

a time, along with a time adjustment. If you can, move the user forward or backward in time the appropriate amount. Alternatively, display the resulting time after the adjustment.
Computers and Technology
1 answer:
agasfer [191]3 years ago
4 0

Answer:

#include<iostream>

#include<cmath>

#include <ctime>

using namespace std;

int main()

{

       time_t t = time(NULL);

tm* timePtr = localtime(&t);

cout << "seconds= " << (timePtr->tm_sec) << endl;

cout << "minutes = " << (timePtr->tm_min) << endl;

cout << "hours = " << (timePtr->tm_hour) << endl;

cout << "day of month = " << (timePtr->tm_mday) << endl;

cout << "month of year = " << (timePtr->tm_mon)+1 << endl;

cout << "year = " << (timePtr->tm_year)+1900 << endl;

cout << "weekday = " << (timePtr->tm_wday )<< endl;

cout << "day of year = " << (timePtr->tm_yday )<< endl;

cout << "daylight savings = " <<(timePtr->tm_isdst )<< endl;

       cout << endl;

       cout << endl;

       cout << "Date     " <<(timePtr->tm_mday)<<"/"<< (timePtr->tm_mon)+1 <<"/"<< (timePtr->tm_year)+1900<< endl;

       cout << "Time     " << (timePtr->tm_hour)<<":"<< (timePtr->tm_min)<<":"<< (timePtr->tm_sec) << endl;  

   return 0;

}

Explanation:

You might be interested in
It’s Saturday and you’re looking forward to hanging out with friends and having some fun. However, you get two phone calls early
hram777 [196]

Answer with Explanation:

I would forego the all-day basketball tournament because, clearly, I will be spending so much for just a one-day fun. I'm sure there will be other upcoming basketball tournaments I can attend to. So, I will accept my neighbor's offer of helping to paint their apartment because <em><u>I will be earning $75 and such offer doesn't come every day.</u></em> Since I also want to enjoy and hang out with friends, I would call a friend to help me in painting the apartment so we could split the payment, which means<u> both of us will have</u><u><em> $37.5</em></u><u>.</u> In this case, <u>I will not only earn money on Saturday but will also get to enjoy the company of my friend.</u>

4 0
3 years ago
Contemporary operation of networking technology is possible only through the usage of open-use technology and layering approache
eimsori [14]

Answer: TRUE

Explanation: Networking technology is the term used to describe the entire processes through which computer or mobile systems are linked up either through optic fibers,wireless systems in order to enhance effective communication across networks or regions.

OSI (open system interconnection), the earliest models partitions into seven layers and the OSI is known as model that creates partitioning a communication system classing them into abstraction layers.

8 0
3 years ago
Favorite color should it be stored why?or why not?<br>​
Triss [41]

Answer:

Explanation:

green

8 0
3 years ago
You know a Linux command will perform a desired function for you, but you cannot remember the full name of the command. You do r
Blababa [14]

Answer:

The correct answer is option  a. man –k flush.

Explanation:

When you want to flush a variable from your system you should use the command flush in linux.

The command you'll be typing in the command prompt of the linux is man -k flush.

Hence the answer to this question is option a. man -k flush.

6 0
3 years ago
Federal law requires safety training before workers or students enter the work area.
otez555 [7]

It is True.

According to federal laws in the U.S, an employer is required by law to provide training to all employees. The employees should acquire this knowledge and understanding and any skills necessary for the performance of the duties. The employer is also required to certify that the training has been accomplished.


8 0
4 years ago
Other questions:
  • When performing actions between your computer and one that is infected with a virus which of the following offers no risk becomi
    5·1 answer
  • Peter recently bought a media player and a digital camera he wants to buy memory card for the devices which memory device should
    10·2 answers
  • __________ describes a module for which the software developer does not care how the processing is performed, but instead, knows
    7·1 answer
  • Which one of these is not an example of common presenter mistakes?
    9·1 answer
  • Question 1
    10·1 answer
  • You suspect that an attacker has hidden files on your machine. What Linux command would you use to search for files with a file
    14·1 answer
  • An IT suspects that an unauthorized device is connected to a wireless network. This is a result of pastry sharing on a device br
    13·1 answer
  • 11) A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one chil
    7·1 answer
  • Which of the following is a quality of a mixed economy?
    5·1 answer
  • List four types of Web browsers<br>​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!