Write a program that asks the user to enter the number of seconds as an integer value
Question:
Write a program that asks the user to enter the number of seconds as an integer value (use type long, or, if available, long long) and that then displays the equivalent time in days, hours, minutes, and seconds. Use symbolic constants to represent the number of hours in the day, the number of minutes in an hour, and the number of seconds in a minute.The output should look like this:
Enter the number of seconds: 31600000
31600000 seconds = 365 days, 17 hours, 46 minutes, 40 seconds
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 52% (17 reviews)
include using namespace std int main long long seconds const int MINSPERHOUR 60 const int HOURSPE...View the full answer
Answered By
Labindao Antoque
I graduated in 2018 with a Bachelor of Science degree in Psychology from Dalubhasaan ng Lungsod ng San Pablo. I tutored students in classes and out of classes. I use a variety of strategies to tutor students that include: lecture, discussions about the subject matter, problem solving examples using the principles of the subject matter being discussed in class , homework assignments that are directed towards reinforcing what we learn in class , and detailed practice problems help students to master a concept. I also do thorough research on Internet resources or textbooks so that I know what students need to learn in order to master what is being taught in class .
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Write a program that asks the user to enter a number of seconds. 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...
-
Write a program that asks the user to enter the number of calories and fat grams in a food item. The program should display the percentage of the calories that come from fat. One gram of fat has 9...
-
Write a program that asks the user to enter a favorite color, a favorite food, a favorite animal, and the first name of a friend or relative. The program should then print the following two lines,...
-
A Continuous fractional column, operating at atmospheric pressure, is to be designed to separate a mixture containing 20 per cent benzene in toluene into an overhead product containing 90 percent...
-
The following data are pertinent for Companies A and B: a. If the two companies were to merge and the share exchange ratio were 1 share of Company A for each share of Company B, what would be the...
-
Repeat Problem P4-3 for the NRZ-I scheme. Problem 4-3 Draw the graph of the NRZ-L scheme using each of the following data streams, assuming that the last signal level has been positive. From the...
-
List the different safety measure guidelines of a theme park in your country. LO.1
-
Joan Messineo borrowed $15,000 at a 14% annual rate of interest to be repaid over 3 years. The loan is amortized into three equal, annual, end-of-year payments. a. Calculate the annual, end-of-year...
-
Exercise 1-11 Incomplete manufacturing cost data for Horizon Company for 2020 are presented as follows for four different situations. X Your answer is incorrect. Try again. Indicate the missing...
-
Consider the following all-integer linear program: Max 5x1 + 8x2 s.t. 6x1 + 5x2 30 9x1 + 4x2 36 1 x1 + 2 x2 10 x1, x2 0 and integer a. Graph the constraints for this problem. Use dots to indicate...
-
Consider the two C++ statements that follow: char grade = 65; char grade = 'A'; Are they equivalent?
-
What is the distinction between 33L and 33?
-
A two-wire transmission line consists of a pair of nonpermeable parallel wires of radii a and b separated by a distance d > a + b. A current flows down one wire and back the other. It is uniformly...
-
Complete the "Leadership Vision Questionnaire" in Chapter 7 (p176). Reflect on your results and complete the following prompts: Share the results from your questionnaire. Be sure to include the final...
-
1. Prepare el Presupuesto Operacional hasta completar el COGS (70 puntos) La empresa ACCO 295 tiene una venta proyectada de $450,000 Cada unidad se vende $450 Su inventario inicial 300 (costo $125)...
-
Continuing Case 65. Retirement Income Forecast Jamie Lee and Ross, now 57 and still very active, have plenty of time on their hands now that the triplets are away at college. They both realized that...
-
The partnership of Frick, Wilson, and Clarke has elected to cease all operations and liquidate its business property. A balance sheet drawn up at this time shows the following account balances: Cash...
-
Harry and Sally went to a large hardware store and told the salesperson they wanted the cheapest rotating clothesline in stock, provided it would bear a heavy load of washing. The salesperson assured...
-
A rain gutter is to be constructed of aluminum sheets 12 inches wide. After marking off a length of 4 inches from each edge, this length is bent up at an angle . See the illustration. The area A of...
-
You work as an operations consultant for a textile company. Your client has a well-established distribution system in the US market. The company has hundreds of stores and four distribution centers....
-
Derive a minimal state table for a single-input and single-output Moore-type FSM that produces an output of 1 if in the input sequence it detects either 110 or 101 patterns. Overlapping sequences...
-
Derive the circuits that implement the state tables in Figures 6.51 and 6.52. What is the effect of state minimization on the cost of implementation? Present state A B C D E F G Next state w = 0 w =...
-
Write Verilog code for the FSM described in Problem 6.3. Data From Problem 6.3. Derive the state diagram for an FSM that has an input w and an output z. The machine has to generate z = 1 when the...
-
Long-term liabilities are shown in two places in the business firm's balance sheet depending upon when the long-term liabilities are scheduled for payment. True False
-
Julio is single with 1 withholding allowance. He earned $1,025.00 during the most recent semimonthly pay period. He needs to decide between contributing 3% and $30 to his 401(k) plan. If he chooses...
-
Acquirer firm plans to launch a takeover of Target firm. The manager of Acquirer indicates that the deal will increase the free cash flow of the combined business by $13.6m per year forever. The beta...
Study smarter with the SolutionInn App