Question: Write the Do While loop using a sentinel value to control the loop, and also write the statements that make up the body of the

Write the Do While loop using a sentinel value to control the loop, and also write the statements that make up the body of the loop.

In this lab, you write a Do While loop that uses a sentinel value to control a loop in a Visual Basic program provided with the data files for this book. You also write the statements that make up the body of the loop. The source code file already contains the necessary variable declarations and output statements. You designed this program for the Hollywood Movie Rating Guide in Chapter 5, Exercise 15, in Programming Logic and Design. Each theater patron enters a value from 0 to 4 indicating the number of stars that the patron awards to the Guides 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, you should display the average star rating for the movie.

' MovieGuide.vb - 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.
Option Explicit On
Option Strict On
Module MovieGuide
Sub Main()
' Declarations
Dim numStars As Integer ' Star rating
Dim numStarsString As String ' String version of star rating
Dim averageStars As Double ' Average star rating
Dim totalStars As Double = 0 ' Total of star ratings
Dim numPatrons As Integer = 0 ' Keep track of number of patrons
' This is the work done in the housekeeping() procedure
' Get input
' This is the work done in the detailLoop() procedure
' Convert to Integer
' Write loop here
' This is the work done in the endOfJob procedure
' Calculate average star rating
System.Console.WriteLine("Average Star Value: " & averageStars)
End Sub ' End of Main() procedure
End Module ' End of MovieGuide module

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!