Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 5, Problem 3RQ
Program Description Answer
In the pretest loop, instructions may not be executed at all; in the posttest loop, instructions are executed at least once.
Hence, the correct answer is option “B”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
JAVA
Project 2-3 Rectangle Calculator
Create an application that calculates the area and perimeter of a rectangle. Then using a loop, ask the user if they want to continue. If yes then repeat the input, processing, and output. If no then end the program.
Console
Welcome to the Area and Perimeter Calculator
Enter length: 100
Enter width: 200
Area: 20000.0
Perimeter: 600.0
Continue? (y/n): y
Specifications
The formulas for calculating area and perimeter are:
area = width * lengthperimeter = 2 * width + 2 * length
The application should accept decimal entries like 10.5 and 20.65.
Assume that the user will enter valid numeric data for the length and width.
The application should continue only if the user enters “y” or “Y” to continue.
Input:
Print the header "Welcome to the Area and Perimeter Calculator"
Ask the user to enter a length
Ask the user to enter a width
Processing:
Save the length and width in variables
Calculate the area and save the results in a variable…
computer programming
Loop is used to repeat a sequence of actions or statements many times. Simplydescribe the differences between for-loop and while-loop.
P7
Chapter 5 Solutions
Programming with Microsoft Visual Basic 2017
Ch. 5 - Rewrite the Loop clause from Question 1 using the...Ch. 5 - Prob. 2MQ3Ch. 5 - Write a For clause that repeats the loop body...Ch. 5 - Write an Add method that adds the contents of the...Ch. 5 - Prob. 2MQ6Ch. 5 - Which of the following clauses will stop the loop...Ch. 5 - Which of the following statements can be used to...Ch. 5 - Prob. 3RQCh. 5 - Prob. 4RQCh. 5 - Prob. 5RQ
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- AdderAA.java This program will allow the user to select how many numbers they’d like to add together, and then enter those numbers to be totaled. The program should run in a continuous loop unless the user enters zero at the menu (in this case the program should end). A negative menu answer should give an “invalid response.” Your code should catch input mismatches. There will be multiple loops and probably an if/else structure required to accomplish this. You cannot use a break statement or any other non-logical way such as System.exit to exit a loop. This will result in a loss of major points. The example below is one continuous run of the program. Your program should run the test case exactly as it appears below, and should work on any other case in general. Output Example This program will add numbers together. Tell me how many numbers you’d like to add or type 0 to end the program. >>>3 Enter your number: 4.0 Enter your number: 3.2 Enter your number: -1.0 The sum of your…arrow_forwardTranscribed Image Text Create a program that allows the user to do some basic functions. First, ask the user if they would like to find out sqrt, log or factorial of a number, then return the results. Here is the sample output: Welcome to the simple math helper. What would you like to calculate? 1. Sqrt 2. Log 3. Factorial > 1 Enter the number to sqrt: >9arrow_forwardCENGAGE MINDTAP Programming Exercise 6-4 Instructions Write an application that prompts a user for two integers and displays every integer between them. Display There are no integers between X and Y if there are no integers between the entered values. Make sure the program works regardless of which entered value is larger. An example of the program is shown below: Enter an integer >> 12 Enter another integer >> 20 The numbers between 12 and 20 include: 13 14 15 16 17 18 19 Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade. Once you are happy with your results, click the Submit button to record your score.arrow_forward
- A ______ value is a special value that is used to terminate a loop when a set of data is being entered. Select one: a. Break b. Marker c. Control d. Sentinelarrow_forwardLap Timer Tool Write a Python (GUI program) that asks the user to enter the number of times that they have run around a racetrack, and then uses a loop to prompt them to enter the lap time for each of their laps. When the loop finishes, the program should display the time of their fastest lap, the time of their slowest lap, and their average lap time.arrow_forwardPYTHON: The following code causes an infinite loop. Can you figure out what is incorrect? def test_code(num): x = num while x % 2 == 0: x = x / 2 test_code(0) When called with 0, it triggers an infinite loop The modulo operator is used incorrectly Missing an else statement Missing the continue keywordarrow_forward
- Instructions Objectives: Use a while loop Use multiple loop controlling conditions Use a boolean method Use the increment operator Extra credit: Reuse earlier code and call two methods from main Details:This assignment will be completed using the Eclipse IDE. Cut and paste your code from Eclipse into the Assignment text window. This is another password program. In this case, your code is simply going to ask for a username and password, and then check the input against four users. The program will give the user three tries to input the correct username-password combination. There will be four acceptable user-password combinations: alpha - alpha1 beta - beta1 gamma - gamma1 delta - delta1 If the user types in one of the correct username-password combinations, then the program will output: “Login successful.” Here are a couple of example runs (but your code needs to work for all four user-password combinations): Username: betaType your current password: beta1Login…arrow_forwardWrite the pseudocode for a program that will continue prompting a user for a value whilst the total of all values remain less than 100. The program must keep track of the number of times the loop executes and display the number of times the loop executed once the loop had finished executing.arrow_forwardPlease provide answer in C#: Slot Machine Simulation A slot machine is a gambling device into which the user inserts money and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user. Create an application that simulates a slot machine. Figure 8-23 (on page 539 of your book) shows an example of how the form should look. The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols. You will find a set of fruit symbols attached to this dropbox for your use - from the Student Sample Programs provided by the book author.) If none of the randomly displayed images match, the program should inform the user that he or she has won…arrow_forward
- Lap Timer Tool Write a program ON PYTHON that asks the user to enter the number of times that they have run around a racetrack, and then uses a loop to prompt them to enter the lap time for each of their laps. When the loop finishes, the program should display the time of their fastest lap, the time of their slowest lap, and their average lap time.arrow_forwardIn a loop when a condition is false you come out of the loop. However, interesting things happen when the condition is true and you remain in the loop. What kinds of interesting things happen discuss with arguments.arrow_forwardI want answer is visual basics coding dont paste answer of any other languagearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License