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
fiasKO [112]
4 years ago
10

In this program you will read in the number of seconds and convert it to days, hours, minutes and remaining seconds. Your progra

m will make use of long long int variables for all calculations. Note: the use of long long int requires that you have C++11 support. You should have this automatically if you are using a newer version of Visual Studio. The support is there for GCC as well, but you may need the -std=c++11 or -std=c++0x compiler flag.
Computers and Technology
1 answer:
mart [117]4 years ago
3 0

Answer:

// here is code in c++.

// include headers

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

long long int inp_sec,days,hours,minutes,sec;

long long int s;

cout<<"please enter the seconds:";

 // read the input seconds

cin>>inp_sec;

 // make copy of input second

s=inp_sec;

 // compute days,86400 seconds in a day

days=inp_sec/86400;

 // update the seconds after counting days

inp_sec=inp_sec%86400;

 // compute hours, 3600 seconds in an hour

hours=inp_sec/3600;

 // update the seconds after counting hours

inp_sec=inp_sec%3600;

 //compute minutes, 60 seconds in a minute

minutes=inp_sec/60;

 // compute remaining seconds

sec=inp_sec%60;

 // print the output

cout<<s<<" seconds is equal to "<<days<<" days "<<hours<<" hours "<<minutes<<" minutes "<<sec<<" seconds "<<endl;

return 0;

}

Explanation:

Declare variables "inp_sec","days","hours","minutes" and "sec" of long long int type. read the seconds from user and assign it to variable "inp_sec".Make a copy of input  seconds.Then compute the days by dividing inp_sec with 86400 and update the inp_sec. then find hours by dividing inp_sec with 3600 and update the inp_sec.Similarly  find the minutes and remaining seconds.After this print the output.

Output:

please enter the seconds:83647362                                                                                                                            

83647362 seconds is equal to 968 days 3 hours 22 minutes 42 seconds

You might be interested in
TCO 10) Voice packets could experience a significant _____ delay in routers and switches when sharing a network with data traffi
bonufazy [111]

This delay in routers is what we called Packetization delay or also called Accumulation delay. Packetization delay is the time required for the information to pass on the wires. The data rate of the links that passes thru the wires cause the delay.

8 0
3 years ago
Which option of ms-word is used o represent data in an organised manner?
tekilochka [14]
Use the charting features of Word 2007 and Excel 2007 to present<span> your </span>data<span> in a pie, line, </span>
3 0
3 years ago
Relational tables need to be​ ______________ to help avoid duplicate data.
Svetlanka [38]
Relational tables need to be DISTINCT to help avoid duplicate data.

Distinct is defined as readily distinguished or recognizably different in nature from something of similar type.

Being distinct is the first integrity rule that a relational table follows. It ensures that the data in the table are always accurate and accessible.
5 0
3 years ago
Write function modifyString(origString, charsToReplace, count) that takes as input a string origString, a string charsToReplace,
laila [671]

Answer:

The code of the above program is provided below. using Python

Explanation:

<u>Code in Python 3:- </u>

def modifyString(origString,charsToReplace,count):

# Make s1 as original string

s1=origString

# Make s2 as charsToReplace string in lowercase

s2=charsToReplace.lower()

# Make s3 as charsToReplace string in uppercase

s3=s2.upper()

# Initialize answer as an empty string

ans=''

# Iterate the string upto length times

for i in range(len(s1)):

# check for chars in the string and append to the answer

if (s1[i] in s2) or (s1[i] in s3):

ans=ans+count*s1[i]

else:

ans=ans+s1[i]

# return the final string

return ans

print(modifyString("Our cat is funny","aeiou",5))    

print(modifyString("Our cat is funny","zu",3))

8 0
3 years ago
n channels of bandwidth Bc are multiplexed together with FDM on a link. The guard band between two adjacent channels has bandwid
Andrei [34K]

Answer: The answer to the question is as follows:

Minimum BW= n*Bc + (n-1) Bg

Explanation:

FDM is a multiplexing technique that takes several baseband signals of n Khz wide (let's assume that all have the same bandwidth), and translates them in frequency so they can be transmitted together, at a higher frequency.

If we assume no guard bands between the different signals, the mimum bandwidth needed would be n times the bandwidth of a single signal.

In order to avoid crosstalk between signals, as the communication channel is not perfect, it usually leaves some room between any 2 signals, which it is called a band guard, and because there is a band guard for any 2 contiguous signals in the spectrum, the total number of bandguards (Bg) will be equal to (n-1) signals, so the total bandwidth to be used will be as follows:

BW needed: n*Bc + (n-1) Bg.

8 0
4 years ago
Other questions:
  • Write a function: function solution(N); that, given a positive integer N, prints the consecutive numbers from 1 to N, each on a
    14·1 answer
  • Where can audiovisual technology and materials be found? (Select all that apply.)
    14·1 answer
  • What is the name for the percentage of people who don't have jobs in a country or area?
    11·2 answers
  • In a set associative cache memory, if the number of ways (lines) in a set is doubled while keeping the cache size and line size
    13·1 answer
  • Find and fix the error in the if-else statement. import java.util.Scanner;
    11·2 answers
  • Which of the following best describes a situation where software should be upgraded instead of replaced?
    6·1 answer
  • Which of the following is a separate summary worksheet in the same workbook?
    14·1 answer
  • Create a basic program that accomplishes the following requirements: Allows the user to input 2 number , a starting number x and
    12·1 answer
  • SOMEONE PLEASE HELP!! i’ll give brainliest
    14·2 answers
  • Which statement best describes a social impact of computing on the world?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!