(How Fast Is Your Computer?) How can you determine how fast your own computer really operates? Write a program with a while loop that counts from 1 to 1,000,000,000 by 1s. Every time the count reaches a multiple of 100,000,000, print that number on the screen. Use your watch to time how long each 100 million iterations of the loop takes.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
C How to Program (8th Edition)
Additional Engineering Textbook Solutions
Programming in C
Starting Out with C++ from Control Structures to Objects (8th Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting Out with Python (4th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- 12. In .............., the bodies of the two loops are merged together to form a single loop provided that they do not make any references to each other. a. Loop unrolling b. Strength reduction c. Loop concatenation d. Loop jammingarrow_forward3. Negative Allergy by CodeChum Admin Whole numbers are great, but I think we should also pay attention to decimal numbers, too. So, how about we make a program that involves a lot of decimals? Instructions: Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable. The loop shall only terminate for the following reasons: A negative decimal number is inputted (but still included in the total sum) The total sum reaches 100.0 or more Instructions Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable. The loop shall only terminate for the following reasons: A negative decimal number is inputted (but still included in the total sum) The total sum reaches 100.0 or more Input Multiple lines containing float number on each. 1.1 1.2 1.3 1.4 -1.0 Output A line containing a float number with two decimal places.…arrow_forwardPlease do this using 3 while loops.arrow_forward
- Complete the following sentence. There are two additional statements that can be used to control the operation of while loops and for loops: the and continue statements.arrow_forwardExamine the following for loops and determine the value of ires at the end of each of the loops, and also the number of times each loop executes.arrow_forwardI can't figure this one out for the life of me. I've been stuck on it for 4 hours now... HELP! The programming language is python Write a program that prompts the user to enter a series of strings, but with each string containing a small integer. Use a while loop and stop the loop when the user enters a zero. When the loop has finished, the program should display: • the number of user inputs (not counting the final zero input). • the total of the integers in the strings entered. • the average of the integers accurate to one decimal place.arrow_forward
- Please, solve the following problem and explain how the loop works .arrow_forwardI can't figure this one out for the life of me. I've been stuck on it for 4 hours now... HELP! The programming language is python Write a program that prompts the user to enter a series of strings, but with each string containing a small integer. Use a while loop and stop the loop when the user enters a zero. When the loop has finished, the program should display: the number of user inputs (not counting the final zero input). the total of the integers in the strings entered. the average of the integers accurate to one decimal place.arrow_forwardCombine the statements that you wrote in Exercise 3.4 into a program that calculates thesum of the integers from 1 to 10. Use the while statement to loop through the calculation and increment statements. The loop should terminate when the value of x becomes 11.arrow_forward
- We learn about several types of loops. Describe specifically when it is appropriate to use: a for loop a while loop a do-while looparrow_forwardHelp me to make it easy and using while loop onlyarrow_forwardWhole numbers are great, but I think we should also pay attention to decimal numbers, too. So, how about we make a program that involves a lot of decimals? Instructions: Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable. The loop shall only terminate for the following reasons: A negative decimal number is inputted (but still included in the total sum) The total sum reaches 100.0 or more Instructions Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable. The loop shall only terminate for the following reasons: A negative decimal number is inputted (but still included in the total sum) The total sum reaches 100.0 or morearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning