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
The brainly home page uses about 112% of my cpu. (On chromebook) any ideas to help increase performance?
Romashka-Z-Leto [24]
If you pin the tab it dramatically lowers usage
3 0
4 years ago
Read 2 more answers
If Anime Characters were real , Who Would Your Anime Wife Would Be (Tell Who And Why)
ehidna [41]

Answer:

Runa, because  she’s like me I r l lol

Explanation:

3 0
3 years ago
Which device is responsible for converting the main electric supply into usable voltage levels inside a computer?
Tom [10]
The PSU or most commonly known as the Power Supply.
7 0
3 years ago
Read 2 more answers
When storing used oil, it needs to be kept in ___________ containers.
tester [92]

Answer:

Plastic container

Explanation:

because if we use iron it may rust and oil may also damage

5 0
3 years ago
A ___ is a node (or a device) that connects two different networks together and allows them to communicate.
stellarik [79]

Answer:

The answer is Hub

Explanation:

A hub, also called a network hub, is a common connection point for devices in a network. Hubs are devices commonly used to connect segments of a LAN. The hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.

7 0
3 years ago
Other questions:
  • What can web designers use to control the individual web page layouts for all of the pages on a website?
    7·1 answer
  • Correspondence involves verbal communication. True False
    6·2 answers
  • Enter the number 2568 into the box below
    14·1 answer
  • : How does the founder of Wikipedia keep a tight reign on accuracy? HELP PLEZ AT LEAST A PARGRAPH PLES
    6·1 answer
  • Check my work a(n) ________ reference is an automatically created variable that holds the address of an object and passes it to
    15·1 answer
  • Describe an energy problem a city in 2050 will face
    6·1 answer
  • Which of the following will print I'VE GOT THIS on the screen? (5 points)
    14·1 answer
  • Michael needs to ensure that those items that are automatically archived are still easily accessible within Outlook. Which optio
    5·2 answers
  • Write a program, TwoDimentionalGrid. Ask the user to enter the size of the 2 dimensional array. Here we are not doing any input
    13·1 answer
  • You have been asked to replace a cracked screen on a laptop. The replacement screen was delivered today, but it did not include
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!