Concept explainers
The programmer intended the following pseudocode to display the numbers 1 through 60, and then display the message "Time's up!" It will not function as intended, however. Find the error.
Declare Integer counter = 1
Const Integer TIME_LIMIT = 60
While counter < TIME_LIMIT
Display counter
Set counter = counter +
End While
Display "Time's up!"
Learn your wayIncludes step-by-step video
Chapter 5 Solutions
EBK STARTING OUT WITH PROGRAMMING LOGIC
Additional Engineering Textbook Solutions
Java: An Introduction to Problem Solving and Programming (7th Edition)
Database Concepts (8th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Introduction To Programming Using Visual Basic (11th Edition)
Starting Out with Java: Early Objects (6th Edition)
Starting out with Visual C# (4th Edition)
- (Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like, with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with the expression dots=(int)(6.0randomnumber+1), where the random number is between 0 and 1.)arrow_forwardIn the expression, int n = rand() % 33 - 32; a. Generates a value in the range [-32, 0] b. Generates a value in the range [-32, 32] c. Generates a value in the range [0, 33] d. Generates a value in the range [-33, 0] e. Generates a value in the range [0, 32]arrow_forwardWrite an expression that obtains a random integer between 34 and 55. Write an expression that obtains a random integer between 0 and 999.arrow_forward
- 1.) Using Python programming language, create a SERIES CIRCUIT program. Input: 1 voltage source Number of resistors Value of each resistor Output: Display total current and display each voltage of each resistor. Example: Voltage value (V): 12 Number of resistors: 2 Resistor 1 value (ohm): 6 Resistor 2 value (ohm): 4 Total current is 1.2 A Resistor 1 voltage is 7.2 V Resistor 2 voltage is 4.8 V 2.) Using Python programming language, create a PARALLEL CIRCUIT program. Input: 1 voltage source Number of resistors Value of each resistor Output: Display total current and display each current of each resistor. Example: Voltage value (V): 12 Number of resistors: 2 Resistor 1 value (ohm): 5 Resistor 2 value (ohm): 8 Total current is 3.9 A Resistor 1 current is 2.4 A…arrow_forwardDebugging: Find the error if there's any and rewrite, make a pseudocode and flowchart.arrow_forwardQ5: - Write program to calculate the equation sin(x) y(x) = x * where x= 0.1,0.2,0.3,0.4arrow_forward
- Write a Phyton program that computes the duration of a projectile’s flight and its height above the ground when it reaches the target. As part of your solution, you should display instructions to the program user. Relevant formula: time = distancevelocity xcos (θ) height = velocity xsin x time- g x time22 use the following variables: g = gravitational constant = 32.17 = angle of elevation in radian v = velocity or the projectile velocity (ft/sec) d= distance to target t = time of flight in seconds. h = height at impact Try your program on these data sets.arrow_forwardComputer Science Short Answer Write a program that uses the Scanner to ask the user for an integer, but forces the user to repeatedly re-enter the number until they enter a negative value. Then if the number is odd, print it out. Otherwise, check if the number is less than -10 and if so, print it out twice. For example: 4 you would be forced to re-enter -3 is printed once -8 is not printed -13 is printed once -40 is printed twice.arrow_forwardQ10: Write the program in Python that writes the even numbers and counter value on the screen according to the starting and ending values entered as positive integers from the keyboard. (Starting and ending will be included if they are in pairs) Example: Enter the starting and ending value: 5 10 The numbers are: 6, 8, 10 3 numbers in totalarrow_forward
- PEN AND PAPER FLOWCHART. Hand write the correct pseudocode using pen and paper. // This pseudocode is intended to determine whether students have// passed or failed a course; student needs to average 60 or// more on two tests.start Declarations num firstTest num secondTest num average num PASSING = 60 while firstTest not equal to 0 output "Enter first score or 0 to quit " input firstTest output "Enter second score" input secondTest average = (firstTest + secondTest) / 2 ouput "Average is ", average if average >= PASSING then output "Pass" else output "Fail" endif endwhilestoparrow_forwardWrite an expression that obtains a random integer between 34 and 55. Write an expression that obtains a random integer between 0 and 999. Write an expression that obtains a random number between 5.5 and 55.5.arrow_forwardComputer Engineering Assignment: Write a Python Program to find factorial of a number and also draw it's flowchartarrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,