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
bonufazy [111]
3 years ago
6

• Write a program that asks the user to enter a number of seconds. • If there are less than 60 seconds input, then the program s

hould display the number of seconds that was input. • There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds (note that ther

Computers and Technology
2 answers:
damaskus [11]3 years ago
8 0

Answer:

Here is the program in C++. Let me know if you want this program in some other programming language.

#include <iostream> //for input output functions

using namespace std;//to detect objects like cin cout

int main()//start of main() function body

{  int seconds; // stores the value of seconds

   int time;    // stores value to compute minutes hours and days

   cout << "Enter a number of seconds: ";

//prompts user to enter number of seconds

   cin >> seconds; // reads the value of seconds input by user

   if (seconds <= 59) //if the value of seconds is less than or equal to 59

   { cout << seconds<<" seconds\n";    } //displays seconds

   else if (seconds >= 60 && seconds < 3600)

//if value of seconds is greater than or equal to 60 and less than 3600

   {  time = seconds / 60; //computes minutes

       cout << time << " minutes in "<<seconds<<" seconds \n ";    }

//displays time in minutes

   else if (seconds >= 3600 && seconds < 86400)    {

//if input value of secs is greater than or equal to 3600 and less than 85400

       time = seconds / 3600; //calculate hours in input seconds

       cout << time << " hours in "<<seconds<<" seconds \n";   }

//displays the time in hours

   else if (seconds >= 86400)    { //if seconds is greater or equal to 86400

       time = seconds / 86400; //compute the days

       cout << time << " days in  "<<seconds<<" seconds \n";   } }

//displays the number of days in input number of seconds

Explanation:

This program first prompts the user to enter the time in seconds and computes the number of minutes, hour or days according to the conditions specified in the program. If the value of seconds entered by the user is less than or equal to 59, the number of seconds are displayed as output, otherwise the if and else if conditions are checked if the input value of seconds is greater than 60 to compute the corresponding minutes, hours or days. Everything is explained within the comments in the program.You can change the data type of time variable from int to float to get the value floating point numbers. Here i am using int to round the time values. The screenshot of the output is attached.

serious [3.7K]3 years ago
6 0

Answer:

The solution code is written in Python:

  1. sec = int(input("Enter number of seconds: "))
  2. if(sec >=60):
  3.    min = sec // 60
  4.    sec = sec % 60
  5. else:
  6.    min = 0
  7. print(str(min) + " minutes " + str(sec) + " seconds")

Explanation:

Firstly, use input function to prompt user to enter number of seconds and assign the input value to variable sec (Line 1).

Next, create an if statement to check if the sec is bigger or equal to 60 (Line 3). If so, we user // operator to get minutes and use % operator to get the seconds (Line 4 - 5).

Then we use print function to print the minutes and seconds (Line 9).

You might be interested in
What is metrical task system algorithm?? and can we use that in online shopping project??
jeyben [28]

Answer:

Metrical task system algorithm is the online algorithm that is used for organizing the online problems like k-server issues, paging issues etc.This task system works in the form of metrics to decrease the complete cost  experienced due to processing of the operation and analyzing the competition.

It can be used for the online shopping project for the analyzing the comparison between the performance on basis of online and offline trends and then optimization can take place according to the the results.

7 0
3 years ago
A power ratio of 9000000:1 corresponds to ... dB?
sertanlavr [38]

Answer:

69.54

Explanation:

A power ratio of 9000000:1 corresponds to 69.54 dB.

The calculation is presented below:

Formula for calculating Power ratio (db) = 10 * log [P(out)/P(in)]

Since the given ratio is 9000000:1, substituting in the formula gives us 10 * log (9000000/1)

Note that log 9000000 = 6.954

Therefore, 10 * log (9000000/1) = 69.54

Hence the required power ratio in db is 69.54 db.

4 0
3 years ago
Which of the following describes the test phase of the program process
wlad13 [49]

Program testing is an evaluative process which is also called Unit Testing by the programmers.

Explanation:

Software testing is an important step in the software development process. The procedure analyzes the functionality of it and if it meets the specified requirements or not. This is a four-stage procedure that involves analysis, planning, development, setting the test environment, and finally the execution of the test.

The main stages of testing that will result in an error-free and quality product are-  

  1. Unit testing
  2. Integration testing
  3. System testing
  4. Acceptance testing

3 0
3 years ago
The rules and guidelines for appropriate computer mediated communication are called?
irinina [24]
<span>The rules and guidelines for appropriate computer mediated communication are called netiquette. 
It is a blend of two words: net (from Internet) and etiquette, or the appropriate behavior. 
</span>
4 0
3 years ago
PLEASE HELPPPPPPPPPPPPPPPPPPPPPPPP LASTTTTT QUESTION FINALLLY :)))))
aleksandrvk [35]
Last of the three.
Basic membership is free (I think).
6 0
2 years ago
Other questions:
  • It is okay to use a dust rag when cleaning the inside of a computer.
    9·2 answers
  • The following algorithm should output the t times table in the format:
    6·1 answer
  • Under which key category do the Page Up and Page Down keys fall?
    10·2 answers
  • Which of the following about if statement is true? A. The condition is a Boolean expression B. A Boolean expression is something
    15·1 answer
  • How should font appear in a slide presentation compared to the font in a document
    7·1 answer
  • Which of the following is true about radio waves? They have short wavelengths. They have high energies. They reveal hot gases. T
    10·2 answers
  • While reviewing the Quick Access toolbar, Sarah notices that the Redo button is not there. This is because the Redo button only
    12·1 answer
  • The advancement of technology in our daily lives has changed how we interact with the world.
    10·1 answer
  • Match the elements used in web searches to their functions.
    12·1 answer
  • The use of technology to observe a user's actions often without the user's knowledge is known as:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!