Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 5, Problem 1MQ4
Write a For clause that repeats the loop body instructions 10 times. Use intX as the counter variable’s name, and declare the variable in the For clause.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Using VB
Write a For clause that repeats the loop body instructions 10 times. Use IntY as the counter variable's name, and declare the variable in the For clause.
How do you decide whether a condition should be checked at the top of a loop or at the bottom?
Evaluate the following postfix expression. Show step by step.
4 7 + 8 *
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
- he continue statement performs a "jump" to the next test condition. True Falsearrow_forwardTrue or False? In a do…while loop, the condition is checked at the bottom of the loop.arrow_forwardIn the switch statement, we can use int type only for the control variables that are being tested in the loop condition. True Falsearrow_forward
- QUESTION 8 Check the following do while loop segment. Which statement shows has the correct description? int a=1; do { printf ("I love C"); a+=2; }while (a<0); It does not loop at all due to false condition. It contains syntax error. O The loop executes once and expired There is no update statement to update control variable value. QUESTION 9 ofuarinhle y and y after executing the following statements?arrow_forwardWhich of the following statements terminates the execution of a loop and passes control to the next statement after the end of the loop? stop O break arrest haltarrow_forwardWhich kind of while loop may be broken by entering a single character or a single value into the input field? Although the loop eof, loop counter, and loop flag may all be managed, the loop sentinel cannot.arrow_forward
- Which kind of while loop is ended by a character or value entered by the user? While loop eof, loop counter, and loop flag are all under control, and while loop sentinel is also under controlarrow_forward• 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: beta Type your current password: beta1 Login successful. Username: delta Type…arrow_forwardWhich of the following statements is true exclusively for the while loop? Only to the do...while loop? To both of you? It's a conditional loop, for starters. The loop's body is executed at least once. Before the loop is entered, the logical expression controlling the loop is evaluated. The loop's body may or may not execute.arrow_forward
- Program Purpose - Professional Athletes often hire other professionals to help take care of matters for them. We will group them in four categories: Lawyers, Personal Assistants, Agents, and Trainers. They all get paid a percentage of the athlete's total yearly salary. Lawyers - 10%, Personal Assistants - 3%, Agents - 7%, and Trainers - 5% . Prompt the user to enter the athlete's salary for the year (ensure that the entered value is positive). The user should then enter the name and category of each of the hired professionals. The athlete should be able to hire as many professionals in each category as he/she wants, even if it is more than he/she can afford. Based on the category, calculate the amount that each professional should be paid. After all data has been entered, print the names of each professional hired, how much each is being paid, the total amount the athlete paid, and how much the athlete has left.arrow_forwardWhich statement type is a loop control structure that includes a loop-control variable, a test, and an update in its statement header? a. for b. do c. do...while O d. casearrow_forward""" MovieGuide.py This program allows each theater patron to enter a value from 0 to 4 indicating the number of stars that the patron awards to the Guide's featured movie of the week. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, the average star rating for the movie is displayed. """ # Initialize variables. totalStars = 0 # total of star ratings. numPatrons = 0 # keep track of number of patrons averageStars = 0 numStars = 0 # Get input. numStarsString = input("Enter rating for featured movie: ") # Convert to double. numStars = float(numStarsString) # Write while loop here while numStars >= 0 and numStars <= 4: numPatrons = numPatrons + 1 # incrementor totalStars = totalStars + numStars # Get input. numStarsString = input("Enter rating for featured movie: ") # Convert to double. numStars = float(numStarsString) # Calculate average star rating averageStars - totalStars / numPatrons print("Average…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Control Structures - while loop - do-while loop - for loop - Goto - break - continue statements; Author: EzEd Channel;https://www.youtube.com/watch?v=21l11_9Osd0;License: Standard YouTube License, CC-BY